https://gcc.gnu.org/g:9947930b7ae923010c5061fd8fa6b1ec4f22f161

commit r16-6005-g9947930b7ae923010c5061fd8fa6b1ec4f22f161
Author: John Ericson <[email protected]>
Date:   Tue Dec 9 22:06:52 2025 +0000

    libgcc: Dont use TARGET_SYSTEM_ROOT from gcc
    
    Following Andrew Pinski's suggestions in
    https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, just
    use the output of:
    
       $(CC) -print-sysroot
    
    It is just used in one spot, in an AIX code-path. I just made (within
    make) a shell variable to use instead.
    
    I don't have AIX on-hand to test this, however.
    
    gcc/ChangeLog:
    
            * Makefile.in: No longer include TARGET_SYSTEM_ROOT in
            libgcc.mvars.
    
    libgcc/ChangeLog:
    
            * config/rs6000/t-slibgcc-aix: Instead of using a
            TARGET_SYSTEM_ROOT make variable, just define a shell variable
            as part of the rule and use that.
    
    Suggested-by: Andrew Pinski <[email protected]>
    Signed-off-by: John Ericson <[email protected]>

Diff:
---
 gcc/Makefile.in                    | 1 -
 libgcc/config/rs6000/t-slibgcc-aix | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a9264bde9bc5..d62314505c95 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2503,7 +2503,6 @@ libgcc.mvars: config.status Makefile specs xgcc$(exeext)
        : > tmp-libgcc.mvars
        echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
        echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
-       echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
 
        mv tmp-libgcc.mvars libgcc.mvars
 
diff --git a/libgcc/config/rs6000/t-slibgcc-aix 
b/libgcc/config/rs6000/t-slibgcc-aix
index 63336876e2ad..4a3d624cfece 100644
--- a/libgcc/config/rs6000/t-slibgcc-aix
+++ b/libgcc/config/rs6000/t-slibgcc-aix
@@ -40,7 +40,9 @@ SHLIB_LINK = \
          -Wl,-bE:@shlib_map_file@ -o shr.o \
          @multilib_flags@ @shlib_objs@ -lc \
          `case @multilib_dir@ in \
-         *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads 
-lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
+         *pthread*) \
+           TARGET_SYSTEM_ROOT=\`$(CC) -print-sysroot\`; \
+           echo -L$$TARGET_SYSTEM_ROOT/usr/lib/threads -lpthreads -lc_r 
$$TARGET_SYSTEM_ROOT/usr/lib/libc.a ;; \
          *) echo -lc ;; esac` ; \
          rm -f tmp-@[email protected] ; \
          $(AR_CREATE_FOR_TARGET) tmp-@[email protected] shr.o ; \
@@ -53,7 +55,9 @@ SHLIB_LINK = \
          -Wl,-bE:@shlib_map_file@ -o $$shr.o \
          @multilib_flags@ @shlib_objs@ -lc \
          `case @multilib_dir@ in \
-         *pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads 
-lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
+         *pthread*) \
+           TARGET_SYSTEM_ROOT=\`$(CC) -print-sysroot\`; \
+           echo -L$$TARGET_SYSTEM_ROOT/usr/lib/threads -lpthreads -lc_r 
$$TARGET_SYSTEM_ROOT/usr/lib/libc.a ;; \
          *) echo -lc ;; esac` ; \
          $(STRIP_FOR_TARGET) -X32_64 -e $$shr.o ; \
          { echo "\#! $(SHLIB_SONAME)($$shr.o)" ; \

Reply via email to