aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-08-09 16:41:12 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-08-09 16:41:29 -0700
commit5ff559107a34a664abf7db01cc9db93e3597d466 (patch)
tree6890b5555a3a0ed61f8a22f8e5ce4fe36782165d /ld
parent3eb7562a983bab4c768983bcd85708852d171121 (diff)
downloadgdb-5ff559107a34a664abf7db01cc9db93e3597d466.zip
gdb-5ff559107a34a664abf7db01cc9db93e3597d466.tar.gz
gdb-5ff559107a34a664abf7db01cc9db93e3597d466.tar.bz2
Skip LTO tests for --disable-plugin
Don't run LTO tests if compiler is configured with --disable-plugin. PR ld/20436 * testsuite/lib/ld-lib.exp (check_gcc_plugin_enabled): New proc. (check_lto_available): Return 0 if check_gcc_plugin_enabled returns 0. (check_lto_fat_available): Likewise. (check_lto_shared_available): Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/testsuite/lib/ld-lib.exp28
2 files changed, 35 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e3ca953..cc7d915 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2016-08-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/20436
+ * testsuite/lib/ld-lib.exp (check_gcc_plugin_enabled): New
+ proc.
+ (check_lto_available): Return 0 if check_gcc_plugin_enabled
+ returns 0.
+ (check_lto_fat_available): Likewise.
+ (check_lto_shared_available): Likewise.
+
2016-08-09 Roland McGrath <roland@hack.frob.com>
* emulparams/armelf.sh (GENERATE_PIE_SCRIPT): Set to yes.
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index cd9e930..b3cdb70 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1808,13 +1808,35 @@ proc check_sysroot_available { } {
return $ld_sysroot_available_saved
}
+# Returns 1 if plugin is enabled in gcc. Returns 0 otherwise.
+proc check_gcc_plugin_enabled { } {
+ global CC
+
+ if {![info exists CC]} {
+ set CC [find_gcc]
+ }
+ if { $CC == "" } {
+ return 0
+ }
+ set state [remote_exec host $CC -v]
+ for { set i 0 } { $i < [llength $state] } { incr i } {
+ set v [lindex $state $i]
+ if { [ string match "*--disable-plugin*" $v ] } {
+ verbose "plugin is disabled by $v"
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
# Returns true if the target compiler supports LTO
proc check_lto_available { } {
global lto_available_saved
global CC
if {![info exists lto_available_saved]} {
- if { [which $CC] == 0 } {
+ if { ![check_gcc_plugin_enabled] } {
set lto_available_saved 0
return 0
}
@@ -1857,7 +1879,7 @@ proc check_lto_fat_available { } {
global CC
if {![info exists lto_fat_available_saved]} {
- if { [which $CC] == 0 } {
+ if { ![check_gcc_plugin_enabled] } {
set lto_fat_available_saved 0
return 0
}
@@ -1900,7 +1922,7 @@ proc check_lto_shared_available { } {
global CC
if {![info exists lto_shared_available_saved]} {
- if { [which $CC] == 0 } {
+ if { ![check_gcc_plugin_enabled] } {
set lto_shared_available_saved 0
return 0
}