aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorYufeng Zhang <yufeng.zhang@arm.com>2013-12-18 15:16:41 +0000
committerYufeng Zhang <yufeng.zhang@arm.com>2013-12-18 15:16:41 +0000
commit7174e19ff2ec10026c18e8582331d88e1c6242b2 (patch)
tree1ff143ff2fa8ab40296fa65342526f59c568069e /ld/testsuite
parent720fbed62e63f627f297174d6751d5702621568a (diff)
downloadfsf-binutils-gdb-7174e19ff2ec10026c18e8582331d88e1c6242b2.zip
fsf-binutils-gdb-7174e19ff2ec10026c18e8582331d88e1c6242b2.tar.gz
fsf-binutils-gdb-7174e19ff2ec10026c18e8582331d88e1c6242b2.tar.bz2
ld/testsuite
2013-12-18 Vidya Praveen <vidyapraveen@arm.com> * lib/ld-lib.exp (check_lto_available): Support cflags, ldflags and test by compiling for an executable rather than shared library.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/lib/ld-lib.exp17
2 files changed, 19 insertions, 3 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 9b87649..f7e6e58 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-18 Vidya Praveen <vidyapraveen@arm.com>
+
+ * lib/ld-lib.exp (check_lto_available): Support cflags, ldflags and
+ test by compiling for an executable rather than shared library.
+
2013-12-13 Vidya Praveen <vidyapraveen@arm.com>
* lib/ld-lib.exp (default_ld_link): Use ldflags from board description
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 14670fa..c04b56f 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1644,6 +1644,17 @@ proc check_plugin_api_available { } {
proc check_lto_available { } {
global lto_available_saved
global CC
+
+ set flags ""
+
+ if [board_info [target_info name] exists cflags] {
+ append flags " [board_info [target_info name] cflags]"
+ }
+
+ if [board_info [target_info name] exists ldflags] {
+ append flags " [board_info [target_info name] ldflags]"
+ }
+
if {![info exists lto_available_saved]} {
# Check if gcc supports -flto -fuse-linker-plugin
if { [which $CC] == 0 } {
@@ -1652,11 +1663,11 @@ proc check_lto_available { } {
}
set basename "lto"
set src ${basename}[pid].c
- set output ${basename}[pid].so
+ set output ${basename}[pid].out
set f [open $src "w"]
- puts $f ""
+ puts $f "int main() { return 0; }"
close $f
- set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -ffat-lto-objects -fuse-linker-plugin $src -o $output"]
+ set status [remote_exec host $CC "$flags -B[pwd]/tmpdir/ld/ -flto -ffat-lto-objects -fuse-linker-plugin $src -o $output"]
if { [lindex $status 0] == 0 } {
set lto_available_saved 1
} else {