summaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-06-02 19:00:41 +0200
committerAlexander Graf <agraf@suse.de>2018-06-14 10:52:14 +0200
commit2f61b13d6acba787b00598d519c85222e993e4ca (patch)
tree6438da92a46ce83b296f0d947f87e7e4cd31d379 /scripts/Makefile.lib
parent44ab2d325b79d3ce6123495c5ce52410655a58fb (diff)
downloadu-boot-2f61b13d6acba787b00598d519c85222e993e4ca.tar.gz
efi_loader: avoid make race condition
When U-Boot is built with 'make -j' there is not guarantee that targets in directory arch/ are built before targets in directory lib/. The current build instruction for EFI binaries in lib/ rely on dependencies in arch/. If $(EFI_CRT0) or $(EFI_RELOC) is not yet built before trying to build %.efi an error *** No rule to make target '%.efi' occurs. With the patch separate copies of $(EFI_CRT0) and $(EFI_RELOC) named efi_crt0.o and efi_reloc.o are built in lib/efi_loader and lib/efi_selftest. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ef7604c463..461f1c75a3 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -385,8 +385,14 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \
EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
-$(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \
- arch/$(ARCH)/lib/$(EFI_RELOC)
+$(obj)/efi_crt0.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_CRT0:.o=.S)
+ $(call if_changed_dep,as_o_S)
+
+$(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcount_source) FORCE
+ $(call cmd,force_checksrc)
+ $(call if_changed_rule,cc_o_c)
+
+$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o
$(call cmd,efi_ld)
# ACPI