[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v9 03/30] build: fix exported variable name CFLAGS_stack_boundary


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Jan 2022 09:57:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=Eds8dzQvZSCAzcG+Kw3lWrYgRNpaKYIupvYj0hoW7XQ=; b=cjJ9Ym/Ay9iEYWCoWBAxf2WQyJ69VLlV//HRhXPkeU22gKg5W+h45h4fpX3uIHPzM8E1Xf5W6YuUP/JrB5Rb6GJjbKDUxttKOrpZ1DM8WdBMpAbMdQopaKOE/FX4LH5THc4wrmJwC+1is1PNSd+3QhnXtp6iNeL4aAb/EA2QEbT4f4k8OO9v/xTfpBukS79l6xBwrYJsGnZBKrjwBKTSuO2lxNyXdROChauj4OWOn71MUMimIBSk+oJZSmox1RWpFIOsLA7NacrY0Eq3ikGFwJLKp34pJ+fJp/Q5t5hEQg03/iLHB+remu7PwhEGWH4B0LBeDh50gf+VWqpBu7wAFg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJqI8V7bD4B9QGnYaYahpRmtsAQv2DPTYLqbvywyrOvzaxlYQlFsrDROYc73xTb1m+HG6hdd+QTJI4cjZOusWLNB0cB+r74y78pOXiyNP4IOgzux2BL/8UYI2tcR/lZ7u7dwLlZMTY5Qg4b9oNLrvxcqhcd4qUhUGMRqwGKfLnM+ZHAesmnmj/1mNzsiOw7TN4Hj65skrisSqt+NtVtzceV63pZpAYjHdcZ7zaM+ujITkRL6DLVTtomeGr3m7VPpTLQE3xo7uGeLuHyIG2KavwGib2zNaHo2wPh7+MVFYRaMqx0AlP81t1zTCiX1eogA9uRs+2ZrrMcQegIsGrlqhg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 31 Jan 2022 08:57:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.01.2022 16:04, Anthony PERARD wrote:
> On Fri, Jan 28, 2022 at 12:14:58PM +0100, Jan Beulich wrote:
>> On 25.01.2022 12:00, Anthony PERARD wrote:
>>> Exporting a variable with a dash doesn't work reliably, they may be
>>> striped from the environment when calling a sub-make or sub-shell.
>>>
>>> CFLAGS-stack-boundary start to be removed from env in patch "build:
>>> set ALL_OBJS in main Makefile; move prelink.o to main Makefile" when
>>> running `make "ALL_OBJS=.."` due to the addition of the quote. At
>>> least in my empirical tests.
>>>
>>> Fixes: 2740d96efd ("xen/build: have the root Makefile generates the CFLAGS")
>>> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>>
>> While I did commit this, I'm still somewhat confused. How would quoting
>> of elements on a make command line make a difference to which variables
>> get exported?
> 
> I don't know, maybe without quote, make run sub-make directly, but with
> double-quote, a shell is used.
> 
> But after reading the manual, I didn't expect the variable to be passed
> down sub-make at all:
> 
>     5.7.2 Communicating Variables to a Sub-make
> 
>     Except by explicit request, make exports a variable only if it is
>     either defined in the environment initially or set on the command
>     line, and if its name consists only of letters, numbers, and
>     underscores.
> 
> But somehow, sub-makes also export the non-shell-exportable variables,
> unless the command line in a recipe invoking make has double-quotes.
> 
> 
> I've tried again, and checked the process list:
>   - when running `$(MAKE) -C foo`; make just execute make
>   - when running `$(MAKE) -C 'foo'`; make just execute make
>   - when running `$(MAKE) -C "foo"`; make execute /bin/sh -c ...
>   - when running `$(MAKE) -C foo | tee`; make execute /bin/sh -c ...
> 
> So, CFLAGS-stack-boundary disappear when /bin/sh is involved.

Very "interesting" behavior.

>> In any event I understand the description that prior to the subsequent
>> change there's not actually any issue. Hence I'm not going to queue
>> this for backporting despite the Fixes: tag. Unless of course I'm told
>> otherwise (with justification).
> 
> Justification would be that it's not supposed to work, based on
> information from make's manual.

Okay, I'll queue it then, but in case it doesn't backport
straightforwardly I'll still consider leaving it out.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.