From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"Anthony PERARD" <anthony.perard@citrix.com>
Subject: [PATCH 3/3] x86/build: Clean up boot/Makefile
Date: Thu, 14 Apr 2022 12:47:08 +0100 [thread overview]
Message-ID: <20220414114708.4788-4-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20220414114708.4788-1-andrew.cooper3@citrix.com>
There are no .S intermediate files, so rework in terms of head-bin-objs.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Anthony PERARD <anthony.perard@citrix.com>
I'm slightly -1 on this, because
head-bin-objs := $(addprefix $(obj)/,$(head-bin-objs))
is substantial obfuscation which I'd prefer to bin.
Anthony: Why does dropping the targets += line interfere with incremental
builds? With it gone, *.bin are regenerated unconditionally, but I can't see
what would cause that, nor why the normal dependencies on head.o don't work.
---
xen/arch/x86/boot/Makefile | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 294ac2418583..527f3e393037 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,16 +1,17 @@
obj-bin-y += head.o
-head-srcs := cmdline.S reloc.S
-nocov-y += $(head-srcs:.S=.o)
-noubsan-y += $(head-srcs:.S=.o)
-targets += $(head-srcs:.S=.o)
+head-bin-objs := cmdline.o reloc.o
-head-srcs := $(addprefix $(obj)/, $(head-srcs))
+nocov-y += $(head-bin-objs)
+noubsan-y += $(head-bin-objs)
+targets += $(head-bin-objs)
+
+head-bin-objs := $(addprefix $(obj)/,$(head-bin-objs))
# For .incbin - add $(obj) to the include path and add the dependencies
# manually as they're not included in .d
$(obj)/head.o: AFLAGS-y += -Wa$(comma)-I$(obj)
-$(obj)/head.o: $(head-srcs:.S=.bin)
+$(obj)/head.o: $(head-bin-objs:.o=.bin)
CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS))
$(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS))
@@ -18,8 +19,8 @@ CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float
CFLAGS_x86_32 += -I$(srctree)/include
# override for 32bit binaries
-$(head-srcs:.S=.o): CFLAGS_stack_boundary :=
-$(head-srcs:.S=.o): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
+$(head-bin-objs): CFLAGS_stack_boundary :=
+$(head-bin-objs): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
%.bin: %.lnk
$(OBJCOPY) -j .text -O binary $< $@
@@ -27,4 +28,4 @@ $(head-srcs:.S=.o): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
%.lnk: %.o $(src)/build32.lds
$(LD) $(subst x86_64,i386,$(LDFLAGS_DIRECT)) -N -T $(filter %.lds,$^) -o $@ $<
-clean-files := cmdline.S reloc.S *.lnk *.bin
+clean-files := *.lnk *.bin
--
2.11.0
next prev parent reply other threads:[~2022-04-14 11:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 11:47 [PATCH 0/3] x86/build: Clean up 32bit boot objects Andrew Cooper
2022-04-14 11:47 ` [PATCH 1/3] x86/build: Rework binary conversion for boot/{cmdline,reloc}.c Andrew Cooper
2022-04-20 10:15 ` Jan Beulich
2022-04-14 11:47 ` [PATCH 2/3] x86/build: Don't convert boot/{cmdline,head}.bin back to .S Andrew Cooper
2022-04-14 16:27 ` [PATCH v1.1 " Andrew Cooper
2022-04-14 17:28 ` Anthony PERARD
2022-04-20 12:11 ` Jan Beulich
2022-04-20 12:47 ` Andrew Cooper
2022-08-12 12:55 ` [PATCH v2 " Andrew Cooper
2022-08-12 13:26 ` Jan Beulich
2022-04-14 11:47 ` Andrew Cooper [this message]
2022-04-14 17:45 ` [PATCH 3/3] x86/build: Clean up boot/Makefile Anthony PERARD
2022-04-14 19:27 ` Andrew Cooper
2022-04-20 12:07 ` Jan Beulich
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=20220414114708.4788-4-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=anthony.perard@citrix.com \
--cc=roger.pau@citrix.com \
--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.