diff options
author | Alan Modra <amodra@gmail.com> | 2018-05-28 16:30:23 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-05-28 21:43:44 +0930 |
commit | bb3b5316332875b436b4a88d1ec6968eba46a870 (patch) | |
tree | dc3bae161cebb5c66c84ac1308fb9613e9ecd873 | |
parent | 46207bf3b5b9880804ee4b527cc22b314eb5daba (diff) | |
download | binutils-bb3b5316332875b436b4a88d1ec6968eba46a870.zip binutils-bb3b5316332875b436b4a88d1ec6968eba46a870.tar.gz binutils-bb3b5316332875b436b4a88d1ec6968eba46a870.tar.bz2 |
PR23235, make check uses system installed ld
This patch doesn't stop the build-id and debuglink tests using the
installed ld, it just prevents a compiler failure from resulting in a
test fail. We could move the tests to the ld testsuite but it doesn't
seem all that important.
PR 23235
* testsuite/binutils-all/compress.exp (test_gnu_debuglink): Return
unsupported rather than fail on compile errors.
* testsuite/binutils-all/objdump.exp (test_build_id_debuglink):
Likewise. Save and restore CFLAGS_FOR_TARGET.
-rw-r--r-- | binutils/ChangeLog | 8 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/compress.exp | 2 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/objdump.exp | 11 |
3 files changed, 18 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2943b1d..185dffd 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,11 @@ +2018-05-28 Alan Modra <amodra@gmail.com> + + PR 23235 + * testsuite/binutils-all/compress.exp (test_gnu_debuglink): Return + unsupported rather than fail on compile errors. + * testsuite/binutils-all/objdump.exp (test_build_id_debuglink): + Likewise. Save and restore CFLAGS_FOR_TARGET. + 2018-05-18 Kito Cheng <kito.cheng@gmail.com> * readelf.c (get_machine_flags): Handle EF_RISCV_RVE. diff --git a/binutils/testsuite/binutils-all/compress.exp b/binutils/testsuite/binutils-all/compress.exp index 12a43b0..edbe9dd 100644 --- a/binutils/testsuite/binutils-all/compress.exp +++ b/binutils/testsuite/binutils-all/compress.exp @@ -692,7 +692,7 @@ proc test_gnu_debuglink {} { } if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog exectuable debug] != "" } { - fail "$test (build)" + unsupported "$test (build)" return } set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.dump"] diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp index b9232e9..d9d0713 100644 --- a/binutils/testsuite/binutils-all/objdump.exp +++ b/binutils/testsuite/binutils-all/objdump.exp @@ -363,14 +363,21 @@ proc test_build_id_debuglink {} { } # Use a fixed build-id. + if { [info exists CFLAGS_FOR_TARGET] } { + set save_CFLAGS_FOR_TARGET $CFLAGS_FOR_TARGET + } set CFLAGS_FOR_TARGET "-g -Wl,--build-id=0x12345678abcdef01" if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog exectuable debug] != "" } { - fail "$test (build)" + unsupported "$test (build)" return } - # FIXME: Do we need to restore CFLAGS_FOR_TARGET to its old value ? + if { [info exists save_CFLAGS_FOR_TARGET] } { + set CFLAGS_FOR_TARGET $save_CFLAGS_FOR_TARGET + } else { + unset CFLAGS_FOR_TARGET + } if { [binutils_run $STRIP "--strip-debug --remove-section=.comment tmpdir/testprog -o tmpdir/testprog.strip"] != "" } { fail "$test (strip debug info)" |