All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v6 21/31] build: set XEN_BUILD_EFI earlier
Date: Tue, 10 Aug 2021 09:44:16 +0200	[thread overview]
Message-ID: <82429ede-6bbe-ee51-861e-cd8d0c627311@suse.com> (raw)
In-Reply-To: <YRFQ5ufigapRnXgr@perard>

On 09.08.2021 17:59, Anthony PERARD wrote:
> On Thu, Aug 05, 2021 at 09:27:18AM +0200, Jan Beulich wrote:
>> On 01.07.2021 16:10, Anthony PERARD wrote:
>>> We are going to need the variable XEN_BUILD_EFI earlier.
>>>
>>> This early check is using "try-run" to allow to have a temporary
>>> output file in case it is needed for $(CC) to build the *.c file.
>>>
>>> The "efi/check.o" file is still needed in "arch/x86/Makefile" so the
>>> check is currently duplicated.
>>
>> Why is this? Can't you ...
>>
>>> --- a/xen/arch/x86/Makefile
>>> +++ b/xen/arch/x86/Makefile
>>> @@ -126,7 +126,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
>>>  ifneq ($(efi-y),)
>>>  
>>>  # Check if the compiler supports the MS ABI.
>>> -export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
>>> +XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
>>>  CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
>>
>> ... use here what you ...
>>
>>> --- a/xen/arch/x86/arch.mk
>>> +++ b/xen/arch/x86/arch.mk
>>> @@ -60,5 +60,10 @@ ifeq ($(CONFIG_UBSAN),y)
>>>  $(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment)
>>>  endif
>>>  
>>> +ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
>>> +# Check if the compiler supports the MS ABI.
>>> +export XEN_BUILD_EFI := $(call try-run,$(CC) $(CFLAGS) -c arch/x86/efi/check.c -o "$$TMPO",y)
>>> +endif
>>
>> ... export here?
> 
> The problem with the check for EFI support is that there several step,
> with a step depending on the binary produced by the previous one.
> 
> XEN_BUILD_EFI
>     In addition to check "__ms_abi__" attribute is supported by $CC, the
>     file "efi/check.o" is produced.
> XEN_BUILD_PE
>     It is using "efi/check.o" to check for PE support and produce
>     "efi/check.efi".
> "efi/check.efi" is also used by the Makefile for additional checks
> (mkreloc).
> 
> 
> So, if I let the duplicated check for $(XEN_BUILD_EFI) is that it felt
> wrong to produce "efi/check.o" in "arch/x86/arch.mk" and then later use
> it in "arch/x86/Makefile". I could maybe move the command that create
> efi/check.o in the $(XEN_BUILD_PE) check, or I could try to move most of
> the checks done for EFI into x86/arch.mk. Or maybe just creating the
> "efi/check.o" file in x86/arch.mk and use it in x86/Makefile, with a
> comment.
> 
> What do you think?

The last option looks to promise the least code churn while still
eliminating the duplication. So that's one option I'd be fine with, the
other being to do all of this together in a single place.

Jan



  reply	other threads:[~2021-08-10  7:44 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 14:09 [XEN PATCH v6 00/31] xen: Build system improvements Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 01/31] build: fix %.s: %.S rule Anthony PERARD
