From: Rainer Orth Date: Wed, 19 Nov 2025 08:19:10 +0000 (+0100) Subject: Fix typo in sol2.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2e3eb726be5b386c4c5738c67f0e39fec983d38;p=thirdparty%2Fgcc.git Fix typo in sol2.h I noticed that gcc/config/sol2.h uses USE_GNU_LD as a guard in one place only. This is a cross of USE_GLD and HAVE_GNU_LD which doesn't exist so the gld variant is never used. This went unnoticed since the wrong versions of LD_WHOLE_ARCHIVE_OPTION and LD_NO_WHOLE_ARCHIVE_OPTION are only ever used in LIBASAN_EARLY_SPEC and only effective when -static-libasan is used. gld would only warn about the unsupported -z options here. The issue wasn't noticed before since the only testcase using -static-libasan isn't run on Solaris, which this patch also corrects. Bootstrapped without regressions on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (both as/ld and gas/gld). 2025-11-18 Rainer Orth gcc: * config/sol2.h: Check USE_GLD instead of USE_GNU_LD. gcc/testsuite: * c-c++-common/asan/pr59063-2.c: Enable on Solaris. --- diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 15ab5d0c455..36337dbf98d 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -224,7 +224,7 @@ along with GCC; see the file COPYING3. If not see in that case, and for executable link with --{,no-}whole-archive around it to force everything into the executable. */ -#ifndef USE_GNU_LD +#ifndef USE_GLD #define LD_WHOLE_ARCHIVE_OPTION "-z allextract" #define LD_NO_WHOLE_ARCHIVE_OPTION "-z defaultextract" #else diff --git a/gcc/testsuite/c-c++-common/asan/pr59063-2.c b/gcc/testsuite/c-c++-common/asan/pr59063-2.c index 63a547f033f..6458ea73023 100644 --- a/gcc/testsuite/c-c++-common/asan/pr59063-2.c +++ b/gcc/testsuite/c-c++-common/asan/pr59063-2.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ +/* { dg-do run { target { *-*-linux* *-*-freebsd* *-*-solaris2* } } } */ /* { dg-options "-static-libasan" } */ #include