diff options
Diffstat (limited to 'contrib/binutils/ld/configure.host')
-rw-r--r-- | contrib/binutils/ld/configure.host | 91 |
1 files changed, 52 insertions, 39 deletions
diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host index 436a912..f2e1eb4 100644 --- a/contrib/binutils/ld/configure.host +++ b/contrib/binutils/ld/configure.host @@ -7,12 +7,10 @@ # HDEFINES host specific compiler flags # HOSTING_CRT0 crt0.o file used for bootstrapping # HOSTING_LIBS libraries used for bootstrapping -# NATIVE_LIB_DIRS library directories to search on this host 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`' -NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib' +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: @@ -20,13 +18,8 @@ NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib' case "${host}" in -*-*-freebsd*) - NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib' - # Older versions of gcc do not use a specs file. In those cases, - # gcc -print-file-name=specs will simply print specs. We create a - # dummy specs files to handle this. - echo "-dynamic-linker `${CC} --print-prog-name=ld-elf.so.1`" > specs - HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`' +*-*-freebsd* | *-*-kfreebsd*-gnu) + HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`' HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; @@ -44,6 +37,36 @@ case "${host}" in HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; +*-*-netbsd*) + # Different versions of NetBSD with the ELF object format use different + # sets of start/end files. + HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o' + if [ -f `${CC} --print-file-name=crti.o` ]; then + # Support for GCC's crtstuff present. + HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crti.o`" + if [ -f ../gcc/crtbegin.o ]; then + HOSTING_CRT0="$HOSTING_CRT0 ../gcc/crtbegin.o" + else + HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`" + fi + else + # Support for GCC's crtstuff not present. + HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`" + fi + if [ -f `${CC} --print-file-name=crtn.o` ]; then + # Support for GCC's crtstuff present. + if [ -f ../gcc/crtbegin.o ]; then + HOSTING_LIBS="$HOSTING_LIBS ../gcc/crtend.o" + else + HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`" + fi + HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtn.o`" + else + # Support for GCC's crtstuff not present. + HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`" + fi + ;; + esac # @@ -56,48 +79,45 @@ case "${host}" in # No further tweaking needed ;; -alpha*-*-netbsd*) - HOSTING_CRT0=/usr/lib/crt0.o +am33_2.0-*-linux*) + 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*) - NATIVE_LIB_DIRS=/usr/lib/pa20_64 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' + 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[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*) +i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*) HOSTING_CRT0=/usr/lib/crt0.o ;; -i[3456]86-*-sysv4*) +i[3-7]86-*-sysv4*) HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o' - NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' ;; -i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*) +i[3-7]86-sequent-ptx* | i[3-7]86-sequent-sysv*) HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' ;; -i[3456]86-*-sysv*) +i[3-7]86-*-sysv*) HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o' ;; -i[3456]86-*-solaris*) +i[3-7]86-*-solaris*) HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`' - NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' ;; -i[3456]86-*-sco* | i[3456]86-*-isc*) +i[3-7]86-*-sco* | i[3-7]86-*-isc*) # In some configurations gcc does not use crtbegin.o and crtend.o. # In that case gcc -print-file-name=crtbegin.o will simply print # crtbegin.o. We create dummy crtbegin.o and crtend.o files to @@ -112,19 +132,18 @@ i[3456]86-*-sco* | i[3456]86-*-isc*) HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o' ;; -i[3456]86-*-lynxos*) +i[3-7]86-*-lynxos*) HOSTING_CRT0=/lib/init1.o HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o' ;; -i[3456]86-pc-interix*) +i[3-7]86-pc-interix*) HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o' - NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib' HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a' ;; -i[3456]86-*-cygwin*) - HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' +i[3-7]86-*-cygwin*) + HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' ;; ia64-*-linux-gnu*) @@ -134,11 +153,6 @@ ia64-*-linux-gnu*) ia64-*-aix*) HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.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='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' - NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib' - ;; - -mips*-dec-bsd*) - HOSTING_CRT0=/usr/lib/crt0.o ;; mips*-sgi-irix4* | mips*-sgi-irix5*) @@ -184,6 +198,10 @@ m88*-motorola-sysv3) HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' ;; +powerpc64*-*-linux-gnu*) + HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld64.so.1,"` + ;; + powerpc*-*-linux-gnu*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` ;; @@ -199,7 +217,6 @@ s390-*-linux-gnu*) sparc*-*-solaris2*) HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`' - NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' ;; sparc-*-linux-gnu*) @@ -214,21 +231,17 @@ x86_64-*-linux-gnu*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"` ;; -*-*-freebsd*) +*-*-freebsd* | *-*-kfreebsd*-gnu) ;; *-*-linux*) ;; *-*-netbsd*) - # NetBSD typically does not use the GCC crtstuff, so ignore it. - HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o' - 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` /usr/lib/crtend.o' ;; alpha*-*-*) HOSTING_CRT0=/usr/ccs/lib/crt0.o - NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' ;; esac |