Skip to content

Commit 23e60b0

Browse files
committed
ld/testsuite: Use $plug_opt for --plugin option
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 <[email protected]>
1 parent c5a0d25 commit 23e60b0

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

ld/testsuite/ld-plugin/lto-binutils.exp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ if { [check_lto_fat_available] } {
4747
set no_lto "-fno-lto"
4848
}
4949

50-
set lto_plugin [string trim [run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"]]
51-
5250
# List contains test-items:
5351
# 0:program name
5452
# 1:program options
@@ -64,7 +62,7 @@ proc run_lto_binutils_test { lto_tests } {
6462
global objdump
6563
global READELF
6664
global strip
67-
global lto_plugin
65+
global plug_opt
6866

6967
foreach testitem $lto_tests {
7068
set prog_name [lindex $testitem 0]
@@ -101,7 +99,7 @@ proc run_lto_binutils_test { lto_tests } {
10199
remote_file host delete $output
102100
}
103101

104-
append prog_options " --plugin $lto_plugin"
102+
append prog_options " $plug_opt"
105103

106104
set cmd_options "$prog_options $prog_output $input"
107105
set test_name "$prog_name $cmd_options"
@@ -192,7 +190,7 @@ run_cc_link_tests [list \
192190
] \
193191
[list \
194192
"Build libstrip-1a.a" \
195-
"--plugin $lto_plugin" \
193+
"$plug_opt" \
196194
"-O2 -flto $lto_no_fat" \
197195
{ strip-1a.c } \
198196
{} \
@@ -206,7 +204,7 @@ run_cc_link_tests [list \
206204
] \
207205
[list \
208206
"Build libstrip-1a-fat.a" \
209-
"--plugin $lto_plugin" \
207+
"$plug_opt" \
210208
"-O2 -flto $lto_fat" \
211209
{ strip-1a-fat.c } \
212210
{} \

ld/testsuite/ld-plugin/lto.exp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,9 +1158,8 @@ remote_exec host "mv" "tmpdir/dump tmpdir/lto-5.o"
11581158
run_dump_test "lto-10r"
11591159
remote_exec host "mv" "tmpdir/dump tmpdir/lto-10.o"
11601160
set testname "nm mixed object"
1161-
set lto_plugin [string trim [run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"]]
1162-
if { [ regexp "liblto_plugin.so" $lto_plugin ] } {
1163-
set exec_output [run_host_cmd "$NM" "--plugin $lto_plugin tmpdir/lto-10.o"]
1161+
if { $plug_opt != "" } {
1162+
set exec_output [run_host_cmd "$NM" "$plug_opt tmpdir/lto-10.o"]
11641163
if { [ regexp "(D|T) main" $exec_output ] } {
11651164
pass $testname
11661165
} else {

0 commit comments

Comments
 (0)