From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24426 invoked by alias); 5 Jun 2012 00:18:10 -0000 Received: (qmail 24399 invoked by uid 22791); 5 Jun 2012 00:18:08 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_XG X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jun 2012 00:17:56 +0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/53579] New: libstdc++ configure atomicity tests use CXXFLAGS instead of CXXFLAGS_FOR_TARGET Date: Tue, 05 Jun 2012 00:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg00218.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53579 Bug #: 53579 Summary: libstdc++ configure atomicity tests use CXXFLAGS instead of CXXFLAGS_FOR_TARGET Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: olegendo@gcc.gnu.org When trying to fix PR 29366 by removing config/cpu/sh/atomicity.h I've noticed that libstdc++'s configure would refuse to pick up config/cpu/generic/atomicity_builtins. On the SH target atomicity builtins have to be enabled by either -msoft-atomic or -mhard-atomic. For sh-linux -msoft-atomic is enabled by default. When building a cross toolchain (top level make) CFLAGS_FOR_TARGET / CXXFLAGS_FOR_TARGET can be used to enable the atomicity builtins. However, libstdc++ configure uses CXXFLAGS when testing for atomicity builtins availability, so it will default to using config/cpu/generic/atomicity_mutex. I'm not quite sure where the fix should go, either in the top level configure/makefile (which fails to set CXXFLAGS to CXXFLAGS_FOR_TARGET for libstdc++ configure) or libstdc++ itself, because when libstdc++ is actually compiled CXXFLAGS_FOR_TARGET is passed to xgcc as expected.