summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-06-29 22:13:53 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-06-30 08:11:39 +0200
commit2268b3b750cd009992de4173f5d2fa8640f5a8de (patch)
treea86df2e4ea97c34c65632273b78109c4b75fb8bf /src
parentda0098a4d0ead3581658bab852893c962bdda4cf (diff)
downloadcoreboot-2268b3b750cd009992de4173f5d2fa8640f5a8de.tar.xz
arch/arm64: Avoid race condition when building bl31
The arm-trusted-firmware build system may not create the final bl31.elf file atomically, confusing our make to try to use it before it's ready. Hence insert a (hopefully, but not guaranteed to be atomic) file move. Change-Id: Iffc80467e0f4bbc96fc62414d4abfaa7b42634f4 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10700 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src')
-rw-r--r--src/arch/arm64/Makefile.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index 86d6f7dce6..4cf012a358 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -195,12 +195,12 @@ BL31_MAKEARGS += DEBUG=1
endif # CONFIG_CONSOLE_SERIAL
# Avoid build/release|build/debug distinction by overriding BUILD_PLAT directly
-BL31_MAKEARGS += BUILD_PLAT="$(top)/$(obj)/3rdparty/arm-trusted-firmware"
+BL31_MAKEARGS += BUILD_PLAT="$(abspath $(obj)/3rdparty/arm-trusted-firmware)"
BL31_CFLAGS := -fno-pic -fno-stack-protector
BL31_LDFLAGS := --emit-relocs
-BL31 := $(obj)/3rdparty/arm-trusted-firmware/bl31/bl31.elf
+BL31 := $(obj)/bl31.elf
$(BL31):
@printf " MAKE $(subst $(obj)/,,$(@))\n"
@@ -208,6 +208,7 @@ $(BL31):
CFLAGS="$(BL31_CFLAGS)" \
LDFLAGS="$(BL31_LDFLAGS)" \
$(MAKE) -C $(BL31_SOURCE) $(BL31_MAKEARGS) bl31
+ mv $(obj)/3rdparty/arm-trusted-firmware/bl31/bl31.elf $@
.PHONY: $(BL31)