[OE-core] [PATCH] bitbake.conf, module.bbclass: Support opting out of legacy EXTRA_OEMAKE
Andre McCurdy
armccurdy at gmail.com
Fri Nov 6 09:16:46 UTC 2015
On Thu, Nov 5, 2015 at 6:47 AM, Mike Crowe <mac at mcrowe.com> wrote:
> Give recipes and classes the ability to opt out of EXTRA_OEMAKE
> containing the legacy value without removing other recipe-specific or
> local additions.
Isn't this possible already from within a recipe or class by using
EXTRA_OEMAKE = ...
instead of
EXTRA_OEMAKE += ...
ie what autotools.bbclass, kernel.bbclass and many recipes do already.
For the specific case of module.bbclass, changing the EXTRA_OEMAKE
assignment to '=' might require some recipes to be tweaked to so that
they "inherit module" before adding their own options to EXTRA_OEMAKE,
but it seems like a cleaner solution?
> 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
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
More information about the Openembedded-core
mailing list