Skip to content

Commit 9947930

Browse files
Ericson2314jsm28
authored andcommitted
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]>
1 parent 77144dd commit 9947930

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

gcc/Makefile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,6 @@ libgcc.mvars: config.status Makefile specs xgcc$(exeext)
25032503
: > tmp-libgcc.mvars
25042504
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
25052505
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
2506-
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
25072506

25082507
mv tmp-libgcc.mvars libgcc.mvars
25092508

libgcc/config/rs6000/t-slibgcc-aix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ SHLIB_LINK = \
4040
-Wl,-bE:@shlib_map_file@ -o shr.o \
4141
@multilib_flags@ @shlib_objs@ -lc \
4242
`case @multilib_dir@ in \
43-
*pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
43+
*pthread*) \
44+
TARGET_SYSTEM_ROOT=\`$(CC) -print-sysroot\`; \
45+
echo -L$$TARGET_SYSTEM_ROOT/usr/lib/threads -lpthreads -lc_r $$TARGET_SYSTEM_ROOT/usr/lib/libc.a ;; \
4446
*) echo -lc ;; esac` ; \
4547
rm -f tmp-@[email protected] ; \
4648
$(AR_CREATE_FOR_TARGET) tmp-@[email protected] shr.o ; \
@@ -53,7 +55,9 @@ SHLIB_LINK = \
5355
-Wl,-bE:@shlib_map_file@ -o $$shr.o \
5456
@multilib_flags@ @shlib_objs@ -lc \
5557
`case @multilib_dir@ in \
56-
*pthread*) echo -L$(TARGET_SYSTEM_ROOT)/usr/lib/threads -lpthreads -lc_r $(TARGET_SYSTEM_ROOT)/usr/lib/libc.a ;; \
58+
*pthread*) \
59+
TARGET_SYSTEM_ROOT=\`$(CC) -print-sysroot\`; \
60+
echo -L$$TARGET_SYSTEM_ROOT/usr/lib/threads -lpthreads -lc_r $$TARGET_SYSTEM_ROOT/usr/lib/libc.a ;; \
5761
*) echo -lc ;; esac` ; \
5862
$(STRIP_FOR_TARGET) -X32_64 -e $$shr.o ; \
5963
{ echo "\#! $(SHLIB_SONAME)($$shr.o)" ; \

0 commit comments

Comments
 (0)