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`'
;;
+*-*-gnu*)
+ # When creating static executables, we ought to use crt0.o instead of crt1.o,
+ # <http://www.gnu.org/software/hurd/open_issues/binutils/testsuite.html#static>,
+ # but the testing infrastructure is not prepared for that. This is not
+ # relevant for most tests, and the few remaining ones have been XFAILed.
+ 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`'
+ 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.
*-*-freebsd* | *-*-kfreebsd*-gnu | *-*-dragonfly*)
;;
-*-*-linux*)
+*-*-linux* | *-*-gnu*)
;;
*-*-netbsd*)