Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47651 )
Change subject: libpayload: Move .xcompile into $(obj) ......................................................................
libpayload: Move .xcompile into $(obj)
And drop the `.`.
Having `.xcompile` in a central place led to race conditions when multiple payloads try to build their own libpayloads in parallel.
Change-Id: I504e1862db79b368289867f7568c9169f27a1549 Signed-off-by: Nico Huber nico.h@gmx.de --- M payloads/libpayload/Makefile M payloads/libpayload/Makefile.inc M payloads/libpayload/sample/Makefile 3 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/47651/1
diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile index b5687c3..d2614fa 100644 --- a/payloads/libpayload/Makefile +++ b/payloads/libpayload/Makefile @@ -126,13 +126,13 @@
# in addition to the dependency below, create the file if it doesn't exist # to silence stupid warnings about a file that would be generated anyway. -$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell $(top)/../../util/xcompile/xcompile $(XGCCPATH) > .xcompile))) +$(if $(wildcard $(obj)/xcompile)$(NOCOMPILE),,$(eval $(shell mkdir -p $(obj) && $(top)/../../util/xcompile/xcompile $(XGCCPATH) > $(obj)/xcompile)))
-.xcompile: $(top)/../../util/xcompile/xcompile +$(obj)/xcompile: $(top)/../../util/xcompile/xcompile $< $(XGCCPATH) > $@.tmp \mv -f $@.tmp $@ 2> /dev/null
--include .xcompile +-include $(obj)/xcompile
CC := $(CC_$(ARCH-y)) AS := $(AS_$(ARCH-y)) @@ -294,7 +294,7 @@ rm -rf $(DOXYGEN_OUTPUT_DIR)
clean-for-update: doxygen-clean clean-for-update-target - rm -f $(allobjs) .xcompile + rm -f $(allobjs) $(obj)/xcompile rm -f $(DEPENDENCIES) rmdir -p $(alldirs) 2>/dev/null >/dev/null || true
@@ -306,6 +306,6 @@ rm -f cscope.out
distclean: clean-cscope clean - rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile junit.xml + rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap junit.xml
.PHONY: $(PHONY) clean clean-cscope cscope distclean doxygen doxy diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc index 6188dde..a954d74 100644 --- a/payloads/libpayload/Makefile.inc +++ b/payloads/libpayload/Makefile.inc @@ -121,7 +121,7 @@ install -m 755 bin/lpas $(DESTDIR)/libpayload/bin install -m 644 bin/lp.functions $(DESTDIR)/libpayload/bin install -m 644 $(DOTCONFIG) $(DESTDIR)/libpayload/libpayload.config - install -m 755 .xcompile $(DESTDIR)/libpayload/libpayload.xcompile + install -m 755 $(obj)/xcompile $(DESTDIR)/libpayload/libpayload.xcompile
clean-for-update-target: rm -f $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile index eb70af9..637e45d 100644 --- a/payloads/libpayload/sample/Makefile +++ b/payloads/libpayload/sample/Makefile @@ -28,7 +28,7 @@
# Sample libpayload Makefile. include ../.config -include ../.xcompile +include ../build/xcompile
ARCH-$(CONFIG_LP_ARCH_ARM) := arm ARCH-$(CONFIG_LP_ARCH_X86) := x86_32
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47651 )
Change subject: libpayload: Move .xcompile into $(obj) ......................................................................
Patch Set 1: Code-Review+1
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47651
to look at the new patch set (#2).
Change subject: libpayload: Move .xcompile into $(obj) ......................................................................
libpayload: Move .xcompile into $(obj)
Keep libpayload's xcompile in its build dir. While we are at it, align things with the top-level version.
Having `.xcompile` in a central place led to race conditions when multiple payloads try to build their own libpayloads in parallel.
Change-Id: I504e1862db79b368289867f7568c9169f27a1549 Signed-off-by: Nico Huber nico.h@gmx.de --- M payloads/libpayload/Makefile M payloads/libpayload/Makefile.inc M payloads/libpayload/sample/Makefile 3 files changed, 17 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/47651/2
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47651 )
Change subject: libpayload: Move .xcompile into $(obj) ......................................................................
Patch Set 2: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47651 )
Change subject: libpayload: Move .xcompile into $(obj) ......................................................................
Patch Set 2: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47651 )
Change subject: libpayload: Move .xcompile into $(obj) ......................................................................
libpayload: Move .xcompile into $(obj)
Keep libpayload's xcompile in its build dir. While we are at it, align things with the top-level version.
Having `.xcompile` in a central place led to race conditions when multiple payloads try to build their own libpayloads in parallel.
Change-Id: I504e1862db79b368289867f7568c9169f27a1549 Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/47651 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Raul Rangel rrangel@chromium.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M payloads/libpayload/Makefile M payloads/libpayload/Makefile.inc M payloads/libpayload/sample/Makefile 3 files changed, 17 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Raul Rangel: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile index b5687c3..0b08c70 100644 --- a/payloads/libpayload/Makefile +++ b/payloads/libpayload/Makefile @@ -118,6 +118,11 @@ endif endif
+xcompile ?= $(obj)/xcompile +$(xcompile): $(top)/../../util/xcompile/xcompile + $< $(XGCCPATH) > $@.tmp + \mv -f $@.tmp $@ 2> /dev/null + ifeq ($(NOCOMPILE),1) include $(TOPLEVEL)/Makefile.inc real-all: config @@ -126,13 +131,17 @@
# in addition to the dependency below, create the file if it doesn't exist # to silence stupid warnings about a file that would be generated anyway. -$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell $(top)/../../util/xcompile/xcompile $(XGCCPATH) > .xcompile))) +$(if $(wildcard $(xcompile)),,$(shell \ + mkdir -p $(dir $(xcompile)) && \ + $(top)/../../util/xcompile/xcompile $(XGCCPATH) > $(xcompile) || rm -f $(xcompile)))
-.xcompile: $(top)/../../util/xcompile/xcompile - $< $(XGCCPATH) > $@.tmp - \mv -f $@.tmp $@ 2> /dev/null +include $(xcompile)
--include .xcompile +ifneq ($(XCOMPILE_COMPLETE),1) +$(shell rm -f $(xcompile)) +$(error $(xcompile) deleted because it's invalid. \ + Restarting the build should fix that, or explain the problem) +endif
CC := $(CC_$(ARCH-y)) AS := $(AS_$(ARCH-y)) @@ -294,7 +303,7 @@ rm -rf $(DOXYGEN_OUTPUT_DIR)
clean-for-update: doxygen-clean clean-for-update-target - rm -f $(allobjs) .xcompile + rm -f $(allobjs) $(xcompile) rm -f $(DEPENDENCIES) rmdir -p $(alldirs) 2>/dev/null >/dev/null || true
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc index 6188dde..6835b84 100644 --- a/payloads/libpayload/Makefile.inc +++ b/payloads/libpayload/Makefile.inc @@ -121,7 +121,7 @@ install -m 755 bin/lpas $(DESTDIR)/libpayload/bin install -m 644 bin/lp.functions $(DESTDIR)/libpayload/bin install -m 644 $(DOTCONFIG) $(DESTDIR)/libpayload/libpayload.config - install -m 755 .xcompile $(DESTDIR)/libpayload/libpayload.xcompile + install -m 755 $(xcompile) $(DESTDIR)/libpayload/libpayload.xcompile
clean-for-update-target: rm -f $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile index eb70af9..637e45d 100644 --- a/payloads/libpayload/sample/Makefile +++ b/payloads/libpayload/sample/Makefile @@ -28,7 +28,7 @@
# Sample libpayload Makefile. include ../.config -include ../.xcompile +include ../build/xcompile
ARCH-$(CONFIG_LP_ARCH_ARM) := arm ARCH-$(CONFIG_LP_ARCH_X86) := x86_32