133965Sjdp# This is the linker host specific file. This is invoked by the 233965Sjdp# autoconf generated configure script. Putting it in a separate shell 333965Sjdp# file lets us skip running autoconf when modifying host specific 433965Sjdp# information. 533965Sjdp 633965Sjdp# This file sets the following shell variables: 733965Sjdp# HDEFINES host specific compiler flags 833965Sjdp# HOSTING_CRT0 crt0.o file used for bootstrapping 933965Sjdp# HOSTING_LIBS libraries used for bootstrapping 1033965Sjdp 1133965SjdpHDEFINES= 1233965SjdpHOSTING_CRT0=/lib/crt0.o 13218822SdimHOSTING_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; if [ -f ../gcc/libunwind.a ]; then libgcc="$libgcc ../gcc/libunwind.a"; else libunwind=\`${CC} -print-file-name=libunwind.a\`; if [ x"$libunwind" != xlibunwind.a ]; then libgcc="$libgcc $libunwind"; fi; fi; echo --start-group $libgcc -lc --end-group`' 1433965Sjdp 1594548Sobrien# 1694548Sobrien# Generic configurations: 1794548Sobrien# 1894548Sobrien 1933965Sjdpcase "${host}" in 2033965Sjdp 21130570Sobrien*-*-freebsd* | *-*-kfreebsd*-gnu) 22130570Sobrien 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`' 2394548Sobrien 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`' 2494548Sobrien ;; 2594548Sobrien 2694548Sobrien*-*-linux*aout* | *-*-linux*oldld) 2794548Sobrien HOSTING_CRT0=/usr/lib/crt0.o 2894548Sobrien ;; 2994548Sobrien 3094548Sobrien*-*-linux*libc1*) 3194548Sobrien HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`' 3294548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o' 3394548Sobrien ;; 3494548Sobrien 3594548Sobrien*-*-linux*) 36218822Sdim HOSTING_CRT0='-dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.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`' 3794548Sobrien 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`' 3894548Sobrien ;; 3994548Sobrien 40130570Sobrien*-*-netbsd*) 41130570Sobrien # Different versions of NetBSD with the ELF object format use different 42130570Sobrien # sets of start/end files. 43130570Sobrien HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o' 44130570Sobrien if [ -f `${CC} --print-file-name=crti.o` ]; then 45130570Sobrien # Support for GCC's crtstuff present. 46130570Sobrien HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crti.o`" 47130570Sobrien if [ -f ../gcc/crtbegin.o ]; then 48130570Sobrien HOSTING_CRT0="$HOSTING_CRT0 ../gcc/crtbegin.o" 49130570Sobrien else 50130570Sobrien HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`" 51130570Sobrien fi 52130570Sobrien else 53130570Sobrien # Support for GCC's crtstuff not present. 54130570Sobrien HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`" 55130570Sobrien fi 56130570Sobrien if [ -f `${CC} --print-file-name=crtn.o` ]; then 57130570Sobrien # Support for GCC's crtstuff present. 58130570Sobrien if [ -f ../gcc/crtbegin.o ]; then 59130570Sobrien HOSTING_LIBS="$HOSTING_LIBS ../gcc/crtend.o" 60130570Sobrien else 61130570Sobrien HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`" 62130570Sobrien fi 63130570Sobrien HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtn.o`" 64130570Sobrien else 65130570Sobrien # Support for GCC's crtstuff not present. 66130570Sobrien HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`" 67130570Sobrien fi 68130570Sobrien ;; 69130570Sobrien 70218822Sdim*-*-openbsd*) 71218822Sdim HOSTING_CRT0="-dynamic-linker /usr/libexec/ld.so /usr/lib/crt0.o" 72218822Sdim HOSTING_CRT0="$HOSTING_CRT0 /usr/lib/crtbegin.o" 73218822Sdim HOSTING_LIBS="$HOSTING_LIBS /usr/lib/crtend.o" 74218822Sdim ;; 75218822Sdim 7694548Sobrienesac 7794548Sobrien 7894548Sobrien# 7994548Sobrien# Now more specific configurations 8094548Sobrien# 8194548Sobrien 8294548Sobriencase "${host}" in 8394548Sobrien 8494548Sobrien*-*-linux*aout* | *-*-linux*oldld | *-*-linux*libc1*) 8594548Sobrien # No further tweaking needed 8694548Sobrien ;; 8794548Sobrien 88130570Sobrienam33_2.0-*-linux*) 89130570Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` 9033965Sjdp ;; 9133965Sjdp 92218822Sdimarm*-*-linux-*) 93130570Sobrien HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` 9460484Sobrien ;; 9560484Sobrien 96104844Sobrienhppa*64*-*-hpux11*) 97104844Sobrien HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o 98104844Sobrien # Even if CC is not gcc, the tests use gcc. 99130570Sobrien 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' 100104844Sobrien ;; 101104844Sobrien 102130570Sobrieni[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*) 10360524Sobrien HOSTING_CRT0=/usr/lib/crt0.o 10460484Sobrien ;; 10560484Sobrien 106130570Sobrieni[3-7]86-*-sysv4*) 10760484Sobrien 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`' 10894548Sobrien 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' 10933965Sjdp ;; 11033965Sjdp 111130570Sobrieni[3-7]86-sequent-ptx* | i[3-7]86-sequent-sysv*) 11260484Sobrien HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 11394548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' 11433965Sjdp ;; 11533965Sjdp 116130570Sobrieni[3-7]86-*-sysv*) 11733965Sjdp HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`' 11894548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o' 11933965Sjdp ;; 12033965Sjdp 121130570Sobrieni[3-7]86-*-solaris*) 12260484Sobrien 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`' 12394548Sobrien 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`' 12433965Sjdp ;; 12533965Sjdp 126130570Sobrieni[3-7]86-*-sco* | i[3-7]86-*-isc*) 12733965Sjdp # In some configurations gcc does not use crtbegin.o and crtend.o. 12833965Sjdp # In that case gcc -print-file-name=crtbegin.o will simply print 12933965Sjdp # crtbegin.o. We create dummy crtbegin.o and crtend.o files to 13033965Sjdp # handle this. 13133965Sjdp echo "int dummy_crtbegin () { return 0; }" > crtbegin.c 13233965Sjdp ${CC} -c crtbegin.c -o crtbegin.o 13333965Sjdp rm -f crtbegin.c 13433965Sjdp echo "int dummy_crteng () { return 0; }" > crtend.c 13533965Sjdp ${CC} -c crtend.c -o crtend.o 13633965Sjdp rm -f crtend.c 13760484Sobrien HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 13894548Sobrien 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' 13933965Sjdp ;; 14033965Sjdp 141130570Sobrieni[3-7]86-pc-interix*) 14260484Sobrien HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o' 14394548Sobrien 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' 14460484Sobrien ;; 14560484Sobrien 146130570Sobrieni[3-7]86-*-cygwin*) 147130570Sobrien 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`' 14877317Sobrien ;; 14977317Sobrien 150218822Sdimi[3-7]86-*-mingw*) 151218822Sdim #We only support msvcrt.dll, crtid == 2. 152218822Sdim HOSTING_CRT0='/mingw/lib/crt2.o' 153218822Sdim HOSTING_LIBS='-L/mingw/lib -lmingw32 -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lmoldname -lmingwex -lmsvcrt `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' 154218822Sdim ;; 155218822Sdim 156218822Sdimia64-*-linux-*) 15794548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"` 15877317Sobrien ;; 15977317Sobrien 16094548Sobrienmips*-sgi-irix4* | mips*-sgi-irix5*) 16133965Sjdp HOSTING_CRT0=/usr/lib/crt1.o 16294548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o' 16333965Sjdp ;; 16433965Sjdp 16560484Sobrienmips*-sgi-irix6*) 16660484Sobrien HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else ${CC} -print-file-name=crtbegin.o; fi`' 16794548Sobrien HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors' 16860484Sobrien ;; 16960484Sobrien 170218822Sdimmips*-*-linux-*) 171218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` 17260484Sobrien ;; 17360484Sobrien 174218822Sdimm68*-*-linux-*) 175218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` 17638889Sjdp ;; 17738889Sjdp 17833965Sjdpm68*-motorola-sysv) 17960484Sobrien HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`${CC} -print-file-name=\`crt0.o ]; then echo \`${CC} -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`' 18094548Sobrien HOSTING_LIBS=`echo "$HOSTING_LIBS" | sed -e "s,-lc,-lc881,"` 18133965Sjdp ;; 18233965Sjdp 18333965Sjdpm68*-sun-*) 18433965Sjdp HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o' 18533965Sjdp ;; 18633965Sjdp 18733965Sjdpm88*-*-dgux*) 18833965Sjdp HDEFINES=-D__using_DGUX 18933965Sjdp HOSTING_CRT0='/lib/crt0.o -X' 19033965Sjdp HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a 19133965Sjdp ;; 19233965Sjdp 19333965Sjdpm88*-motorola-sysv3) 19460484Sobrien HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 19594548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' 19633965Sjdp ;; 19733965Sjdp 198218822Sdimpowerpc64*-*-linux-*) 199218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld64.so.1,"` 200130570Sobrien ;; 201130570Sobrien 202218822Sdimpowerpc*-*-linux-*) 203218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` 20460484Sobrien ;; 20560484Sobrien 206218822Sdims390x-*-linux-*) 207218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld64.so.1,"` 20889870Sobrien ;; 20989870Sobrien 210218822Sdims390-*-linux-*) 211218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` 21289870Sobrien ;; 21389870Sobrien 214218822Sdimsparc-*-solaris2*) 21560484Sobrien 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`' 21694548Sobrien 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`' 21733965Sjdp ;; 21833965Sjdp 219218822Sdimsparc64-*-solaris2* | sparcv9-*-solaris2*) 220218822Sdim 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/sparcv9/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 221218822Sdim 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`' 22260484Sobrien ;; 22360484Sobrien 224218822Sdimsparc-*-linux-*) 225218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld-linux.so.2,"` 22660484Sobrien ;; 22760484Sobrien 228218822Sdimsparc64-*-linux-*) 229218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux.so.2,"` 23089870Sobrien ;; 23189870Sobrien 232218822Sdimx86_64-*-linux-*) 233218822Sdim HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"` 234218822Sdim ;; 235218822Sdim 236130570Sobrien*-*-freebsd* | *-*-kfreebsd*-gnu) 23777317Sobrien ;; 23877317Sobrien 23989870Sobrien*-*-linux*) 24089870Sobrien ;; 24189870Sobrien 24299470Sobrien*-*-netbsd*) 24399470Sobrien ;; 24499470Sobrien 245218822Sdim*-*-openbsd*) 246218822Sdim ;; 247218822Sdim 24877317Sobrienalpha*-*-*) 24977317Sobrien HOSTING_CRT0=/usr/ccs/lib/crt0.o 25077317Sobrien ;; 25177317Sobrien 25233965Sjdpesac 253