From: H.J. Lu Date: Fri, 23 Oct 2020 18:24:58 +0000 (-0700) Subject: ld: Set plug_opt only if compiler is available X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72d813f35ed45070ac2ab732dc396ab44daa54d1;p=binutils-gdb.git ld: Set plug_opt only if compiler is available * testsuite/config/default.exp (plug_opt): Set only if compiler is available. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 540ebae7930..2392dc8eaab 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2020-10-23 H.J. Lu + + * testsuite/config/default.exp (plug_opt): Set only if compiler + is available. + 2020-10-22 H.J. Lu * testsuite/ld-plugin/lto.exp (plug_opt): Moved to ... diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 73d61dec272..f711fb792e3 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -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 + } } }