From 44af6938fb7f3e19492cdf722534e5e8a9fff0d0 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Sun, 31 Dec 2023 19:14:37 +0100 Subject: [PATCH] boot/edk2: unset MAKEFLAGS in build environment Yann reported in [1] that edk2 build could sometimes fail. The issue can be reproduced when per-package directories is enabled, or also when building on a system with GNU Make >= 4.4 using the "--shuffle=reverse" option (such as Fedora 39). Those are pointing toward a Makefile dependency issue. The issue can be reproduced with commands: cat > .config < Signed-off-by: Julien Olivain Signed-off-by: Yann E. MORIN --- boot/edk2/edk2.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk index efdb4d02ce..87ac80c88f 100644 --- a/boot/edk2/edk2.mk +++ b/boot/edk2/edk2.mk @@ -150,7 +150,13 @@ EDK2_BASETOOLS_OPTS = \ EDK2_PACKAGES_PATH = $(subst $(space),:,$(strip $(EDK2_PACKAGES_PATHS))) +# EDK2 "build" script internally uses and calls "make", which controls +# its own flags. It is mainly tested while not being a sub-make. In +# order to stay in that configuration, we avoid leaking top-level +# Buildroot make flags into EDK2 build by clearing the MAKEFLAGS +# environment variable. EDK2_BUILD_ENV += \ + MAKEFLAGS= \ WORKSPACE=$(@D) \ PACKAGES_PATH=$(EDK2_PACKAGES_PATH) \ PYTHON_COMMAND=$(HOST_DIR)/bin/python3 \