S-records tests don't work with -fno-plt. This path appends $PLT_CFLAGS
to CC and CXX for S-records tests.
* ld-srec/srec.exp (CC): Save and restore. Append $PLT_CFLAGS.
(CXX): Likewise.
+2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-srec/srec.exp (CC): Save and restore. Append $PLT_CFLAGS.
+ (CXX): Likewise.
+
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
* ld-shared/shared.exp: Pass $PLT_CFLAGS to ld_compile.
return
}
+# Pass -fplt to CC and CXX since -fno-plt doesn't work with S-records
+# tests.
+global PLT_CFLAGS
+set old_CC "$CC"
+set CC "$CC $PLT_CFLAGS"
+set old_CXX "$CXX"
+set CXX "$CXX $PLT_CFLAGS"
+
if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
|| ![ld_compile $CC $srcdir/$subdir/sr2.c tmpdir/sr2.o] } {
unresolved $test1
unresolved $test2
+ set CC "$old_CC"
+ set CXX "$old_CXX"
return
}
if { ![is_remote host] && [which $CXX] == 0 } {
untested $test2
+ set CC "$old_CC"
+ set CXX "$old_CXX"
return
}
if ![ld_compile "$CXX $CXXFLAGS -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] {
unresolved $test2
+ set CC "$old_CC"
+ set CXX "$old_CXX"
return
}
setup_xfail "tile*-*-*"
run_srec_test $test2 "tmpdir/sr3.o"
+
+set CC "$old_CC"
+set CXX "$old_CXX"