]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: Set plug_opt only if compiler is available
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 23 Oct 2020 18:24:58 +0000 (11:24 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 23 Oct 2020 18:25:15 +0000 (11:25 -0700)
* testsuite/config/default.exp (plug_opt): Set only if compiler
is available.

ld/ChangeLog
ld/testsuite/config/default.exp

index 540ebae7930816ca7ebb4fa3a899445dc0362513..2392dc8eaabe5314cf1242e670f076df9d57bc52 100644 (file)
@@ -1,3 +1,8 @@
+2020-10-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * testsuite/config/default.exp (plug_opt): Set only if compiler
+       is available.
+
 2020-10-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        * testsuite/ld-plugin/lto.exp (plug_opt): Moved to ...
index 73d61dec27207549cf0ce0115dc833ac624c2844..f711fb792e3c848e2b7152968913381c56a3e9a6 100644 (file)
@@ -425,19 +425,21 @@ if { [istarget alpha*-*-*vms*] } {
     unset f src
 }
 
-set plugin_names {
-    liblto_plugin.so
-    liblto_plugin-0.dll
-    cyglto_plugin-0.dll
-}
 set plug_opt ""
-foreach plug $plugin_names {
-    set plug_so [run_host_cmd $CC "--print-prog-name $plug"]
-    if { $plug_so eq $plug } then {
-       set plug_so [run_host_cmd $CC "--print-file-name $plug"]
+if { [check_compiler_available] } {
+    set plugin_names {
+       liblto_plugin.so
+       liblto_plugin-0.dll
+       cyglto_plugin-0.dll
     }
-    if { $plug_so ne $plug } then {
-       set plug_opt "--plugin $plug_so"
-       break
+    foreach plug $plugin_names {
+       set plug_so [run_host_cmd $CC "--print-prog-name $plug"]
+       if { $plug_so eq $plug } then {
+           set plug_so [run_host_cmd $CC "--print-file-name $plug"]
+       }
+       if { $plug_so ne $plug } then {
+           set plug_opt "--plugin $plug_so"
+           break
+       }
     }
 }