aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2023-10-03 12:02:17 +0200
committerTom Rini <trini@konsulko.com>2023-10-11 10:46:24 -0400
commit20535a3369d9ca3e3d6dd880c5fa23115a8b3fbd (patch)
tree1b48807e5f4c69821784bb8a7fb2a3744836dbe2 /Makefile
parent0501c997a0aa647ec6995a6e662b677db037ee5c (diff)
downloadu-boot-20535a3369d9ca3e3d6dd880c5fa23115a8b3fbd.zip
u-boot-20535a3369d9ca3e3d6dd880c5fa23115a8b3fbd.tar.gz
u-boot-20535a3369d9ca3e3d6dd880c5fa23115a8b3fbd.tar.bz2
Makefile: make u-boot-initial-env target depend explicitly on scripts_basic
We're seeing sporadic errors like ENVC include/generated/env.txt HOSTCC scripts/basic/fixdep ENVP include/generated/env.in ENVT include/generated/environment.h HOSTCC tools/printinitialenv /bin/sh: 1: scripts/basic/fixdep: not found make[1]: *** [scripts/Makefile.host:95: tools/printinitialenv] Error 127 make[1]: *** Deleting file 'tools/printinitialenv' make: *** [Makefile:2446: u-boot-initial-env] Error 2 make: *** Waiting for unfinished jobs.... where sometimes the "fixdep: not found" is instead "fixdep: Permission denied" and the Error 127 becomes 126. This smells like a race condition, and indeed it is: Currently, u-boot-initial-env is a prerequisite of the envtools target, which also lists scripts_basic as a prerequisite: envtools: u-boot-initial-env scripts_basic $(version_h) $(timestamp_h) tools/version.h $(Q)$(MAKE) $(build)=tools/env However, the u-boot-initial-env rule involves building the printinitialenv helper, which in turn is built using an if_changed_dep rule. That means we must ensure scripts/basic/fixdep is built and ready before trying to build printinitialenv, i.e. the u-boot-initial-env rule itself must depend on the phony scripts_basic target. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9d2e31e..b204a50 100644
--- a/Makefile
+++ b/Makefile
@@ -2447,7 +2447,7 @@ cmd_genenv = \
sed -e '/^\s*$$/d' | \
sort -t '=' -k 1,1 -s -o $@
-u-boot-initial-env: $(env_h) FORCE
+u-boot-initial-env: scripts_basic $(env_h) FORCE
$(Q)$(MAKE) $(build)=tools $(objtree)/tools/printinitialenv
$(call if_changed,genenv)