From patchwork Mon Oct 28 22:29:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cesar Philippidis X-Patchwork-Id: 286687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B2E42C00E2 for ; Tue, 29 Oct 2013 09:30:09 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=aAh168N6bwbktgj9u91sKvkuo8BamSKw6rPHv69POxkddB bw5zTqOmDqsoU4dWOJ4vgUsS6PfZErLl/1TFzu2REpA7m/ZWSzrAYhJ42jxl0DSw rEBbccrCRa1bO6fcaiN36Kd4C6aJIJdfboA2eLw+tJa3CSXPUCshb7Z2u1X9A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=FzHIuKUjyXeo1zrdrZZfeA3dIYM=; b=yUTRyTGBr8vfSeTWAUpE 0w/EjyJFsZpz/u5DYwN8qXVSVHqfJyEFpV8sk9RdYey5mWsSVo+aNToxd8NKa46d 1Um8QnLwDAHfS7HwYXSV7DBmT0EcwTrijzWJ3CA6W2ctzk6F2FGiy+Tw9x1gwS27 /n7VIsQSDyhdFru9MMOYdg0= Received: (qmail 21368 invoked by alias); 28 Oct 2013 22:30:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 21318 invoked by uid 89); 28 Oct 2013 22:30:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Oct 2013 22:30:00 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VavJs-0003fp-8J from Cesar_Philippidis@mentor.com ; Mon, 28 Oct 2013 15:29:56 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 28 Oct 2013 15:29:56 -0700 Received: from imac24.philippidis.net (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Mon, 28 Oct 2013 15:29:55 -0700 Message-ID: <526EE563.9090902@codesourcery.com> Date: Mon, 28 Oct 2013 15:29:55 -0700 From: Cesar Philippidis User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: , Mike Stump , "gcc-patches@gcc.gnu.org" Subject: [PATCH] libstdc++ testsuite cxxflags This patch addresses two issues with the libstdc++ testsuite: * duplicate "-g -O2" CXXFLAGS * missing "-g -O2" for remote targets The duplicate "-g -O2" flags is a result of testsuite_flags.in using build-time CXXFLAGS and proc libstdc++_init using the environmental CXXFLAGS, which defaults to its build-time value. This patch prevents testsuite_flags.in from using build-time CXXFLAGS. Certain remote targets require a minimum optimization level -O1 in order to pass several atomics built-in function tests. This patch ensures cxxflags contains "-g -O2" at minimum when no other optimization flags are specified. The testsuite used to set those flags prior to Benjamin's patch to remove duplicate cxxflags here . Is this OK for trunk? If so, please apply. Thanks, Cesar 2013-10-28 Cesar Philippidis libstdc++-v3/ * scripts/testsuite_flags.in (cxxflags): Don't use build-time CXXFLAGS and EXTRA_CXX_FLAGS. * testsuite/lib/libstdc++.exp (libstdc++_init): Ensure, at minimum, cxxflags contains "-g -O2". diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in index d7710ca..35b36e7 100755 --- a/libstdc++-v3/scripts/testsuite_flags.in +++ b/libstdc++-v3/scripts/testsuite_flags.in @@ -55,7 +55,7 @@ case ${query} in ;; --cxxflags) CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0" - CXXFLAGS_config="@SECTION_FLAGS@ @CXXFLAGS@ @EXTRA_CXX_FLAGS@" + CXXFLAGS_config="@SECTION_FLAGS@" echo ${CXXFLAGS_default} ${CXXFLAGS_config} ;; --cxxparallelflags) diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 51ff6dd..68dcb15 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -265,6 +265,15 @@ proc libstdc++_init { testfile } { } append cxxflags " " append cxxflags [getenv CXXFLAGS] + + if {$cxxflags == "-D_GLIBCXX_ASSERT -fmessage-length=0 "} { + append cxxflags "-g" + } + + if ![regexp "\-O" $cxxflags] { + append cxxflags " -O2" + } + v3track cxxflags 2 # Always use MO files built by this test harness.