ld: Add $NOSANTIZE_CFLAGS to more linker tests

-fsanitize= can be used to build binutils with

$ CC="gcc -fsanitize=address,undefined" CXX="g++ -fsanitize=address,undefined" .../configure --disable-werror

Since not all linker tests are compatible with -fsanitize=, pass
$NOSANTIZE_CFLAGS to disable -fsanitize= for such tests.

	* testsuite/ld-elf/indirect.exp: Append $NOSANTIZE_CFLAGS to CC.
	* testsuite/ld-elf/shared.exp: Likewise.
	* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-plugin/lto.exp: Likewise.
	* testsuite/ld-plugin/plugin.exp: Likewise.
	* testsuite/ld-scripts/crossref.exp: Likewise.
This commit is contained in:
H.J. Lu
2020-08-26 11:28:26 -07:00
parent 8c51f2f291
commit 05fd99cc80
10 changed files with 141 additions and 57 deletions

View File

@ -1,3 +1,15 @@
2020-08-26 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/indirect.exp: Append $NOSANTIZE_CFLAGS to CC.
* testsuite/ld-elf/shared.exp: Likewise.
* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
* testsuite/ld-elfvers/vers.exp: Likewise.
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Likewise.
* testsuite/ld-plugin/plugin.exp: Likewise.
* testsuite/ld-scripts/crossref.exp: Likewise.
2020-08-26 Alan Modra <amodra@gmail.com> 2020-08-26 Alan Modra <amodra@gmail.com>
PR 26499 PR 26499

View File

