summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfvers
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-10-22 06:04:21 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-10-22 06:04:36 -0700
commitc6d47bff77db79b1ad99cd7911f7e1807874be55 (patch)
treebc57be9e8e0f4e3e660b455411c5fecdae6401b5 /ld/testsuite/ld-elfvers
parent63aa0ac0fd8f4d46507a12c1a38217f8d7d1ee33 (diff)
downloadbinutils-gdb-c6d47bff77db79b1ad99cd7911f7e1807874be55.tar.gz
ld: Pass -fno-lto to non LTO tests
* testsuite/config/default.exp (NOLTO_CFLAGS): New. * ld/testsuite/ld-elfcomm/elfcomm.exp: Add $NOLTO_CFLAGS to CC. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-undefined/undefined.exp: Likewise. * testsuite/ld-srec/srec.exp: Add $NOLTO_CFLAGS to CC. Override CXXFLAGS. * testsuite/lib/ld-lib.exp (run_ld_link_tests): Prepend -fno-lto to cflags.
Diffstat (limited to 'ld/testsuite/ld-elfvers')
-rw-r--r--ld/testsuite/ld-elfvers/vers.exp11
1 files changed, 7 insertions, 4 deletions
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 91ff8f1448e..817e8be6d4d 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -490,8 +490,9 @@ proc build_binary { shared pic test source libname other mapfile verexp versymex
global CFLAGS
global script
global NOSANITIZE_CFLAGS
+ global NOLTO_CFLAGS
- if ![ld_compile "$CC -S $pic $CFLAGS $NOSANITIZE_CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] {
+ if ![ld_compile "$CC -S $pic $CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] {
unresolved "$test"
return
}
@@ -619,8 +620,9 @@ proc test_asfail { test flag source execname whyfail } {
global as
global CC
global CFLAGS
+ global NOLTO_CFLAGS
- if ![ld_compile "$CC -S $flag $CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
+ if ![ld_compile "$CC -S $flag $CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
unresolved "$test"
return
}
@@ -689,6 +691,7 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
global CC
global CFLAGS
global NOSANITIZE_CFLAGS
+ global NOLTO_CFLAGS
set shared "--shared --no-undefined-version"
set script --version-script
@@ -699,8 +702,8 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
append cc_cmd " -fno-lto"
}
- # Disable all sanitizers.
- append cc_cmd " $NOSANITIZE_CFLAGS"
+ # Disable all sanitizers and LTO.
+ append cc_cmd " $NOSANITIZE_CFLAGS $NOLTO_CFLAGS"
if ![ld_compile $cc_cmd $srcdir/$subdir/$source $tmpdir/$execname.s] {
unresolved "$test"