]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: target-supports.exp (check_compile): Save/restore additional_sources that...
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Thu, 19 Feb 2015 08:52:16 +0000 (08:52 +0000)
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>
Thu, 19 Feb 2015 08:52:16 +0000 (08:52 +0000)
Backport from mainline: Fix testsuite race on additional_sources

2015-02-19  Maxim Kuvyrkov  <maxim.kuvyrkov@linaro.org>

* lib/target-supports.exp (check_compile): Save/restore
additional_sources that may belong to an actual test.

From-SVN: r220809

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

index 6f2c85d0e06eed7d047ec8d7cfab952c0e52759e..bcf5fdaa9aa28a5de2a496aa23e2941e34c24663 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-19  Maxim Kuvyrkov  <maxim.kuvyrkov@linaro.org>
+
+       Backport from mainline
+       2015-02-19  Maxim Kuvyrkov  <maxim.kuvyrkov@linaro.org>
+
+       * lib/target-supports.exp (check_compile): Save/restore
+       additional_sources that may belong to an actual test.
+
 2015-02-17  Sandra Loosemore  <sandra@codesourcery.com>
 
        Backported from mainline
index 52ec684fb6d0dcb85aa4c4a3f81801034d85aa8e..819f4900171d466586d6d7b2f81a231f839aad90 100644 (file)
@@ -41,6 +41,12 @@ proc check_compile {basename type contents args} {
     global tool
     verbose "check_compile tool: $tool for $basename" 
 
+    # Save additional_sources to avoid compiling testsuite's sources
+    # against check_compile's source.
+    global additional_sources
+    set tmp_additional_sources "$additional_sources"
+    set additional_sources ""
+
     if { [llength $args] > 0 } {
        set options [list "additional_flags=[lindex $args 0]"]
     } else {
@@ -86,6 +92,9 @@ proc check_compile {basename type contents args} {
        file delete $output
     }
 
+    # Restore additional_sources.
+    set additional_sources "$tmp_additional_sources"
+
     return [list $lines $scan_output]
 }