Skip to content

Commit 0e46a09

Browse files
committed
i386: Pass -Wl,--no-as-needed to compiler as needed
Pass -Wl,--no-as-needed to linker tests to fix FAIL: Run pr19031 FAIL: Run got1 FAIL: Undefined weak symbol (-fPIE -no-pie) FAIL: Undefined weak symbol (-fPIE -pie) when --as-needed is passed to linker by compiler. PR ld/30050 * testsuite/ld-i386/i386.exp: Pass -Wl,--no-as-needed to compiler as needed.
1 parent d8f5b7d commit 0e46a09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ld/testsuite/ld-i386/i386.exp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ proc undefined_weak {cflags ldflags} {
577577
run_ld_link_exec_tests [list \
578578
[list \
579579
"Run pr19704" \
580-
"$ldflags tmpdir/libpr19704.so -Wl,-R,tmpdir" \
580+
"$ldflags -Wl,--no-as-needed tmpdir/libpr19704.so \
581+
-Wl,-R,tmpdir" \
581582
"-Wa,-mrelax-relocations=yes" \
582583
{ pr19704a.c } \
583584
"pr19704" \
@@ -1078,7 +1079,7 @@ if { [isnative]
10781079
] \
10791080
[list \
10801081
"Run pr19031" \
1081-
"$NOPIE_LDFLAGS tmpdir/pr19031.so" \
1082+
"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \
10821083
"-Wa,-mx86-used-note=yes" \
10831084
{ pr19031b.S pr19031c.c } \
10841085
"pr19031" \
@@ -1087,7 +1088,7 @@ if { [isnative]
10871088
] \
10881089
[list \
10891090
"Run got1" \
1090-
"$NOPIE_LDFLAGS tmpdir/got1d.so" \
1091+
"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/got1d.so" \
10911092
"-Wa,-mx86-used-note=yes" \
10921093
{ got1a.S got1b.c got1c.c } \
10931094
"got1" \

0 commit comments

Comments
 (0)