This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix ERROR: target-cc does not exist


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8be1e36919a884152d7115f4f4b8c0cfcf086a1f

commit 8be1e36919a884152d7115f4f4b8c0cfcf086a1f
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Aug 11 23:42:05 2016 +0930

    Fix ERROR: target-cc does not exist
    
    	PR ld/20436
    	* testsuite/lib/ld-lib.exp (at_least_gcc_version): Don't ignore
    	remote_exec status.
    	(check_gcc_plugin_enabled): Likewise.

Diff:
---
 ld/ChangeLog                |  7 +++++++
 ld/testsuite/lib/ld-lib.exp | 15 +++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6e9565c..35e066e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2016-08-11  Alan Modra  <amodra@gmail.com>
+
+	PR ld/20436
+	* testsuite/lib/ld-lib.exp (at_least_gcc_version): Don't ignore
+	remote_exec status.
+	(check_gcc_plugin_enabled): Likewise.  Revert previous patch.
+
 2016-08-11  Nick Clifton  <nickc@redhat.com>
 
 	PR ld/20436
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 23055be..7b190be 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -35,9 +35,12 @@ proc at_least_gcc_version { major minor } {
 	set CC [find_gcc]
     }
     if { $CC == "" } {
-      return 0
+	return 0
     }
     set state [remote_exec host $CC --version]
+    if { [lindex $state 0] != 0 } {
+	return 0;
+    }
     set tmp "[lindex $state 1]\n"
     # Look for (eg) 4.6.1 in the version output.
     set ver_re "\[^\\.0-9\]+(\[1-9\]\[0-9\]*)\\.(\[0-9\]+)(?:\\.\[0-9\]+)?"
@@ -1816,13 +1819,13 @@ proc check_gcc_plugin_enabled { } {
 	set CC [find_gcc]
     }
     if { $CC == ""} {
-      return 0
-    }
-    if { ![is_remote host] && [which $CC] == 0 } then {
-      return 0
+	return 0
     }
     set state [remote_exec host $CC -v]
-    for { set i 0 } { $i < [llength $state] } { incr i } {
+    if { [lindex $state 0] != 0 } {
+	return 0;
+    }
+    for { set i 1 } { $i < [llength $state] } { incr i } {
 	set v [lindex $state $i]
 	if { [ string match "*--disable-plugin*" $v ] } {
 	    verbose "plugin is disabled by $v"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]