From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7462 Path: news.gmane.org!not-for-mail From: Andre McCurdy Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] configure: check for -march and -mtune passed via CC Date: Tue, 21 Apr 2015 10:34:05 -0700 Message-ID: <1429637645-3353-1-git-send-email-armccurdy@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1429637681 22815 80.91.229.3 (21 Apr 2015 17:34:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2015 17:34:41 +0000 (UTC) Cc: Andre McCurdy To: musl@lists.openwall.com Original-X-From: musl-return-7475-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 21 19:34:41 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Ykc4G-000656-Al for gllmg-musl@m.gmane.org; Tue, 21 Apr 2015 19:34:40 +0200 Original-Received: (qmail 28301 invoked by uid 550); 21 Apr 2015 17:34:38 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 28257 invoked from network); 21 Apr 2015 17:34:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PYAdb8qyk2HyQCSbp6P+CdEIYpbtEG3HOE7psLrvR8k=; b=ISo6V+fcE03/mW6QS63Sk68LCG/z4ljP9+jM48rQ5b2SDQgkyY1gnTQgK0R+w1NhLB Rse6UJv2woLP6ZWXqxXgMRfYpS0znTzy6ZbqQqem84WZ9wArVw6RL16lgU5eznbBxSwK j1/lSEpgBy/IhA3P97CsNrsHGp7Fizi9eZjSDvDzj7co83WGApBB5UpjK91PmwHjRSho BnQP1FduMRxVhcR6pW23MDcsCEzT7JKF0HtXKPubib+jsBUkfWJts1GBnGqX8X/zJmtg aR/lP7mUuoTOhjlx+K52gU127wOL786ofPzRtJNUSJ2Jny6VmNgusFpnCZ0kUCVsWFy4 J7DQ== X-Received: by 10.50.108.115 with SMTP id hj19mr29887633igb.34.1429637663472; Tue, 21 Apr 2015 10:34:23 -0700 (PDT) X-Mailer: git-send-email 1.9.1 Xref: news.gmane.org gmane.linux.lib.musl.general:7462 Archived-At: Some build environments pass -march and -mtune as part of CC, therefore update configure to check both CC and CFLAGS before making the decision to fall back to generic -march and -mtune options for x86. Signed-off-by: Andre McCurdy --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e35c9b6..f325cda 100755 --- a/configure +++ b/configure @@ -391,10 +391,12 @@ tryflag CFLAGS_AUTO -Wa,--noexecstack # extensions enabled by default. This is bad for making static binaries. # We cheat and use i486 rather than i386 because i386 really does not # work anyway (issues with atomic ops). +# Some build environments pass -march and -mtune options via CC, so +# check both CC and CFLAGS. # if test "$ARCH" = "i386" ; then -fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -march=i486 -fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic +fnmatch '-march=*|*\ -march=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -march=i486 +fnmatch '-mtune=*|*\ -mtune=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic fi # -- 1.9.1