aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2017-01-23 09:59:10 +0000
committerJiong Wang <jiong.wang@arm.com>2017-01-23 09:59:10 +0000
commit9966f7eece39ced8a09c190616b5b328bf97bfe5 (patch)
tree1b0f298f3af6a9e35d8e794d21d6578c5bfc7fd0 /ld/testsuite/lib/ld-lib.exp
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-9966f7eece39ced8a09c190616b5b328bf97bfe5.tar.gz
binutils-gdb-9966f7eece39ced8a09c190616b5b328bf97bfe5.tar.bz2
binutils-gdb-9966f7eece39ced8a09c190616b5b328bf97bfe5.zip
[ld, testsuite] Honor cflags when GCC used as linker driver
ld/ * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Append board_cflags as gcc is used as linker driver. * testsuite/ld-unique/unique.exp: Likewise
Diffstat (limited to 'ld/testsuite/lib/ld-lib.exp')
-rw-r--r--ld/testsuite/lib/ld-lib.exp13
1 files changed, 12 insertions, 1 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 5ca700bf27a..a44358e0aaa 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1381,6 +1381,17 @@ proc run_ld_link_exec_tests { ldtests args } {
global CXXFLAGS
global errcnt
global exec_output
+ global board_cflags
+
+ # When using GCC as the linker driver, we need to specify board cflags when
+ # linking because cflags may contain linker options. For example when
+ # linker options are included in GCC spec files then we need the -specs
+ # option.
+ if [board_info [target_info name] exists cflags] {
+ set board_cflags " [board_info [target_info name] cflags]"
+ } else {
+ set board_cflags ""
+ }
foreach testitem $ldtests {
foreach target $args {
@@ -1440,7 +1451,7 @@ proc run_ld_link_exec_tests { ldtests args } {
# compile only
pass $testname
continue;
- } elseif ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] {
+ } elseif ![$link_proc $link_cmd $binfile "$board_cflags -L$srcdir/$subdir $ld_options $objfiles"] {
set failed 1
}