diff mbox series

[XEN,v7,40/51] build: fix dependencies in arch/x86/boot

Message ID 20210824105038.1257926-41-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen: Build system improvements, now with out-of-tree build! | expand

Commit Message

Anthony PERARD Aug. 24, 2021, 10:50 a.m. UTC
Temporary fix the list of headers that cmdline.c and reloc.c depends
on, until the next time the list is out of sync again.

Also, add the linker script to the list.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/arch/x86/boot/Makefile   | 9 ++++++---
 xen/arch/x86/boot/build32.mk | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Jan Beulich Oct. 14, 2021, 8:08 a.m. UTC | #1
On 24.08.2021 12:50, Anthony PERARD wrote:
> Temporary fix the list of headers that cmdline.c and reloc.c depends
> on, until the next time the list is out of sync again.
> 
> Also, add the linker script to the list.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Afaict this is independent of all earlier patches, so I'll make an
attempt at committing this soon.

> --- a/xen/arch/x86/boot/Makefile
> +++ b/xen/arch/x86/boot/Makefile
> @@ -2,19 +2,22 @@ obj-bin-y += head.o
>  
>  DEFS_H_DEPS = $(BASEDIR)/$(src)/defs.h $(BASEDIR)/include/xen/stdbool.h
>  
> -CMDLINE_DEPS = $(DEFS_H_DEPS) $(BASEDIR)/$(src)/video.h
> +CMDLINE_DEPS = $(DEFS_H_DEPS) $(BASEDIR)/$(src)/video.h \
> +	       $(BASEDIR)/include/xen/kconfig.h \
> +	       $(BASEDIR)/include/generated/autoconf.h

Especially with this now needed in two places, I think down the road
(unless we'll get dependency tracking automated here, which a part of
your description suggests is not going to happen soon) we want

kconfig.h := $(BASEDIR)/include/xen/kconfig.h \
             $(BASEDIR)/include/generated/autoconf.h

and then similarly ...

>  RELOC_DEPS = $(DEFS_H_DEPS) \
>  	     $(BASEDIR)/include/generated/autoconf.h \
>  	     $(BASEDIR)/include/xen/kconfig.h \
>  	     $(BASEDIR)/include/xen/multiboot.h \
>  	     $(BASEDIR)/include/xen/multiboot2.h \
> +	     $(BASEDIR)/include/xen/const.h \

multiboot.h := $(BASEDIR)/include/xen/multiboot.h \
               $(BASEDIR)/include/xen/const.h \

(and by implication I think DEFS_H_DEPS would better be renamed to
deps.h as well).

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 2469ca7c4530..73a3b1514965 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -2,19 +2,22 @@  obj-bin-y += head.o
 
 DEFS_H_DEPS = $(BASEDIR)/$(src)/defs.h $(BASEDIR)/include/xen/stdbool.h
 
-CMDLINE_DEPS = $(DEFS_H_DEPS) $(BASEDIR)/$(src)/video.h
+CMDLINE_DEPS = $(DEFS_H_DEPS) $(BASEDIR)/$(src)/video.h \
+	       $(BASEDIR)/include/xen/kconfig.h \
+	       $(BASEDIR)/include/generated/autoconf.h
 
 RELOC_DEPS = $(DEFS_H_DEPS) \
 	     $(BASEDIR)/include/generated/autoconf.h \
 	     $(BASEDIR)/include/xen/kconfig.h \
 	     $(BASEDIR)/include/xen/multiboot.h \
 	     $(BASEDIR)/include/xen/multiboot2.h \
+	     $(BASEDIR)/include/xen/const.h \
 	     $(BASEDIR)/include/public/arch-x86/hvm/start_info.h
 
 $(obj)/head.o: $(obj)/cmdline.S $(obj)/reloc.S
 
-$(obj)/cmdline.S: $(src)/cmdline.c $(CMDLINE_DEPS)
+$(obj)/cmdline.S: $(src)/cmdline.c $(CMDLINE_DEPS) $(src)/build32.lds
 	$(MAKE) -f $(BASEDIR)/$(src)/build32.mk -C $(obj) $(@F) CMDLINE_DEPS="$(CMDLINE_DEPS)"
 
-$(obj)/reloc.S: $(src)/reloc.c $(RELOC_DEPS)
+$(obj)/reloc.S: $(src)/reloc.c $(RELOC_DEPS) $(src)/build32.lds
 	$(MAKE) -f $(BASEDIR)/$(src)/build32.mk -C $(obj) $(@F) RELOC_DEPS="$(RELOC_DEPS)"
diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index 8cd5403926a3..e90680cd9f52 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -27,7 +27,7 @@  CFLAGS := $(filter-out -flto,$(CFLAGS))
 		done
 	$(OBJCOPY) -O binary -R .got.plt $< $@
 
-%.lnk: %.o
+%.lnk: %.o build32.lds
 	$(LD) $(LDFLAGS_DIRECT) -N -T build32.lds -o $@ $<
 
 %.o: %.c