For arm-none-linux-gnueabi ld/configure.host (from CVS HEAD as of 23 March 2010) executes the following sequence of commands to set HOSTING_CRT0 to the correct value:
HOSTING_CRT0='-p -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_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` When executed in bash HOSTING_CRT0 is now equal to: -p -dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld-linux\.so" | 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` But with dash it is equal to: -p -dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld-linux\.so" | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux\.so..\).*,^A,"` `${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` (Where ^A is the character with value 1). This then causes many ld tests to fail if /bin/sh is linked to dash instead of bash (as is the case for Ubuntu). My reading of POSIX says that the output of: echo "\1" is implementation defined and so dash's behaviour is acceptable, (as is in this case bash's). I believe this issue also affects other targets including x86_64 and mips. A workaround for these issues is to make the first "exec sh ..." in get_link_files in ld/testsuite/config/default.exp be "exec bash ..." instead. ld tests that fail if sh is dash instead of bash are: Running /home/mgretton/binutils/src/ld/testsuite/ld-bootstrap/bootstrap.exp ... FAIL: bootstrap FAIL: bootstrap with strip FAIL: bootstrap with --traditional-format FAIL: bootstrap with --no-keep-memory FAIL: bootstrap with --relax Running /home/mgretton/binutils/src/ld/testsuite/ld-cdtest/cdtest.exp ... FAIL: cdtest FAIL: cdtest with -Ur Running /home/mgretton/binutils/src/ld/testsuite/ld-elf/dwarf.exp ... FAIL: Run with libdwarf1.so first FAIL: Run with libdwarf1.so last Running /home/mgretton/binutils/src/ld/testsuite/ld-elf/elf.exp ... FAIL: preinit array FAIL: init array FAIL: fini array Running /home/mgretton/binutils/src/ld/testsuite/ld-elf/shared.exp ... FAIL: Run normal with libfoo.so FAIL: Run protected with libfoo.so FAIL: Run hidden with libfoo.so FAIL: Run normal with versioned libfoo.so FAIL: Run warn with versioned libfoo.so FAIL: Run protected with versioned libfoo.so FAIL: Run hidden with versioned libfoo.so FAIL: Run normal libbar.so with libfoo.so FAIL: Run protected libbar.so with libfoo.so FAIL: Run hidden libbar.so with libfoo.so FAIL: Run normal libbar.so with versioned libfoo.so FAIL: Run protected libbar.so with versioned libfoo.so FAIL: Run hidden libbar.so with versioned libfoo.so FAIL: Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so FAIL: Run dl1b with --dynamic-list-data and dlopen on libdl1.so FAIL: Run with libdl2a.so FAIL: Run with libdl2b.so FAIL: Run with libdl2c.so FAIL: Run with libdl4a.so FAIL: Run with libdl4b.so FAIL: Run with libdl4c.so FAIL: Run with libdl4d.so FAIL: Run with libdl4e.so FAIL: Run with libdl4f.so FAIL: Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so FAIL: Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so FAIL: Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so FAIL: Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so FAIL: Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so FAIL: Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so FAIL: Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so FAIL: Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so FAIL: Run dl6b2 with dlopen on libdl6b.so FAIL: Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so FAIL: Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so FAIL: Run with libdata1.so FAIL: Run with libfunc1.so comm1.o FAIL: Run with comm1.o libfunc1.so FAIL: Run with pr11138-2.c libpr11138-1.so FAIL: Run with libpr11138-1.so pr11138-2.c -- Summary: ld/configure.host does not behave as expected if /bin/sh is dash and not bash Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: mgretton at sourceware dot org CC: bug-binutils at gnu dot org GCC host triplet: arm-none-linux-gnueabi GCC target triplet: arm-none-linux-gnueabi http://sourceware.org/bugzilla/show_bug.cgi?id=11426 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils