This patch prevents a linker testsuite error if the checks are run with a
authorNick Clifton <nickc@redhat.com>
Mon, 7 Jul 2014 13:41:10 +0000 (14:41 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 7 Jul 2014 13:41:10 +0000 (14:41 +0100)
toolchain that just contains the binutils - ie without a compiler.

* lib/ld-lib.exp (check_lto_available): Check that a compiler is
available before testing for LTO support.

ld/testsuite/ChangeLog
ld/testsuite/lib/ld-lib.exp

index 8877311b1766555a15d827ec88f5b1be10ac61e4..6ab009b036cdd1e3588a5a96999e94f95a9b0da4 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-07  Nick Clifton  <nickc@redhat.com>
+
+       * lib/ld-lib.exp (check_lto_available): Check that a compiler is
+       available before testing for LTO support.
+
 2014-07-07  Alan Modra  <amodra@gmail.com>
 
        * config/default.exp: Don't make tmpdir/gas.  Put as symlink into
index a657a975ebc10f8c2e5ee32422479212e4fa0aa4..9f7a414cc99f4bbb352bff7888b4990f32e5c22f 100644 (file)
@@ -1666,6 +1666,10 @@ proc check_lto_available { } {
     global CC
 
     if {![info exists lto_available_saved]} {
+        if { [which $CC] == 0 } {
+           set lto_available_saved 0
+           return 0
+       }
        # Check if gcc supports -flto -fuse-linker-plugin
        set flags ""
        if [board_info [target_info name] exists cflags] {