summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xextra/scripts/get-needed-libgcc-objects.sh8
-rw-r--r--ldso/ldso/Makefile2
-rw-r--r--libc/Makefile2
3 files changed, 5 insertions, 7 deletions
diff --git a/extra/scripts/get-needed-libgcc-objects.sh b/extra/scripts/get-needed-libgcc-objects.sh
index f8d2da4d2..588634c8d 100755
--- a/extra/scripts/get-needed-libgcc-objects.sh
+++ b/extra/scripts/get-needed-libgcc-objects.sh
@@ -15,12 +15,10 @@
#Enable this when debugging
#set -x
-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 ../../lib/crt0.o ../../lib/crti.o ../../lib/crtn.o --whole-archive ../libc.a
+$LD $LDFLAGS -r -o libc.ldr ../../lib/crt0.o ../../lib/crti.o ../../lib/crtn.o --whole-archive ../libc.a
if $NM --undefined-only libc.ldr 2>&1 | grep -v "^main$" | grep -v "^_GLOBAL_OFFSET_TABLE_$" | grep -v "_gp_disp" > sym.need ; then
EXIT_WITH_ERROR=0
@@ -54,9 +52,9 @@ touch obj.need.0
cmp -s obj.need obj.need.0 ; state=$?
while [ -s obj.need ] && [ $state -ne 0 ] ; do
- (cd tmp-gcc && cat ../obj.need | sort | uniq | xargs $LD -r -o ../libgcc.ldr)
+ (cd tmp-gcc && cat ../obj.need | sort | uniq | xargs $LD $LDFLAGS -r -o ../libgcc.ldr)
cp obj.need obj.need.0
- if $NM --undefined-only libgcc.ldr > sym.need 2>&1 ; then
+ if $NM --undefined-only libgcc.ldr | grep -v "^_GLOBAL_OFFSET_TABLE_$" > sym.need 2>&1 ; then
for SYM in `cat sym.need | sed -e 's/ U //g'` ; do
if $NM -s $LIBGCC 2>&1 | grep -q $SYM" in " ; then
$NM -s $LIBGCC 2>&1 | grep $SYM" in " | cut -d' ' -f3 >> obj.need
diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile
index e3c03c003..53c3c6385 100644
--- a/ldso/ldso/Makefile
+++ b/ldso/ldso/Makefile
@@ -31,7 +31,7 @@ LDSO_FULLNAME=ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
XXFLAGS+=-DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\"
-LDFLAGS=-shared --warn-common --export-dynamic --sort-common \
+LDFLAGS=$(CPU_LDFLAGS-y) -shared --warn-common --export-dynamic --sort-common \
-z combreloc --discard-locals --discard-all
CSRC= ldso.c #hash.c readelflib1.c $(TARGET_ARCH)/elfinterp.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
diff --git a/libc/Makefile b/libc/Makefile
index f5ee035fa..595f69e4a 100644
--- a/libc/Makefile
+++ b/libc/Makefile
@@ -49,7 +49,7 @@ shared: $(TOPDIR)lib/$(LIBNAME)
@rm -rf tmp
@mkdir tmp
$(AR) rv ./tmp/libgcc-need.a
- @(cd tmp && CC=$(CC) LD=$(LD) NM=$(NM) AR=$(AR) LIBGCC=$(LIBGCC) \
+ @(cd tmp && CC=$(CC) LD=$(LD) LDFLAGS=$(CPU_LDFLAGS-y) NM=$(NM) AR=$(AR) LIBGCC=$(LIBGCC) \
/bin/sh $(TOPDIR)../extra/scripts/get-needed-libgcc-objects.sh)
$(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \
--whole-archive ./tmp/libgcc-need.a $(LIBNAME) --no-whole-archive \