From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] configure: check for -march and -mtune passed via CC
Date: Tue, 21 Apr 2015 13:38:21 -0400 [thread overview]
Message-ID: <20150421173821.GW6817@brightrain.aerifal.cx> (raw)
In-Reply-To: <1429637645-3353-1-git-send-email-armccurdy@gmail.com>
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 <armccurdy@gmail.com>
> ---
> 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
prev parent reply other threads:[~2015-04-21 17:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 17:34 Andre McCurdy
2015-04-21 17:38 ` Rich Felker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150421173821.GW6817@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).