[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0.5/3] build: make cc-option properly deal with unrecognized sub-options
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 18 Jul 2023 16:09:19 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N4hh92Sg4gGQ0/L6cznxSDdrRp6l1w8e9FyzrkBObjY=; b=W3BTrIyko4tYQ+IPXDVsnmFvno56jA4cJhd49NpZIRoIkMih73hhyA0sEt4IWJyEncYQ9IMdiPqOq5gbAGA1rVl/mRVR3HOZleyvkedFsvdXyjODONR1PVBkM+V03qtnNYSRPCkUCuUosZNRJe3bX87q67f3JZ7/J1HiFjfRB6MkJQ2mx9WbTSt+7mc4obLFB0b3PVwQQG3S2jv7xZ3XAYb+DEcbioIp5oWek1roQI6ihGLPkjdr9EH+G3Dxn5nYFFYH3+otO7lho3j2T2x/R3P/zcAuCszB3/74U9nvEPLEkT4T9+Byg7CrivwtG32rm7L/Ms6hhL79NsMIsg9chw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dNQITBep78S0M7QdZBQcg0qaGGLpuz7cqGKYPHuRZ4qb8tlClGToygNn2P72E/R3WithAsdJ7UfawU3YSNgCTLRINTmLYTXY7WAHeqVjix9vr9r/hNfGdXkiSe9X6tn1IHD2iVqmLdx9iFc003v/4WVB2gzxjUlcWeE39YoAeU/WoBpqRdikWb3b9Bs+VmpoO8XSXtjJbzZXqAQ0cHix1ZRBJuXd+IxqxImpKsu6omQhjNKybaXEJlbvSIOf7sXH+TW81WUU+pDACxaVmvJMeF0j7KAOfsB3a3cu+LSzSkTPvt3ewJvyMnZWRNovTMr+M0d2+g7bilmG/Xuz1HmpSA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Tue, 18 Jul 2023 14:09:33 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|