From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7463 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] configure: check for -march and -mtune passed via CC Date: Tue, 21 Apr 2015 13:38:21 -0400 Message-ID: <20150421173821.GW6817@brightrain.aerifal.cx> References: <1429637645-3353-1-git-send-email-armccurdy@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1429637920 26771 80.91.229.3 (21 Apr 2015 17:38:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2015 17:38:40 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7476-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 21 19:38:37 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 1Ykc84-0000XP-H8 for gllmg-musl@m.gmane.org; Tue, 21 Apr 2015 19:38:36 +0200 Original-Received: (qmail 7693 invoked by uid 550); 21 Apr 2015 17:38:34 -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 7671 invoked from network); 21 Apr 2015 17:38:33 -0000 Content-Disposition: inline In-Reply-To: <1429637645-3353-1-git-send-email-armccurdy@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7463 Archived-At: On Tue, Apr 21, 2015 at 10:34:05AM -0700, Andre McCurdy wrote: > 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 It's questionable whether we should have this code to begin with, but as long as we do, I agree the change you proposed is correct. I'll apply it. Thanks! Rich