lib/ld-lib.exp (check_sysroot_available): New proc.
authorHans-Peter Nilsson <hp@bitrange.com>
Wed, 15 Oct 2014 00:54:56 +0000 (02:54 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Wed, 15 Oct 2014 00:54:56 +0000 (02:54 +0200)
ld/testsuite/ChangeLog
ld/testsuite/lib/ld-lib.exp

index fd0c8baa460e32a765351c5293d30f33709d6442..f8dcc96f8a2ac27ab32ebaefcded07aa830831c7 100644 (file)
@@ -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.
index 292a8734e6f065a2f2d917473e830ea87412caef..ffdf8051f3191e00433b632810c25f68b3b6494c 100644 (file)
@@ -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
This page took 0.025408 seconds and 4 git commands to generate.