All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>
Subject: Re: [PATCH 0.5/3] build: make cc-option properly deal with unrecognized sub-options
Date: Tue, 18 Jul 2023 16:09:19 +0200	[thread overview]
Message-ID: <7ba24ac4-1f20-906c-8e38-6a8b040af35a@suse.com> (raw)
In-Reply-To: <fe4c01c0-91cd-a303-71e9-96a81e46ddff@suse.com>

On 12.07.2023 16:26, Jan Beulich wrote:
> --- a/Config.mk
> +++ b/Config.mk
> @@ -90,9 +90,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
>  # of which would indicate an "unrecognized command-line option" warning/error.
>  #
>  # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
> -cc-option = $(shell if test -z "`echo 'void*p=1;' | \
> -              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
> -              then echo "$(2)"; else echo "$(3)"; fi ;)
> +cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
> +                    opt="$${pat%%=*}" arg="$${pat\#*=}"; \
> +                    if test -z "`echo 'void*p=1;' | \
> +                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
> +                                 grep -e "$$pat" -e "$$arg.*$$opt" -e "$$opt.*$$arg" -`"; \

Sigh. At least some versions of Clang (I'm looking at 7.0.1 right now)
don't quote "-march" in their resulting error message. So I guess all
we can do (without finding a different approach to the checking
altogether) is further relax the grep pattern, to

grep -e "$$pat" -e "$$opt" -e "$$arg" -

Of course this has the increasing risk of getting false positives (i.e.
false negatives for the overall check result).

Jan


      reply	other threads:[~2023-07-18 14:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 12:32 [PATCH 0/3] x86: allow Kconfig control over psABI level Jan Beulich
2023-07-12 12:33 ` [PATCH 1/3] " Jan Beulich
2023-07-12 13:01   ` Jan Beulich
2023-07-17 12:23   ` Jason Andryuk
2023-07-17 13:35     ` Jan Beulich
2023-07-18  6:08   ` Jan Beulich
2023-07-12 12:34 ` [PATCH 2/3] x86: use POPCNT for hweight<N>() when available Jan Beulich
2023-07-17 12:30   ` Jason Andryuk
2023-07-12 12:35 ` [PATCH 3/3] x86: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect Jan Beulich
2023-07-17 12:35   ` Jason Andryuk
2023-07-17 13:38     ` Jan Beulich
2023-07-12 14:25 ` [PATCH 0.5/3] build: make cc-option properly deal with unrecognized sub-options Jan Beulich
2023-07-12 14:26 ` Jan Beulich
2023-07-18 14:09   ` Jan Beulich [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=7ba24ac4-1f20-906c-8e38-6a8b040af35a@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.