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

From-SVN: r241783

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

index 38668b74c8b260328cf46d92839ba73437038f99..4b3e9ec1510fcdf8077ad2f53ac8bef9bd65fee8 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-11-02  Martin Liska  <mliska@suse.cz>
 
        * gcc.dg/tree-ssa/builtins-folding-gimple-ub.c (main): Add
index 722955a04a1584489f9b2b5b7a2b909714593ed5..24a067d039c2d4cd4ce1c313b7cc2a791e2dcc03 100644 (file)
@@ -462,9 +462,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