aboutsummaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-10-15 05:41:21 +0000
committerChris Larson <chris_larson@mentor.com>2010-10-15 12:35:38 -0700
commit5b485324c2ac637e9fc6d40753ee64fd6907db69 (patch)
treee9602027b98fd49630f2590c38efe0ec3a145bd6 /conf
parentfd40911b324beebb82cf70f576d3149f8e5e1605 (diff)
downloadopenembedded-5b485324c2ac637e9fc6d40753ee64fd6907db69.tar.gz
Reverse the order of OVERRIDES
Given the current implementation of OVERRIDES in bitbake, the variable is expected to contain elements in the order least specific to most specific, however, our current usage of it does not match that. As one example, "local" is supposed to always be the most specific override, yet currently it's the least specific. As another example, currently the target architecture is seen as more specific than the machine, which is also clearly wrong. Big thanks to Chase Maupin for investigating and identifying this long standing issue. It becomes clear that a reversal of the current value will bring us to a more sane behavior, and avoids the need for the dual overrides hack mentioned in the comments, so this implements this reversal, and drops the unnecessary and confusing comments. This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to inject overrides elements which are more specific than the distro but less specific than the machine, which is where things like MACHINE_CLASS or SOC_FAMILY or the like would go. This variable is *space* separated, to make it easier and more convenient to assemble the variable incrementally. Reported-by: Chase Maupin <chase.maupin@ti.com> Signed-off-by: Chris Larson <chris_larson@mentor.com> Acked-by: Chase Maupin <chase.maupin@ti.com> Acked-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'conf')
-rw-r--r--conf/bitbake.conf17
-rw-r--r--conf/distro/include/arm-thumb.inc6
-rw-r--r--conf/distro/micro.conf6
-rw-r--r--conf/distro/minimal.conf5
-rw-r--r--conf/distro/shr.conf5
-rw-r--r--conf/machine/fsg3be.conf2
-rw-r--r--conf/machine/kixrp435.conf2
-rw-r--r--conf/machine/nslu2be.conf2
-rw-r--r--conf/machine/nslu2le.conf2
9 files changed, 19 insertions, 28 deletions
diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 494e14e243..c2359dce97 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
# Overrides are processed left to right, so the ones that are named later take precedence.
# You generally want them to go from least to most specific.
-#
-# This means that an envionment variable named '<foo>_arm' overrides an
-# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
-# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't override
-# '<foo>_arm' when ${MACHINE} is 'ramses'.
-# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses' will override
-# '<foo>_arm' and then '<foo>' will be overriden with that value from '<foo>_arm'.
-# And finally '<foo>_local' overrides anything, but with lowest priority.
-#
-# This works for functions as well, they are really just environment variables.
-# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
-OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
-# Alternative OVERRIDES definition without "fail fast", usually only for native building and Scratchbox toolchains.
-#OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}"
+MACHINE_OVERRIDES ?= ""
+OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
+${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
##################################################################
# Include the rest of the config files.
diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-thumb.inc
index 36edd4f670..75ed9780a2 100644
--- a/conf/distro/include/arm-thumb.inc
+++ b/conf/distro/include/arm-thumb.inc
@@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
# arm system and vice versa. It is strongly recommended that DISTROs not
# turn this off - the actual cost is very small.
-OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
-OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
-OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
+OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
+OVERRIDE_INTERWORK = "${@['', 'thumb-interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
+OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
# Compiler and linker options for application code and kernel code. These
# options ensure that the compiler has the correct settings for the selected
diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
index 6d396b3397..19b5e6209b 100644
--- a/conf/distro/micro.conf
+++ b/conf/distro/micro.conf
@@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
require conf/distro/include/arm-thumb.inc
#############################################################################
-# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
#############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
-${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
#############################################################################
# PREFERRED VERSIONS
diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
index 376ffdee02..0d32cfeffe 100644
--- a/conf/distro/minimal.conf
+++ b/conf/distro/minimal.conf
@@ -81,9 +81,10 @@ KERNEL = "kernel26"
MACHINE_KERNEL_VERSION = "2.6"
#############################################################################
-# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
#############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
#############################################################################
# TOOLCHAIN
diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
index ade8cbad2a..74e3fe9c29 100644
--- a/conf/distro/shr.conf
+++ b/conf/distro/shr.conf
@@ -151,9 +151,10 @@ KERNEL = "kernel26"
MACHINE_KERNEL_VERSION = "2.6"
#############################################################################
-# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
#############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
#############################################################################
# TOOLCHAIN
diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
index a2ca95beac..c5ddc2542a 100644
--- a/conf/machine/fsg3be.conf
+++ b/conf/machine/fsg3be.conf
@@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
MACHINE_ARCH = "ixp4xxbe"
-OVERRIDES = "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
# Match the vendor's latest kernel
PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
index 8259127ec3..ba8216d66b 100644
--- a/conf/machine/kixrp435.conf
+++ b/conf/machine/kixrp435.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
# Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx nslu2"
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_VERSION_linux = "2.6.30"
diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
index 9bc92f1a99..69d12a73bd 100644
--- a/conf/machine/nslu2be.conf
+++ b/conf/machine/nslu2be.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
# Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc automatically.
PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx nslu2"
ROOT_FLASH_SIZE ?= "6"
diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
index 62e47cb678..5cd8a7799a 100644
--- a/conf/machine/nslu2le.conf
+++ b/conf/machine/nslu2le.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
# Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx nslu2"
ROOT_FLASH_SIZE ?= "6"