2021-07-05 14:40   ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 02/31] build: introduce cpp_flags macro Anthony PERARD
2021-07-07 14:18   ` Jan Beulich
2021-07-12 10:53     ` Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 03/31] build: use if_changed on built_in.o Anthony PERARD
2021-07-08 12:03   ` Andrew Cooper
2021-07-12 11:08     ` Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 04/31] build: use if_changed_rules with %.o:%.c targets Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 05/31] build: factorise generation of the linker scripts Anthony PERARD
2021-07-07 14:25   ` Jan Beulich
2021-07-12 11:02     ` Anthony PERARD
2021-07-13  7:28       ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 06/31] x86/mm: avoid building multiple .o from a single .c file Anthony PERARD
2021-07-07 14:45   ` Jan Beulich
2021-07-12 12:49     ` Anthony PERARD
2021-07-13  7:32       ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 07/31] build,include: rework compat-build-source.py Anthony PERARD
2021-07-07 14:58   ` Jan Beulich
2021-07-12 14:35     ` Anthony PERARD
2021-07-13  7:37       ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 08/31] build,include: rework compat-build-header.py Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 09/31] build: clean "lib.a" Anthony PERARD
2021-07-07 15:03   ` Jan Beulich
2021-07-12 14:42     ` Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 10/31] build: use $(kconfig) shortcut in clean rule Anthony PERARD
2021-07-07 15:05   ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 11/31] build: fix clean targets when subdir-y is used Anthony PERARD
2021-07-07 15:15   ` Jan Beulich
2021-07-12 14:54     ` Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 12/31] build: use subdir-y in test/Makefile Anthony PERARD
2021-07-07 15:26   ` Jan Beulich
2021-07-12 15:22     ` Anthony PERARD
2021-07-13  7:41       ` Jan Beulich
2021-07-13 14:35         ` Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 13/31] build,tools: have default rules depends on symbols Anthony PERARD
2021-07-07 15:28   ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 14/31] build,arm: move LDFLAGS change to arch.mk Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 15/31] build: move make option changes check earlier Anthony PERARD
2021-07-07 15:40   ` Jan Beulich
2021-07-12 16:21     ` Anthony PERARD
2021-07-13  7:42       ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 16/31] build: avoid building arm/arm/*/head.o twice Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 17/31] build: convert binfile use to if_changed Anthony PERARD
2021-07-07 15:48   ` Jan Beulich
2021-07-12 16:32     ` Anthony PERARD
2021-07-13  7:51       ` Jan Beulich
2021-07-13 14:58         ` Anthony PERARD
2021-07-13 15:33           ` Jan Beulich
2021-07-01 14:09 ` [XEN PATCH v6 18/31] xen: move include/asm-* to include/arch-*/asm Anthony PERARD
2021-07-01 17:24   ` Paul Durrant
2021-07-01 17:26   ` Bob Eshleman
2021-08-05  7:04   ` Jan Beulich
2021-08-09 13:20     ` Anthony PERARD
2021-07-01 14:09 ` [XEN PATCH v6 19/31] build: rework .banner generation Anthony PERARD
2021-08-05  7:09   ` Jan Beulich
2021-08-09 13:31     ` Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 20/31] build: generate "include/xen/compile.h" with filechk Anthony PERARD
2021-08-05  7:20   ` Jan Beulich
2021-08-09 14:27     ` Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 21/31] build: set XEN_BUILD_EFI earlier Anthony PERARD
2021-08-05  7:27   ` Jan Beulich
2021-08-09 15:59     ` Anthony PERARD
2021-08-10  7:44       ` Jan Beulich [this message]
2021-07-01 14:10 ` [XEN PATCH v6 22/31] build: fix $(TARGET).efi creation in arch/arm Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 23/31] build: fix arch/x86/node.o rule Anthony PERARD
2021-07-07 16:04   ` Jan Beulich
2021-07-01 14:10 ` [XEN PATCH v6 24/31] build: set ALL_OBJS to main Makefile; move prelink.o to main Makefile Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 25/31] build: remove unneeded deps of x86_emulate.o Anthony PERARD
2021-08-06 16:06   ` Jan Beulich
2021-08-09 16:02     ` Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 26/31] build: clean common temporary files from root makefile Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 27/31] build: prepare to always invoke $(MAKE) from xen/, use $(obj) Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 28/31] build: rework test/livepatch/Makefile Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 29/31] build: build everything from the root dir, use obj=$subdir Anthony PERARD
2021-07-01 17:49   ` Bob Eshleman
2021-07-01 14:10 ` [XEN PATCH v6 30/31] build: introduce if_changed_deps Anthony PERARD
2021-07-01 14:10 ` [XEN PATCH v6 31/31] build,riscv: tell the build system about riscv64/head.S Anthony PERARD
2021-07-01 17:52   ` Bob Eshleman
2021-07-02  4:45   ` Alistair Francis
2021-07-10  0:50   ` Connor Davis

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=82429ede-6bbe-ee51-861e-cd8d0c627311@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --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.