From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: "Frediano Ziglio" <frediano.ziglio@cloud.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v4 1/6] x86/boot: Prep work for 32bit object changes
Date: Mon, 14 Oct 2024 09:53:27 +0100 [thread overview]
Message-ID: <20241014085332.3254546-2-frediano.ziglio@cloud.com> (raw)
In-Reply-To: <20241014085332.3254546-1-frediano.ziglio@cloud.com>
Broken out of the subsequent patch for clarity.
* Rename head-bin-objs to obj32
* Use a .32.o suffix to distinguish these objects
* Factor out $(LD32)
No functional change.
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
xen/arch/x86/boot/Makefile | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index ff0f965876..1199291d2b 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,15 +1,16 @@
obj-bin-y += head.o
-head-bin-objs := cmdline.o reloc.o
+obj32 := cmdline.32.o
+obj32 += reloc.32.o
-nocov-y += $(head-bin-objs)
-noubsan-y += $(head-bin-objs)
-targets += $(head-bin-objs)
+nocov-y += $(obj32)
+noubsan-y += $(obj32)
+targets += $(obj32)
-head-bin-objs := $(addprefix $(obj)/,$(head-bin-objs))
+obj32 := $(addprefix $(obj)/,$(obj32))
$(obj)/head.o: AFLAGS-y += -Wa$(comma)-I$(obj)
-$(obj)/head.o: $(head-bin-objs:.o=.bin)
+$(obj)/head.o: $(obj32:.32.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,16 +19,20 @@ CFLAGS_x86_32 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS
CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__
# override for 32bit binaries
-$(head-bin-objs): CFLAGS_stack_boundary :=
-$(head-bin-objs): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
+$(obj32): CFLAGS_stack_boundary :=
+$(obj32): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
+
+$(obj)/%.32.o: $(src)/%.c FORCE
+ $(call if_changed_rule,cc_o_c)
LDFLAGS_DIRECT-$(call ld-option,--warn-rwx-segments) := --no-warn-rwx-segments
LDFLAGS_DIRECT += $(LDFLAGS_DIRECT-y)
+LD32 := $(LD) $(subst x86_64,i386,$(LDFLAGS_DIRECT))
%.bin: %.lnk
$(OBJCOPY) -j .text -O binary $< $@
-%.lnk: %.o $(src)/build32.lds
- $(LD) $(subst x86_64,i386,$(LDFLAGS_DIRECT)) -N -T $(filter %.lds,$^) -o $@ $<
+%.lnk: %.32.o $(src)/build32.lds
+ $(LD32) -N -T $(filter %.lds,$^) -o $@ $<
clean-files := *.lnk *.bin
--
2.34.1
next prev parent reply other threads:[~2024-10-14 8:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 8:53 [PATCH v4 0/6] Reuse 32 bit C code more safely Frediano Ziglio
2024-10-14 8:53 ` Frediano Ziglio [this message]
2024-10-15 6:44 ` [PATCH v4 1/6] x86/boot: Prep work for 32bit object changes Jan Beulich
2024-10-14 8:53 ` [PATCH v4 2/6] x86/boot: create a C bundle for 32 bit boot code and use it Frediano Ziglio
2024-10-14 15:31 ` Anthony PERARD
2024-10-14 15:46 ` Jan Beulich
2024-10-14 15:52 ` Andrew Cooper
2024-10-14 16:32 ` Frediano Ziglio
2024-10-15 5:59 ` Jan Beulich
2024-10-15 13:51 ` Anthony PERARD
2024-10-16 8:33 ` Frediano Ziglio
2024-10-16 11:25 ` Anthony PERARD
2024-10-16 15:05 ` Frediano Ziglio
2024-10-17 10:58 ` Frediano Ziglio
2024-10-17 11:01 ` Andrew Cooper
2024-10-17 12:36 ` Anthony PERARD
2024-10-15 13:54 ` Andrew Cooper
2024-10-14 8:53 ` [PATCH v4 3/6] x86/boot: Reuse code to relocate trampoline Frediano Ziglio
2024-10-15 15:03 ` Anthony PERARD
2024-10-14 8:53 ` [PATCH v4 4/6] x86/boot: Use boot_vid_info variable directly from C code Frediano Ziglio
2024-10-14 8:53 ` [PATCH v4 5/6] x86/boot: Use trampoline_phys " Frediano Ziglio
2024-10-14 8:53 ` [PATCH v4 6/6] x86/boot: Clarify comment Frediano Ziglio
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=20241014085332.3254546-2-frediano.ziglio@cloud.com \
--to=frediano.ziglio@cloud.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--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.