This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ld testsuite HOSTING_LIBS for new glibc
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Sun, 9 Nov 2003 23:54:16 +1030
- Subject: ld testsuite HOSTING_LIBS for new glibc
Fixes a problem running the testsuite with recent glibc versions.
Apparently -lgcc -lgcc_eh -lc -lgcc -lgcc_eh is no longer sufficient
when statically linking, as libc.a pulls in objects from libgcc_eh.a,
which then needs extra objects from libc.a.
/usr/local/lib/gcc-lib/powerpc-linux/3.2.4/libgcc_eh.a(unwind-dw2.o)
required by /usr/lib/libc.a(iofclose.o) (_Unwind_Resume)
/usr/local/lib/gcc-lib/powerpc-linux/3.2.4/libgcc_eh.a(unwind-dw2-fde-glibc.o)
required by /usr/local/lib/gcc-lib/powerpc-linux/3.2.4/libgcc_eh.a(unwind-dw2.o) (_Unwind_Find_FDE)
resulting in
/usr/local/lib/gcc-lib/powerpc-linux/3.2.4/libgcc_eh.a(unwind-dw2-fde-glibc.o)(.text+0x191c): In function `_Unwind_Find_FDE':
/src/gcc-ppc64-32/gcc/unwind-dw2-fde-glibc.c:283: undefined reference to `dl_iterate_phdr'
I've also tidied one or two other places in the script to use the
default definition of HOSTING_LIBS, as there seems no harm in searching
for libgcc_eh.a even if it's not used. Cuts down on the number of
places that need editing/checking when making changes. For the same
reason, it's better to edit HOSTING_CRT0 rather than duplicate most of
the default value.
Tested on x86-linux, hppa-linux and powerpc-linux. I don't have access
to other systems to test the netbsd, arm-linux and am33-linux changes,
but they should be safe enough.
* configure.host (HOSTING_LIBS): Group libgcc and libc with
--start-group, --end-group pair.
(*-*-netbsd*, am33_2.0-*-linux*): Use the default HOSTING_LIBS.
(am33_2.0-*-linux*): Edit default HOSTING_CRT0.
(arm*-*-linux-gnu*): Remove extraneous '*' in sed expression.
(hppa*64*-*-linux*, hppa*-*-linux*): Remove target specific case.
Index: ld/configure.host
===================================================================
RCS file: /cvs/src/src/ld/configure.host,v
retrieving revision 1.33
diff -u -p -r1.33 configure.host
--- ld/configure.host 7 Oct 2003 17:30:00 -0000 1.33
+++ ld/configure.host 9 Nov 2003 02:12:43 -0000
@@ -10,7 +10,7 @@
HDEFINES=
HOSTING_CRT0=/lib/crt0.o
-HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo $libgcc -lc $libgcc`'
+HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo --start-group $libgcc -lc --end-group`'
#
# Generic configurations:
@@ -53,7 +53,6 @@ case "${host}" in
# Support for GCC's crtstuff not present.
HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
fi
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
if [ -f `${CC} --print-file-name=crtn.o` ]; then
# Support for GCC's crtstuff present.
if [ -f ../gcc/crtbegin.o ]; then
@@ -81,26 +80,17 @@ case "${host}" in
;;
am33_2.0-*-linux*)
- HOSTING_CRT0='-dynamic-linker `fgrep ld-linux.so \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
arm*-*-linux-gnu*)
- HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"`
+ HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
hppa*64*-*-hpux11*)
HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o
# Even if CC is not gcc, the tests use gcc.
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc /usr/lib/pa20_64/milli.a'
- ;;
-
-hppa*64*-*-linux*)
- ;;
-
-hppa*-*-linux*)
- # Need libgcc for $$dyncall.
- HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} --print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
+ HOSTING_LIBS='--start-group `if [ -f ../gcc/libgcc.a ]; then echo ../gcc/libgcc.a; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc --end-group /usr/lib/pa20_64/milli.a'
;;
i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*)
--
Alan Modra
IBM OzLabs - Linux Technology Centre