[OE-core] [PATCH] bitbake.conf, module.bbclass: Support opting out of legacy EXTRA_OEMAKE
Mike Crowe
mac at mcrowe.com
Thu Nov 5 14:47:01 UTC 2015
Give recipes and classes the ability to opt out of EXTRA_OEMAKE
containing the legacy value without removing other recipe-specific or
local additions.
The default value of EXTRA_OEMAKE="-e MAKEFLAGS=" is unfortunate. It
causes breakage and unintended behaviour in various recipes.
It is particularly toxic when variables are passed on the command line
to make since they then don't survive calling into a submake.
In particular this breaks building modules when LD=gold since the
overridden LD=${KERNEL_LD} is lost by the time the kernel's Makefile is
invoked.
This solution isn't pretty either, but it may be a good small first step
towards a future utopia where EXTRA_OEMAKE needn't contain "-e
MAKEFLAGS=" by default at all.
Signed-off-by: Mike Crowe <mac at mcrowe.com>
Acked-by: Phil Blundell <pb at pbcl.net>
---
meta/classes/module.bbclass | 4 ++++
meta/conf/bitbake.conf | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index 0952c0c..4913aac 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -4,6 +4,10 @@ addtask make_scripts after do_patch before do_compile
do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
+# -e MAKEFLAGS= is toxic when building modules since it will cause
+# none of the variables passed to make on the command line to make it
+# through to submakes.
+EXTRA_OEMAKE_LEGACY = ""
EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
module_do_compile() {
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 06971da..93ab02a 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -477,7 +477,8 @@ export BUILD_STRIP = "${BUILD_PREFIX}strip"
export BUILD_NM = "${BUILD_PREFIX}nm"
export MAKE = "make"
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE_LEGACY = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "${EXTRA_OEMAKE_LEGACY}"
EXTRA_OECONF = ""
export LC_ALL = "C"
--
2.1.4
More information about the Openembedded-core
mailing list