From: Maxim Kuvyrkov Date: Thu, 19 Feb 2015 08:52:16 +0000 (+0000) Subject: backport: target-supports.exp (check_compile): Save/restore additional_sources that... X-Git-Tag: releases/gcc-4.9.3~346 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab481517fee40d1876424d608920ae468ca24d5a;p=thirdparty%2Fgcc.git backport: target-supports.exp (check_compile): Save/restore additional_sources that may belong to an actual test. Backport from mainline: Fix testsuite race on additional_sources 2015-02-19 Maxim Kuvyrkov * lib/target-supports.exp (check_compile): Save/restore additional_sources that may belong to an actual test. From-SVN: r220809 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6f2c85d0e06e..bcf5fdaa9aa2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-02-19 Maxim Kuvyrkov + + Backport from mainline + 2015-02-19 Maxim Kuvyrkov + + * lib/target-supports.exp (check_compile): Save/restore + additional_sources that may belong to an actual test. + 2015-02-17 Sandra Loosemore Backported from mainline diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 52ec684fb6d0..819f4900171d 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -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] }