]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix linker detection in check_gc_sections_available
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 2 Nov 2016 10:35:57 +0000 (10:35 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 2 Nov 2016 10:35:57 +0000 (10:35 +0000)
* lib/target-supports.exp (check_gc_sections_available): Use
-print-prog-name=ld to determine linker used.

From-SVN: r241785

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index e34697c2ad4f3120c02a33cbf14c80bf78e7f28e..a85f04aebc38bd38be1bfbb78460883ae444f897 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * lib/target-supports.exp (check_gc_sections_available): Use
+       -print-prog-name=ld to determine linker used.
+
 2016-10-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        Backport from trunk
index b7aca17330b52c9671ac5f129a407aaf25b70c2d..d5dfeaee7912b8801f75cbf1056d40365e40316f 100644 (file)
@@ -427,9 +427,7 @@ proc check_gc_sections_available { } {
        }
 
        # Check if the ld used by gcc supports --gc-sections.
-       set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""]
-       regsub ".*\n\\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker
-       set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=$linker" "" "none" ""] 0]
+       set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=ld" "" "none" ""] 0]
        set ld_output [remote_exec host "$gcc_ld" "--help"]
        if { [ string first "--gc-sections" $ld_output ] >= 0 } {
            set gc_sections_available_saved 1