aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2014-10-15 02:54:56 +0200
committerHans-Peter Nilsson <hp@bitrange.com>2014-10-15 02:54:56 +0200
commitbdd65db9b9cd6d5dbdff9b48e97379029f8a3a1a (patch)
treea764aa4c369c67655e97fda614a5aa77059c74c2 /ld
parentcad60a339b2a0a6af675d4243daa78c61eea06b5 (diff)
downloadgdb-bdd65db9b9cd6d5dbdff9b48e97379029f8a3a1a.zip
gdb-bdd65db9b9cd6d5dbdff9b48e97379029f8a3a1a.tar.gz
gdb-bdd65db9b9cd6d5dbdff9b48e97379029f8a3a1a.tar.bz2
lib/ld-lib.exp (check_sysroot_available): New proc.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/lib/ld-lib.exp18
2 files changed, 22 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index fd0c8ba..f8dcc96 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-15 Hans-Peter Nilsson <hp@axis.com>
+
+ * lib/ld-lib.exp (check_sysroot_available): New proc.
+
2014-10-04 Alan Modra <amodra@gmail.com>
* ld-elf/eh1.s: Don't create FDEs with zero address ranges.
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 292a873..ffdf805 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1669,6 +1669,24 @@ proc check_plugin_api_available { } {
return $plugin_api_available_saved
}
+# Returns true if the target ld supports sysroot.
+proc check_sysroot_available { } {
+ global ld_sysroot_available_saved
+ global ld
+ if {![info exists ld_sysroot_available_saved]} {
+ # Check if ld supports --sysroot *other* than empty
+ # (non-sysroot linkers don't emit errors for --sysroot="").
+ # The help-text by itself is no indication as it always lists --sysroot.
+ set status [remote_exec host $ld "--sysroot=ldxyzzy --help >/dev/null"]
+ if { [lindex $status 0] != 0 } {
+ set ld_sysroot_available_saved 0
+ } else {
+ set ld_sysroot_available_saved 1
+ }
+ }
+ return $ld_sysroot_available_saved
+}
+
# Returns true if the target compiler supports LTO
proc check_lto_available { } {
global lto_available_saved