head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2026.07.10.21.28.41; author tsutsui; state Exp; branches; next ; commitid wXBdqe5yqFYFy9NG; desc @@ 1.1 log @gcc15: pull targhooks.cc change for NetBSD from prior gcc versions Use default visibility for __stack_chk_fail_local() on NetBSD. This fixes shared-library links with -fstack-protector-strong or -fstack-protector-all on NetBSD/i386 again. Note comments in NetBSD's gcc/targhooks.cc doesn't look correct: https://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/targhooks.cc.diff?r1=1.1.1.2;r2=1.4 > * This is a hack: > * It appears that our gas does not generate @@PLT for hidden > * symbols. It could be that we need a newer version, or that > * this local function is handled differently on linux. For 32-bit x86 PIC code, GCC emits a hidden reference to __stack_chk_fail_local() rather than default_external_stack_protect_fail(). On NetBSD, GCC is configured with --disable-libssp and NetBSD's __stack_chk_fail_local() is historically provided by libc as a public symbol: https://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/sys/Attic/stack_protector.c#rev1.3 so the hidden reference cannot be resolved even with the newer binutils. (Mabye we should submit this change to GCC upstream?) Bump PKGREVISION of gcc15 and gcc15-libs. @ text @$NetBSD$ - Pull NetBSD local change for gcc's default_hidden_stack_protect_fail() for NetBSD/i386 https://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/targhooks.cc.diff?r1=1.1.1.2;r2=1.4 --- gcc/targhooks.cc.orig 2026-07-10 18:51:24.043844508 +0000 +++ gcc/targhooks.cc @@@@ -1000,7 +1000,17 @@@@ default_hidden_stack_protect_fail (void) DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1; DECL_VISIBILITY_SPECIFIED (t) = 1; +#if defined(__NetBSD__) + /* + * This is a hack: + * It appears that our gas does not generate @@PLT for hidden + * symbols. It could be that we need a newer version, or that + * this local function is handled differently on linux. + */ + DECL_VISIBILITY (t) = VISIBILITY_DEFAULT; +#else DECL_VISIBILITY (t) = VISIBILITY_HIDDEN; +#endif stack_chk_fail_decl = t; } @