From 41dfe61361c9cd15d4021d1bb2542a44929ff081 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 31 Oct 2002 11:54:22 +0000 Subject: Fixup script to avoid potential spurious whining over empty object files. -Erik --- extra/scripts/get-needed-libgcc-objects.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'extra') diff --git a/extra/scripts/get-needed-libgcc-objects.sh b/extra/scripts/get-needed-libgcc-objects.sh index 00cfab2a9..f8d2da4d2 100755 --- a/extra/scripts/get-needed-libgcc-objects.sh +++ b/extra/scripts/get-needed-libgcc-objects.sh @@ -12,6 +12,9 @@ # Possible problems (paranioa mode): Are any of the objects in libgcc.a # needed to actually load the shared library on any archs? +#Enable this when debugging +#set -x + LIBGCC=`$CC -print-libgcc-file-name` echo Finding missing symbols in libc.a ... @@ -19,13 +22,13 @@ 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 -if $NM --undefined-only libc.ldr | grep -v "^main$" | grep -v "^_GLOBAL_OFFSET_TABLE_$" | grep -v "_gp_disp" > sym.need ; then +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 rm -f obj.need touch obj.need for SYM in `cat sym.need | sed -e 's/ U //g'` ; do - if $NM -s $LIBGCC | grep -q $SYM" in " ; then - $NM -s $LIBGCC | grep $SYM" in " | cut -d' ' -f3 >> obj.need + if $NM -s $LIBGCC 2>&1 | grep -q $SYM" in " ; then + $NM -s $LIBGCC 2>&1 | grep $SYM" in " | cut -d' ' -f3 >> obj.need else echo Symbol $SYM needed by libc.a but not found in libgcc.a EXIT_WITH_ERROR=1 @@ -53,10 +56,10 @@ 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) cp obj.need obj.need.0 - if $NM --undefined-only libgcc.ldr > sym.need ; then + if $NM --undefined-only libgcc.ldr > sym.need 2>&1 ; then for SYM in `cat sym.need | sed -e 's/ U //g'` ; do - if $NM -s $LIBGCC | grep -q $SYM" in " ; then - $NM -s $LIBGCC | grep $SYM" in " | cut -d' ' -f3 >> obj.need + if $NM -s $LIBGCC 2>&1 | grep -q $SYM" in " ; then + $NM -s $LIBGCC 2>&1 | grep $SYM" in " | cut -d' ' -f3 >> obj.need fi done fi -- cgit v1.2.3