]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld/testsuite: Use $plug_opt for --plugin option
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 14 May 2025 08:43:22 +0000 (16:43 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 14 May 2025 10:00:41 +0000 (18:00 +0800)
Use $plug_opt for --plugin usage, instead of running:

run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"

PR binutils/21479
* testsuite/ld-plugin/lto-binutils.exp (lto_plugin): Removed.
Replace "--plugin $lto_plugin" with $plug_opt.
* testsuite/ld-plugin/lto.exp (lto_plugin): Removed.
Replace "--plugin $lto_plugin" with $plug_opt.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
ld/testsuite/ld-plugin/lto-binutils.exp
ld/testsuite/ld-plugin/lto.exp

index db18a63a7b55b0ee663aecb554f9442a0a1cd21e..36c7380c9b36baea93ff644b4304a58f233e571b 100644 (file)
@@ -47,8 +47,6 @@ if { [check_lto_fat_available] } {
   set no_lto "-fno-lto"
 }
 
-set lto_plugin [string trim [run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"]]
-
 # List contains test-items:
 #  0:program name
 #  1:program options
@@ -64,7 +62,7 @@ proc run_lto_binutils_test { lto_tests } {
     global objdump
     global READELF
     global strip
-    global lto_plugin
+    global plug_opt
 
     foreach testitem $lto_tests {
        set prog_name [lindex $testitem 0]
@@ -101,7 +99,7 @@ proc run_lto_binutils_test { lto_tests } {
            remote_file host delete $output
        }
 
-       append prog_options " --plugin $lto_plugin"
+       append prog_options " $plug_opt"
 
        set cmd_options "$prog_options $prog_output $input"
        set test_name "$prog_name $cmd_options"
@@ -192,7 +190,7 @@ run_cc_link_tests [list \
     ] \
     [list \
        "Build libstrip-1a.a" \
-       "--plugin $lto_plugin" \
+       "$plug_opt" \
        "-O2 -flto $lto_no_fat" \
        { strip-1a.c } \
        {} \
@@ -206,7 +204,7 @@ run_cc_link_tests [list \
     ] \
     [list \
        "Build libstrip-1a-fat.a" \
-       "--plugin $lto_plugin" \
+       "$plug_opt" \
        "-O2 -flto $lto_fat" \
        { strip-1a-fat.c } \
        {} \
index 3a56fb57545678a86fb15bc395418976381ec20f..f0d0954ab09a8f93c37afb39a333e02b96f777c9 100644 (file)
@@ -1158,9 +1158,8 @@ remote_exec host "mv" "tmpdir/dump tmpdir/lto-5.o"
 run_dump_test "lto-10r"
 remote_exec host "mv" "tmpdir/dump tmpdir/lto-10.o"
 set testname "nm mixed object"
-set lto_plugin [string trim [run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"]]
-if { [ regexp "liblto_plugin.so" $lto_plugin ] } {
-    set exec_output [run_host_cmd "$NM" "--plugin $lto_plugin tmpdir/lto-10.o"]
+if { $plug_opt != "" } {
+    set exec_output [run_host_cmd "$NM" "$plug_opt tmpdir/lto-10.o"]
     if { [ regexp "(D|T) main" $exec_output ] } {
        pass $testname
     } else {