This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Append $PLT_CFLAGS to CC/CXX for S-records tests


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=219a6876d48c9986b47d045a41b74cb6c84a2116

commit 219a6876d48c9986b47d045a41b74cb6c84a2116
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jul 27 05:18:20 2015 -0700

    Append $PLT_CFLAGS to CC/CXX for S-records tests
    
    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.

Diff:
---
 ld/testsuite/ChangeLog        |  5 +++++
 ld/testsuite/ld-srec/srec.exp | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index abc49b3..75c1547 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 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.
 
 2015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp
index 758ed28..ea2f1e0 100644
--- a/ld/testsuite/ld-srec/srec.exp
+++ b/ld/testsuite/ld-srec/srec.exp
@@ -339,10 +339,20 @@ if { ![is_remote host] && [which $CC] == 0 } {
     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
 }
 
@@ -403,11 +413,15 @@ run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
 
 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
 }
 
@@ -427,3 +441,6 @@ setup_xfail "bfin-*-linux-uclibc"
 setup_xfail "tile*-*-*"
 
 run_srec_test $test2 "tmpdir/sr3.o"
+
+set CC "$old_CC"
+set CXX "$old_CXX"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]