@ -64,6 +64,9 @@ if {[check_lto_available]} {
append cc_cmd " -fno-lto" append cc_cmd " -fno-lto"
} }
# Disable all sanitizers.
append cc_cmd " $NOSANTIZE_CFLAGS"
if { ![ld_compile $cc_cmd $srcdir/$subdir/indirect1a.c tmpdir/indirect1a.o] if { ![ld_compile $cc_cmd $srcdir/$subdir/indirect1a.c tmpdir/indirect1a.o]
|| ![ld_compile $cc_cmd $srcdir/$subdir/indirect1b.c tmpdir/indirect1b.o] || ![ld_compile $cc_cmd $srcdir/$subdir/indirect1b.c tmpdir/indirect1b.o]
|| ![ld_compile "$cc_cmd -fPIC" $srcdir/$subdir/indirect2.c tmpdir/indirect2.o] || ![ld_compile "$cc_cmd -fPIC" $srcdir/$subdir/indirect2.c tmpdir/indirect2.o]

View File

@ -749,15 +749,6 @@ set build_tests {
{"Build needed3" {"Build needed3"
"tmpdir/needed3.o -Wl,--as-needed -Ltmpdir -lneeded3a -lneeded3b -lneeded1b" "" "tmpdir/needed3.o -Wl,--as-needed -Ltmpdir -lneeded3a -lneeded3b -lneeded1b" ""
{dummy.c} {} "needed3"} {dummy.c} {} "needed3"}
{"Build libpr2404a.so"
"-shared" "-fPIC"
{pr2404a.c} {} "libpr2404a.so"}
{"Build libpr2404n.so"
"-shared -Wl,-z,now" "-fPIC"
{pr2404a.c} {} "libpr2404n.so"}
{"Build libpr2404b.a"
"" ""
{pr2404b.c} {} "libpr2404b.a"}
{"Build rdynamic-1" {"Build rdynamic-1"
"-Wl,--no-dynamic-linker,-export-dynamic,--gc-sections" "-ffunction-sections" "-Wl,--no-dynamic-linker,-export-dynamic,--gc-sections" "-ffunction-sections"
{rdynamic-1.c} {{readelf {-s} rdynamic-1.rd}} "rdynamic-1"} {rdynamic-1.c} {{readelf {-s} rdynamic-1.rd}} "rdynamic-1"}
@ -792,6 +783,34 @@ set build_tests {
"-shared -Wl,-z,now tmpdir/libpr18458a.so" "-fPIC" "-shared -Wl,-z,now tmpdir/libpr18458a.so" "-fPIC"
{pr18458b.c} {} "libpr18458b.so"} {pr18458b.c} {} "libpr18458b.so"}
} }
run_cc_link_tests [list \
[list \
"Build libpr2404a.so" \
"-shared $NOSANTIZE_CFLAGS" \
"-fPIC $NOSANTIZE_CFLAGS" \
{pr2404a.c} \
{} \
"libpr2404a.so" \
] \
[list \
"Build libpr2404n.so" \
"-shared -Wl,-z,now $NOSANTIZE_CFLAGS" \
"-fPIC $NOSANTIZE_CFLAGS" \
{pr2404a.c} \
{} \
"libpr2404n.so" \
] \
[list \
"Build libpr2404b.a" \
"" \
"$NOSANTIZE_CFLAGS" \
{pr2404b.c} \
{} \
"libpr2404b.a" \
] \
]
# pr19073.s uses .set, which has a different meaning on alpha. # pr19073.s uses .set, which has a different meaning on alpha.
if { ![istarget alpha-*-*] } { if { ![istarget alpha-*-*] } {
append build_tests { append build_tests {
@ -873,7 +892,7 @@ run_ld_link_tests [list \
{ pr22269-1.c } \ { pr22269-1.c } \
{{readelf -rW pr22269-1.rd}} \ {{readelf -rW pr22269-1.rd}} \
"pr22269-1" \ "pr22269-1" \
"-fPIE -O2" \ "-fPIE -O2 $NOSANTIZE_CFLAGS" \
] \ ] \
] ]
@ -1006,11 +1025,16 @@ set run_tests [list \
"-Wl,--no-as-needed,-rpath=tmpdir -Ltmpdir -lrel" "" \ "-Wl,--no-as-needed,-rpath=tmpdir -Ltmpdir -lrel" "" \
{relmain.c} "relmain" "relmain.out" ] \ {relmain.c} "relmain" "relmain.out" ] \
[list "Run pr2404" \ [list "Run pr2404" \
"-Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" "" \ "$NOSANTIZE_CFLAGS -Wl,--no-as-needed \
{dummy.c} "pr2404" "pr2404.out" ] \ tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
"" \
{dummy.c} "pr2404" "pr2404.out" \
"$NOSANTIZE_CFLAGS" ] \
[list "Run pr2404n" \ [list "Run pr2404n" \
"-Wl,-z,now -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404n.so" "" \ "$NOSANTIZE_CFLAGS -Wl,-z,now \
{dummy.c} "pr2404n" "pr2404.out" ] \ -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404n.so" "" \
{dummy.c} "pr2404n" "pr2404.out" \
"$NOSANTIZE_CFLAGS" ] \
[list "Run pr18458" \ [list "Run pr18458" \
"-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \ "-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \
{pr18458c.c} "pr18458" "pass.out" ] \ {pr18458c.c} "pr18458" "pass.out" ] \
@ -1126,14 +1150,29 @@ set build_cxx_tests {
{"Build libdl3a.so with --dynamic-list-cpp-typeinfo" {"Build libdl3a.so with --dynamic-list-cpp-typeinfo"
"-shared -Wl,--dynamic-list-cpp-typeinfo" "-fPIC" "-shared -Wl,--dynamic-list-cpp-typeinfo" "-fPIC"
{dl3.cc} {} "libdl3c.so" "c++"} {dl3.cc} {} "libdl3c.so" "c++"}
{"Build libdnew1a.so with --Bsymbolic-functions --dynamic-list-cpp-new"
"-shared -Wl,-Bsymbolic-functions,--dynamic-list-cpp-new" "-fPIC -ansi"
{del.cc new.cc} {} "libnew1a.so" "c++"}
{"Build libdnew1b.so with --dynamic-list-data --dynamic-list-cpp-new"
"-shared -Wl,--dynamic-list-data,--dynamic-list-cpp-new" "-fPIC -ansi"
{del.cc new.cc} {} "libnew1b.so" "c++"}
} }
run_cc_link_tests [list \
[list \
"Build libdnew1a.so with --Bsymbolic-functions --dynamic-list-cpp-new" \
"-shared $NOSANTIZE_CFLAGS -Wl,-Bsymbolic-functions,--dynamic-list-cpp-new" \
"-fPIC -ansi $NOSANTIZE_CFLAGS" \
{del.cc new.cc} \
{} \
"libnew1a.so" \
"c++" \
] \
[list \
"Build libdnew1b.so with --dynamic-list-data --dynamic-list-cpp-new" \
"-shared $NOSANTIZE_CFLAGS -Wl,--dynamic-list-data,--dynamic-list-cpp-new" \
"-fPIC -ansi $NOSANTIZE_CFLAGS" \
{del.cc new.cc} \
{} \
"libnew1b.so" \
"c++" \
] \
]
# "-shared -Bsymbolic" only works with gcc 4.5.0 and newer. # "-shared -Bsymbolic" only works with gcc 4.5.0 and newer.
# {"Run with libdl3b.so" # {"Run with libdl3b.so"
# "tmpdir/libdl3b.so" "" # "tmpdir/libdl3b.so" ""
@ -1145,14 +1184,31 @@ set run_cxx_tests {
{"Run with libdl3c.so" {"Run with libdl3c.so"
"-Wl,--no-as-needed tmpdir/libdl3c.so" "" "-Wl,--no-as-needed tmpdir/libdl3c.so" ""
{dl3main.cc} "dl3c" "dl3a.out" "" "c++"} {dl3main.cc} "dl3c" "dl3a.out" "" "c++"}
{"Run with libnew1a.so"
"-Wl,--no-as-needed tmpdir/libnew1a.so" ""
{dl5.cc} "dl5a" "dl5.out" "-ansi" "c++"}
{"Run with libnew1b.so"
"-Wl,--no-as-needed tmpdir/libnew1b.so" ""
{dl5.cc} "dl5b" "dl5.out" "-ansi" "c++"}
} }
run_ld_link_exec_tests [list \
[list \
"Run with libnew1a.so" \
"-Wl,--no-as-needed tmpdir/libnew1a.so $NOSANTIZE_CFLAGS" \
"" \
{dl5.cc} \
"dl5a" \
"dl5.out" \
"-ansi $NOSANTIZE_CFLAGS" \
"c++" \
] \
[list \
"Run with libnew1b.so" \
"-Wl,--no-as-needed tmpdir/libnew1b.so $NOSANTIZE_CFLAGS" \
"" \
{dl5.cc} \
"dl5b" \
"dl5.out" \
"-ansi $NOSANTIZE_CFLAGS" \
"c++" \
] \
]
run_cc_link_tests $build_cxx_tests run_cc_link_tests $build_cxx_tests
run_ld_link_exec_tests $run_cxx_tests run_ld_link_exec_tests $run_cxx_tests
@ -1163,7 +1219,7 @@ if { [istarget *-*-linux*]
[list \ [list \
"Build libpr2404b.a with PIE" \ "Build libpr2404b.a with PIE" \
"" \ "" \
"-fPIE" \ "-fPIE $NOSANTIZE_CFLAGS" \
{ pr2404b.c } \ { pr2404b.c } \
{} \ {} \
"libpr2404b.a" \ "libpr2404b.a" \
@ -1249,21 +1305,21 @@ if { [istarget *-*-linux*]
] \ ] \
[list \ [list \
"Run pr2404 with PIE" \ "Run pr2404 with PIE" \
"-pie -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" \ "-pie $NOSANTIZE_CFLAGS -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
"" \ "" \
{ dummy.c } \ { dummy.c } \
"pr2404pie" \ "pr2404pie" \
"pr2404.out" \ "pr2404.out" \
"-fPIE" \ "-fPIE $NOSANTIZE_CFLAGS" \
] \ ] \
[list \ [list \
"Run pr2404 with PIE (-z now)" \ "Run pr2404 with PIE (-z now)" \
"-pie -Wl,-z,now -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404n.so" \ "-pie $NOSANTIZE_CFLAGS -Wl,-z,now -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404n.so" \
"" \ "" \
{ dummy.c } \ { dummy.c } \
"pr2404pien" \ "pr2404pien" \
"pr2404.out" \ "pr2404.out" \
"-fPIE" \ "-fPIE $NOSANTIZE_CFLAGS" \
] \ ] \
[list \ [list \
"Run pr18718" \ "Run pr18718" \
@ -1499,7 +1555,7 @@ if { ([istarget "*-*-linux*"]
{ pr23162a.c } \ { pr23162a.c } \
"" \ "" \
"libpr23162a.so" \ "libpr23162a.so" \
"-fPIC -O2" \ "-fPIC -O2 $NOSANTIZE_CFLAGS" \
] \ ] \
[list \ [list \
"Build pr23162a" \ "Build pr23162a" \
@ -1509,7 +1565,7 @@ if { ([istarget "*-*-linux*"]
{ pr23162b.c } \ { pr23162b.c } \
{{readelf {-rW} pr23162.rd}} \ {{readelf {-rW} pr23162.rd}} \
"pr23162a" \ "pr23162a" \
"-fPIC -O0" \ "-fPIC -O0 $NOSANTIZE_CFLAGS" \
] \ ] \
[list \ [list \
"Build libpr23162b.so" \ "Build libpr23162b.so" \
@ -1519,7 +1575,7 @@ if { ([istarget "*-*-linux*"]
{ pr23162a.c } \ { pr23162a.c } \
"" \ "" \
"libpr23162b.so" \ "libpr23162b.so" \
"-fPIC -O2" \ "-fPIC -O2 $NOSANTIZE_CFLAGS" \
] \ ] \
[list \ [list \
"Build pr23162b" \ "Build pr23162b" \
@ -1529,7 +1585,7 @@ if { ([istarget "*-*-linux*"]
{ pr23162b.c } \ { pr23162b.c } \
{{readelf {-rW} pr23162.rd}} \ {{readelf {-rW} pr23162.rd}} \
"pr23162b" \ "pr23162b" \
"-fPIC -O0" \ "-fPIC -O0 $NOSANTIZE_CFLAGS" \
] \ ] \
[list \ [list \
"Build libpr23161a.so" \ "Build libpr23161a.so" \

View File

@ -169,9 +169,9 @@ if [istarget nios2*-*-*] {
# Explicitly use "-fcommon" so that even if $CFLAGS includes # Explicitly use "-fcommon" so that even if $CFLAGS includes
# "-fno-common", these tests are compiled as expected. # "-fno-common", these tests are compiled as expected.
if { ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1a.c tmpdir/common1a.o] if { ![ld_compile "$CC $CFLAGS -fcommon $NOSANTIZE_CFLAGS" $srcdir/$subdir/common1a.c tmpdir/common1a.o]
|| ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1b.o] || ![ld_compile "$CC $CFLAGS -fcommon $NOSANTIZE_CFLAGS" $srcdir/$subdir/common1b.c tmpdir/common1b.o]
|| ![ld_compile "$CC $CFLAGS -Wa,--elf-stt-common=yes -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } { || ![ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS -Wa,--elf-stt-common=yes -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } {
unresolved $test1 unresolved $test1
unresolved $test1 unresolved $test1
return return

View File

@ -489,8 +489,9 @@ proc build_binary { shared pic test source libname other mapfile verexp versymex
global CC global CC
global CFLAGS global CFLAGS
global script global script
global NOSANTIZE_CFLAGS
if ![ld_compile "$CC -S $pic $CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] { if ![ld_compile "$CC -S $pic $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] {
unresolved "$test" unresolved "$test"
return return
} }
@ -687,6 +688,7 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
global objdump global objdump
global CC global CC
global CFLAGS global CFLAGS
global NOSANTIZE_CFLAGS
set shared "--shared --no-undefined-version" set shared "--shared --no-undefined-version"
set script --version-script set script --version-script
@ -697,6 +699,9 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
append cc_cmd " -fno-lto" append cc_cmd " -fno-lto"
} }
# Disable all sanitizers.
append cc_cmd " $NOSANTIZE_CFLAGS"
if ![ld_compile $cc_cmd $srcdir/$subdir/$source $tmpdir/$execname.s] { if ![ld_compile $cc_cmd $srcdir/$subdir/$source $tmpdir/$execname.s] {
unresolved "$test" unresolved "$test"
return return

View File

@ -444,7 +444,7 @@ visibility_run protected_undef_def
visibility_run protected_weak visibility_run protected_weak
visibility_run normal visibility_run normal
if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } { if { ![ld_compile "$CC -g $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } {
unresolved "common hidden symbol" unresolved "common hidden symbol"
} else { } else {
if ![ld_link $ld tmpdir/common "tmpdir/common.o"] { if ![ld_link $ld tmpdir/common "tmpdir/common.o"] {
@ -454,10 +454,10 @@ if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } {
} }
} }
if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/test.c tmpdir/test.o] } { if { ![ld_compile "$CC -g $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/test.c tmpdir/test.o] } {
unresolved "weak hidden symbol" unresolved "weak hidden symbol"
} else { } else {
if { ![ld_compile "$CC -g $CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh3.c tmpdir/sh3.o] } { if { ![ld_compile "$CC -g $CFLAGS $NOSANTIZE_CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh3.c tmpdir/sh3.o] } {
unresolved "weak hidden symbol" unresolved "weak hidden symbol"
} else { } else {
if ![ld_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] { if ![ld_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] {

View File

@ -267,13 +267,14 @@ proc build_lib {test libname objs dynsymexp} {
global shared global shared
global srcdir global srcdir
global subdir global subdir
global NOSANTIZE_CFLAGS
set files "" set files ""
foreach obj $objs { foreach obj $objs {
set files "$files $tmpdir/$obj" set files "$files $tmpdir/$obj"
} }
if {![ld_link $CC $tmpdir/$libname.so "$shared $files"]} { if {![ld_link "$CC $NOSANTIZE_CFLAGS" $tmpdir/$libname.so "$shared $files"]} {
fail $test fail $test
return return
} }
@ -355,6 +356,9 @@ if {[check_lto_available]} {
append cc_cmd " -fno-lto" append cc_cmd " -fno-lto"
} }
# Disable all sanitizers.
append cc_cmd " $NOSANTIZE_CFLAGS"
# Old version of GCC for MIPS default to enabling -fpic # Old version of GCC for MIPS default to enabling -fpic
# and get confused if it is used on the command line. # and get confused if it is used on the command line.
if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then { if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {

View File

@ -141,7 +141,7 @@ set lto_link_tests [list \
"" "-flto -O2 $lto_fat $NOSANTIZE_CFLAGS" \ "" "-flto -O2 $lto_fat $NOSANTIZE_CFLAGS" \
{pr12758b.c} {} "libpr12758.a"] \ {pr12758b.c} {} "libpr12758.a"] \
[list "PR ld/12758" \ [list "PR ld/12758" \
"$NOPIE_LDFLAGS -O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" \ "$NOPIE_LDFLAGS $NOSANTIZE_CFLAGS -O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" \
"$NOSANTIZE_CFLAGS" \ "$NOSANTIZE_CFLAGS" \
{dummy.c} {} "pr12758.exe"] \ {dummy.c} {} "pr12758.exe"] \
[list "Build libpr13183.a" \ [list "Build libpr13183.a" \
@ -458,10 +458,12 @@ set lto_link_symbol_tests [list \
"-O2 -flto -fuse-linker-plugin tmpdir/lto-9.o" "" \ "-O2 -flto -fuse-linker-plugin tmpdir/lto-9.o" "" \
{dummy.c} {{"nm" {-C} "lto-9.d"}} "lto-9.exe" "c++"] \ {dummy.c} {{"nm" {-C} "lto-9.d"}} "lto-9.exe" "c++"] \
[list "LTO 16a symbol" \ [list "LTO 16a symbol" \
"-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin" "-flto" \ "-O2 $NOSANTIZE_CFLAGS -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin" \
"-flto $NOSANTIZE_CFLAGS" \
{lto-16a.c} {{"nm" {} "lto-16a.d"}} "lto-16.exe" "c"] \ {lto-16a.c} {{"nm" {} "lto-16a.d"}} "lto-16.exe" "c"] \
[list "LTO 16b symbol" \ [list "LTO 16b symbol" \
"-O2 -Wl,-e,foo -u bar -nostdlib -flto -fuse-linker-plugin" "-flto" \ "-O2 $NOSANTIZE_CFLAGS -Wl,-e,foo -u bar -nostdlib -flto -fuse-linker-plugin" \
"-flto $NOSANTIZE_CFLAGS" \
{lto-16a.c lto-16b.c} {{"nm" {} "lto-16b.d"}} "lto-16b.exe" "c"] \ {lto-16a.c lto-16b.c} {{"nm" {} "lto-16b.d"}} "lto-16b.exe" "c"] \
[list "PR ld/13183" \ [list "PR ld/13183" \
"-O2 -flto -fuse-linker-plugin tmpdir/pr13183b.o tmpdir/libpr13183.a" "" \ "-O2 -flto -fuse-linker-plugin tmpdir/pr13183b.o tmpdir/libpr13183.a" "" \
@ -667,7 +669,8 @@ if { [at_least_gcc_version 4 7] } {
run_cc_link_tests [list \ run_cc_link_tests [list \
[list \ [list \
"Build pr22721a.so" \ "Build pr22721a.so" \
"-shared -nostdlib -nostartfiles -Wl,-version-script,pr22721.t" \ "-shared $NOSANTIZE_CFLAGS -nostdlib -nostartfiles \
-Wl,-version-script,pr22721.t" \
"" \ "" \
{pr22721a.s} \ {pr22721a.s} \
{} \ {} \
@ -675,15 +678,16 @@ if { [at_least_gcc_version 4 7] } {
] \ ] \
[list \ [list \
"Build pr22721b.o" \ "Build pr22721b.o" \
"$plug_opt" \ "$plug_opt $NOSANTIZE_CFLAGS" \
"-O2 -fPIC -flto $lto_no_fat" \ "-O2 -fPIC -flto $lto_no_fat" \
{pr22721b.c} \ {pr22721b.c} \
] \ ] \
[list \ [list \
"Build PR ld/pr22721" \ "Build PR ld/pr22721" \
"-O2 -flto -fuse-linker-plugin -nostdlib -nostartfiles \ "-O2 -flto -fuse-linker-plugin -nostdlib -nostartfiles \
$NOSANTIZE_CFLAGS \
-Wl,-e,_start tmpdir/pr22721b.o tmpdir/pr22721a.so" \ -Wl,-e,_start tmpdir/pr22721b.o tmpdir/pr22721a.so" \
"" \ "$NOSANTIZE_CFLAGS" \
{dummy.c} \ {dummy.c} \
{} \ {} \
"pr22721.exe" "pr22721.exe"

View File

@ -295,9 +295,9 @@ if { !$can_compile || $failed_compile } {
run_ld_link_tests $plugin_tests run_ld_link_tests $plugin_tests
if { [is_elf_format] \ if { [is_elf_format] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \ && [ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \ && [ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } { && [ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } {
run_ld_link_tests $plugin_extra_elf_tests run_ld_link_tests $plugin_extra_elf_tests
} }

View File

@ -63,8 +63,8 @@ if [istarget tic6x*-*-*] {
set CFLAGS "-mno-dsbt -msdata=none" set CFLAGS "-mno-dsbt -msdata=none"
} }
if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \ if { ![ld_compile "$CC $NOSANTIZE_CFLAGS" "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \
|| ![ld_compile $CC "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } { || ![ld_compile "$CC $NOSANTIZE_CFLAGS" "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } {
unresolved $test1 unresolved $test1
unresolved $test2 unresolved $test2
set CFLAGS "$old_CFLAGS" set CFLAGS "$old_CFLAGS"
@ -101,7 +101,7 @@ if [string match "" $exec_output] then {
# Check cross references within a single object. # Check cross references within a single object.
if { ![ld_compile $CC "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } { if { ![ld_compile "$CC $NOSANTIZE_CFLAGS" "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } {
unresolved $test2 unresolved $test2
set CFLAGS "$old_CFLAGS" set CFLAGS "$old_CFLAGS"
set CC "$old_CC" set CC "$old_CC"
@ -126,7 +126,7 @@ if [string match "" $exec_output] then {
# Check cross references for ld -r # Check cross references for ld -r
if { ![ld_compile $CC "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } { if { ![ld_compile "$CC $NOSANTIZE_CFLAGS" "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
unresolved $test3 unresolved $test3
set CFLAGS "$old_CFLAGS" set CFLAGS "$old_CFLAGS"
set CC "$old_CC" set CC "$old_CC"