From d13d4ad946a8e6e6b209e0fe6fee5d93bd38e3e2 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 17 May 2001 20:12:16 +0000 Subject: Fix up some problems noted by August Hoerandl when cross compiling with shared lib support, there were spots where the native 'ld' was mistakenly being called. --- extra/scripts/get-needed-libgcc-objects.sh | 6 +++--- libc/Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extra/scripts/get-needed-libgcc-objects.sh b/extra/scripts/get-needed-libgcc-objects.sh index 4bbbb328b..7217ee6ac 100755 --- a/extra/scripts/get-needed-libgcc-objects.sh +++ b/extra/scripts/get-needed-libgcc-objects.sh @@ -17,7 +17,7 @@ LIBGCC=`$CC -print-libgcc-file-name` echo Finding missing symbols in libc.a ... echo " partial linking..." rm -f libc.ldr -ld -r -o libc.ldr ../crt0.o --whole-archive ../libc.a +$LD -r -o libc.ldr ../crt0.o --whole-archive ../libc.a if nm --undefined-only libc.ldr | grep -v "^main$" > sym.need ; then rm -f obj.need @@ -44,7 +44,7 @@ echo Extracting referenced libgcc.a objects ... rm -f obj.need.0 touch obj.need.0 while [ -s obj.need ] && ! cmp -s obj.need obj.need.0 ; do - (cd tmp-gcc ; cat ../obj.need | xargs ld -r -o ../libgcc.ldr) + (cd tmp-gcc ; cat ../obj.need | xargs $LD -r -o ../libgcc.ldr) cp obj.need obj.need.0 if nm --undefined-only libgcc.ldr > sym.need ; then for SYM in `cat sym.need | sed -e 's/ U //g'` ; do @@ -72,4 +72,4 @@ if [ -s sym.need ] ; then else echo Done fi -exit 0 \ No newline at end of file +exit 0 diff --git a/libc/Makefile b/libc/Makefile index 18142f9ee..35d6b3e4a 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -43,7 +43,7 @@ $(LIBNAME): subdirs shared: $(TOPDIR)lib/$(LIBNAME) @rm -rf tmp @mkdir tmp - @(cd tmp; CC=$(CC) /bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh) + @(cd tmp; CC=$(CC) LD=$(LD) /bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh) if [ -s ./tmp/libgcc-need.a ] ; then \ $(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \ -Wl,-soname=$(SHARED_MAJORNAME) -Wl,--whole-archive \ -- cgit v1.2.3