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

[XEN PATCH v7 02/51] build: use if_changed on built_in.o

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 24 Aug 2021 11:49:49 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 24 Aug 2021 10:50:55 +0000
  • Ironport-hdrordr: A9a23:Z1PDxKljkOmbwsZwz9jBIhV7QIbpDfIU3DAbv31ZSRFFG/Fxl6 iV8sjzsiWE7gr5OUtQ4exoV5PhfZqxz/JICMwqTNKftWrdyQyVxeNZnOjfKlTbckWUnINgPO VbAsxD4bXLfCFHZK3BgTVQfexO/DD+ytHLudvj
  • Ironport-sdr: yEjU0FBp9IJ/pt/cWd7MOMiQs/gaeXC7LKezZ8lzU2l8qghCsDt5kQMzl/yzQ+tnwFI6gz6Z9Z C19xRsa/J4k9/5wLWLWdmtnPiGkIsm9nHYGCMg6QbQuJZ0sxaNY4pFcQ4vC1wl5HTSoZzA+Eqf xzfaSBlMO8XLFCOKMn50hqb0NyZsTAUv++0dkgHLC2pcXHB1/zFiHySIwCLqjHjzZrB08kUZ7h RqZfvlPP7WDiP/bjUOXX1uwD40OMEl2Fi/xviKUuvVnBIKOwNToMQ9dM5yihL4vDF6Le8HeEwG uNh6lv5gLxDItdVITJDavX5U
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In the case where $(obj-y) is empty, we also replace $(c_flags) by
$(XEN_CFLAGS) to avoid generating an .%.d dependency file. This avoid
make trying to include %.h file in the ld command if $(obj-y) isn't
empty anymore on a second run.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

    - Display "CC" for cmd_cc_builtin instead of "LD".
    - use $(if $(strip $(obj-y)),ld_builtin,cc_builtin)
      as suggested
    - rebased
    - Have cmd_ld_builtin depends on CONFIG_LTO, which simplify built_in.o

 xen/Rules.mk | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index c99c4a9475c9..5a6a5d63260f 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -147,17 +147,22 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
 c_flags += $(CFLAGS-y)
 a_flags += $(CFLAGS-y) $(AFLAGS-y)
-built_in.o: $(obj-y) $(if $(strip $(lib-y)),lib.a) $(extra-y)
-ifeq ($(strip $(obj-y)),)
-       $(CC) $(c_flags) -c -x c /dev/null -o $@
+quiet_cmd_cc_builtin = CC      $@
+cmd_cc_builtin = \
+    $(CC) $(XEN_CFLAGS) -c -x c /dev/null -o $@
+quiet_cmd_ld_builtin = LD      $@
 ifeq ($(CONFIG_LTO),y)
-       $(LD_LTO) -r -o $@ $(filter $(obj-y),$^)
+cmd_ld_builtin = \
+    $(LD_LTO) -r -o $@ $(filter $(obj-y),$(real-prereqs))
-       $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter $(obj-y),$^)
+cmd_ld_builtin = \
+    $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter $(obj-y),$(real-prereqs))
+built_in.o: $(obj-y) $(if $(strip $(lib-y)),lib.a) $(extra-y) FORCE
+       $(call if_changed,$(if $(strip $(obj-y)),ld_builtin,cc_builtin))
 lib.a: $(lib-y) FORCE
        $(call if_changed,ar)
Anthony PERARD



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