ctf test ERROR: $target-cc does not exist
authorAlan Modra <amodra@gmail.com>
Mon, 27 Jul 2020 03:50:10 +0000 (13:20 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 27 Jul 2020 13:01:37 +0000 (22:31 +0930)
* testsuite/lib/ld-lib.exp (check_ctf_available): Check first that
target compiler is available.

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

index 467c2bc5673b42ecf6ca5e7d43c964c736a9b571..ef8f64869e8a9e9861cfdbca9085434cd94ab53f 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-27  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/lib/ld-lib.exp (check_ctf_available): Check first that
+       target compiler is available.
+
 2020-07-23  Maciej W. Rozycki  <macro@wdc.com>
 
        PR ld/26288
index d1ffab7dc46c904c70c09f2945c83931614df16e..1ec9bec5a4c3937b79aae1d64a396bb799c4b1b2 100644 (file)
@@ -1594,16 +1594,20 @@ proc check_ctf_available { } {
     global ctf_available_saved
 
     if {![info exists ctf_available_saved]} {
-       set basename "tmpdir/ctf_available[pid]"
-       set src ${basename}.c
-       set output ${basename}.o
-       set f [open $src "w"]
-       puts $f "int main() { return 0; }"
-       close $f
-       set ctf_available_saved [compile_one_cc $src $output "-gt -c"]
-       remote_file host delete $src
-       remote_file host delete $output
-       file delete $src
+       if { ![check_compiler_available] } {
+           set ctf_available_saved 0
+       } else {
+           set basename "tmpdir/ctf_available[pid]"
+           set src ${basename}.c
+           set output ${basename}.o
+           set f [open $src "w"]
+           puts $f "int main() { return 0; }"
+           close $f
+           set ctf_available_saved [compile_one_cc $src $output "-gt -c"]
+           remote_file host delete $src
+           remote_file host delete $output
+           file delete $src
+       }
     }
     return $ctf_available_saved
 }