@@ -542,6 +542,24 @@ python () {
d.setVarFlag('do_devshell', 'fakeroot', '1')
d.appendVarFlag('do_devshell', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+ # Horrible duplication with allarch as we need to set this before expanding DEPENDS below.
+ if d.getVar("PACKAGE_ARCH") == "all":
+ d.setVar("INHIBIT_DEFAULT_DEPS", "1")
+
+ # Handle recipe level PREFERRED_PROVIDERs
+ depends = (d.getVar("DEPENDS") or "").split()
+ virtprovs = (d.getVar("RECIPE_VIRTUAL_PROVIDERS") or "").split()
+ newdeps = []
+ for dep in depends:
+ if dep in virtprovs:
+ newdep = d.getVar("PREFERRED_PROVIDER_" + dep)
+ if not newdep:
+ bb.fatal("Error, recipe virtual provider PREFERRED_PROVIDER_%s not set" % dep)
+ newdeps.append(newdep)
+ else:
+ newdeps.append(dep)
+ d.setVar("DEPENDS", " ".join(newdeps))
+
need_machine = d.getVar('COMPATIBLE_MACHINE')
if need_machine and not bb.utils.to_boolean(d.getVar('PARSE_ALL_RECIPES', False)):
import re
@@ -128,8 +128,8 @@ do_populate_sysroot[vardeps] += "${SYSROOT_PREPROCESS_FUNCS}"
do_populate_sysroot[vardepsexclude] += "BB_MULTI_PROVIDER_ALLOWED"
POPULATESYSROOTDEPS = ""
-POPULATESYSROOTDEPS:class-target = "virtual/cross-binutils:do_populate_sysroot"
-POPULATESYSROOTDEPS:class-nativesdk = "virtual/sdk-binutils:do_populate_sysroot"
+POPULATESYSROOTDEPS:class-target = "${PREFERRED_PROVIDER_virtual/cross-binutils}:do_populate_sysroot"
+POPULATESYSROOTDEPS:class-nativesdk = "${PREFERRED_PROVIDER_virtual/cross-binutils}:do_populate_sysroot"
do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}"
SSTATETASKS += "do_populate_sysroot"
@@ -454,8 +454,8 @@ do_qa_unpack() {
return
}
-do_kernel_configme[depends] += "virtual/cross-binutils:do_populate_sysroot"
-do_kernel_configme[depends] += "virtual/cross-cc:do_populate_sysroot"
+do_kernel_configme[depends] += "${PREFERRED_PROVIDER_virtual/cross-binutils}:do_populate_sysroot"
+do_kernel_configme[depends] += "${PREFERRED_PROVIDER_virtual/cross-cc}:do_populate_sysroot"
do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot"
do_kernel_configme[depends] += "kern-tools-native:do_populate_sysroot"
do_kernel_configme[dirs] += "${S} ${B}"
@@ -155,6 +155,12 @@ def preferred_ml_updates(d):
extramp.append(translate_provide(pref, p))
d.setVar("BB_MULTI_PROVIDER_ALLOWED", " ".join(mp + extramp))
+ virtprovs = d.getVar("RECIPE_VIRTUAL_PROVIDERS").split()
+ for p in virtprovs.copy():
+ for pref in prefixes:
+ virtprovs.append(translate_provide(pref, p))
+ d.setVar("RECIPE_VIRTUAL_PROVIDERS", " ".join(virtprovs))
+
abisafe = (d.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
extras = []
for p in prefixes:
@@ -1,6 +1,7 @@
#
# Default virtual providers
#
+RECIPE_VIRTUAL_PROVIDERS = "virtual/cross-cc virtual/cross-c++ virtual/cross-binutils virtual/cross-sdk-cc virtual/cross-sdk-c++ virtual/cross-sdk-binutils"
PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
PREFERRED_PROVIDER_virtual/egl ?= "mesa"
@@ -1,5 +1,4 @@
inherit cross
-PROVIDES = "virtual/cross-binutils"
PN = "binutils-cross-${TARGET_ARCH}"
BPN = "binutils"
@@ -1,7 +1,5 @@
require binutils-cross_${PV}.bb
-PROVIDES = "virtual/cross-sdk-binutils"
-
inherit crosssdk
PN = "binutils-crosssdk-${SDK_SYS}"
@@ -3,7 +3,6 @@ inherit cross
INHIBIT_DEFAULT_DEPS = "1"
EXTRADEPENDS = ""
DEPENDS = "virtual/cross-binutils ${EXTRADEPENDS} ${NATIVEDEPS}"
-PROVIDES = "virtual/cross-cc virtual/c++"
python () {
if d.getVar("TARGET_OS").startswith("linux"):
d.setVar("EXTRADEPENDS", "linux-libc-headers")
Currently, providers are set on a global config basis. This change allows for a select set of providers configured in RECIPE_VIRTUAL_PROVIDERS to be selected on a per recipe basis. This would allow for the selection of virtual/cross-cc as gcc or clang for example. Note that this only works for values in DEPENDS, values in task[depends] flag values need to use the ${PREFERRED_PROVIDER_virtual/xxx} method, as used in this patch in a handful of places. The PROVIDERS are removed from the recipes so that if a version of the dependency accidentally slips through, the build will fail and the user can correct the issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- meta/classes-global/base.bbclass | 18 ++++++++++++++++++ meta/classes-global/staging.bbclass | 4 ++-- meta/classes-recipe/kernel-yocto.bbclass | 4 ++-- meta/classes/multilib_global.bbclass | 6 ++++++ meta/conf/distro/include/default-providers.inc | 1 + .../binutils/binutils-cross.inc | 1 - .../binutils/binutils-crosssdk_2.43.1.bb | 2 -- meta/recipes-devtools/gcc/gcc-cross.inc | 1 - 8 files changed, 29 insertions(+), 8 deletions(-)