summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-13 17:55:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-15 20:45:09 +0000
commit96db695f80e9fbb9d995e6251ae94c2002749fef (patch)
tree89b82dd7788d179b6d6c211e344849d5ab71227c /meta
parent791d842a0eb4618793ecbb587bc3ca9f32a8e102 (diff)
downloadpoky-96db695f80e9fbb9d995e6251ae94c2002749fef.tar.gz
base: Add virtual/cross-XXX recipe specific provider control handlingmaster-next
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. (From OE-Core rev: c0d87f578ef1ca9ec69f807b1ab45453ae54d406) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-global/base.bbclass18
-rw-r--r--meta/classes-global/staging.bbclass4
-rw-r--r--meta/classes-recipe/kernel-yocto.bbclass4
-rw-r--r--meta/classes/multilib_global.bbclass6
-rw-r--r--meta/conf/distro/include/default-providers.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils-crosssdk_2.43.1.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc1
8 files changed, 29 insertions, 8 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index dbbf6cef8c..3d623c80a9 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -542,6 +542,24 @@ python () {
542 d.setVarFlag('do_devshell', 'fakeroot', '1') 542 d.setVarFlag('do_devshell', 'fakeroot', '1')
543 d.appendVarFlag('do_devshell', 'depends', ' virtual/fakeroot-native:do_populate_sysroot') 543 d.appendVarFlag('do_devshell', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
544 544
545 # Horrible duplication with allarch as we need to set this before expanding DEPENDS below.
546 if d.getVar("PACKAGE_ARCH") == "all":
547 d.setVar("INHIBIT_DEFAULT_DEPS", "1")
548
549 # Handle recipe level PREFERRED_PROVIDERs
550 depends = (d.getVar("DEPENDS") or "").split()
551 virtprovs = (d.getVar("RECIPE_VIRTUAL_PROVIDERS") or "").split()
552 newdeps = []
553 for dep in depends:
554 if dep in virtprovs:
555 newdep = d.getVar("PREFERRED_PROVIDER_" + dep)
556 if not newdep:
557 bb.fatal("Error, recipe virtual provider PREFERRED_PROVIDER_%s not set" % dep)
558 newdeps.append(newdep)
559 else:
560 newdeps.append(dep)
561 d.setVar("DEPENDS", " ".join(newdeps))
562
545 need_machine = d.getVar('COMPATIBLE_MACHINE') 563 need_machine = d.getVar('COMPATIBLE_MACHINE')
546 if need_machine and not bb.utils.to_boolean(d.getVar('PARSE_ALL_RECIPES', False)): 564 if need_machine and not bb.utils.to_boolean(d.getVar('PARSE_ALL_RECIPES', False)):
547 import re 565 import re
diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass
index c58ac63c57..55581e129b 100644
--- a/meta/classes-global/staging.bbclass
+++ b/meta/classes-global/staging.bbclass
@@ -128,8 +128,8 @@ do_populate_sysroot[vardeps] += "${SYSROOT_PREPROCESS_FUNCS}"
128do_populate_sysroot[vardepsexclude] += "BB_MULTI_PROVIDER_ALLOWED" 128do_populate_sysroot[vardepsexclude] += "BB_MULTI_PROVIDER_ALLOWED"
129 129
130POPULATESYSROOTDEPS = "" 130POPULATESYSROOTDEPS = ""
131POPULATESYSROOTDEPS:class-target = "virtual/cross-binutils:do_populate_sysroot" 131POPULATESYSROOTDEPS:class-target = "${PREFERRED_PROVIDER_virtual/cross-binutils}:do_populate_sysroot"
132POPULATESYSROOTDEPS:class-nativesdk = "virtual/sdk-binutils:do_populate_sysroot" 132POPULATESYSROOTDEPS:class-nativesdk = "${PREFERRED_PROVIDER_virtual/cross-binutils}:do_populate_sysroot"
133do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}" 133do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}"
134 134
135SSTATETASKS += "do_populate_sysroot" 135SSTATETASKS += "do_populate_sysroot"
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index dea9eba1c2..b8ace98787 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -454,8 +454,8 @@ do_qa_unpack() {
454 return 454 return
455} 455}
456 456
457do_kernel_configme[depends] += "virtual/cross-binutils:do_populate_sysroot" 457do_kernel_configme[depends] += "${PREFERRED_PROVIDER_virtual/cross-binutils}:do_populate_sysroot"
458do_kernel_configme[depends] += "virtual/cross-cc:do_populate_sysroot" 458do_kernel_configme[depends] += "${PREFERRED_PROVIDER_virtual/cross-cc}:do_populate_sysroot"
459do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot" 459do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot"
460do_kernel_configme[depends] += "kern-tools-native:do_populate_sysroot" 460do_kernel_configme[depends] += "kern-tools-native:do_populate_sysroot"
461do_kernel_configme[dirs] += "${S} ${B}" 461do_kernel_configme[dirs] += "${S} ${B}"
diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index c95c3a586d..fcdda265ac 100644
--- a/meta/classes/multilib_global.bbclass
+++ b/meta/classes/multilib_global.bbclass
@@ -155,6 +155,12 @@ def preferred_ml_updates(d):
155 extramp.append(translate_provide(pref, p)) 155 extramp.append(translate_provide(pref, p))
156 d.setVar("BB_MULTI_PROVIDER_ALLOWED", " ".join(mp + extramp)) 156 d.setVar("BB_MULTI_PROVIDER_ALLOWED", " ".join(mp + extramp))
157 157
158 virtprovs = d.getVar("RECIPE_VIRTUAL_PROVIDERS").split()
159 for p in virtprovs.copy():
160 for pref in prefixes:
161 virtprovs.append(translate_provide(pref, p))
162 d.setVar("RECIPE_VIRTUAL_PROVIDERS", " ".join(virtprovs))
163
158 abisafe = (d.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split() 164 abisafe = (d.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
159 extras = [] 165 extras = []
160 for p in prefixes: 166 for p in prefixes:
diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index 506d77811f..881cc64a00 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -1,6 +1,7 @@
1# 1#
2# Default virtual providers 2# Default virtual providers
3# 3#
4RECIPE_VIRTUAL_PROVIDERS = "virtual/cross-cc virtual/cross-c++ virtual/cross-binutils virtual/cross-sdk-cc virtual/cross-sdk-c++ virtual/cross-sdk-binutils"
4PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" 5PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
5PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg" 6PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
6PREFERRED_PROVIDER_virtual/egl ?= "mesa" 7PREFERRED_PROVIDER_virtual/egl ?= "mesa"
diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
index b908393c1f..9c371e7e13 100644
--- a/meta/recipes-devtools/binutils/binutils-cross.inc
+++ b/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -1,5 +1,4 @@
1inherit cross 1inherit cross
2PROVIDES = "virtual/cross-binutils"
3 2
4PN = "binutils-cross-${TARGET_ARCH}" 3PN = "binutils-cross-${TARGET_ARCH}"
5BPN = "binutils" 4BPN = "binutils"
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.43.1.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.43.1.bb
index afc91a9b3b..6752659304 100644
--- a/meta/recipes-devtools/binutils/binutils-crosssdk_2.43.1.bb
+++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.43.1.bb
@@ -1,7 +1,5 @@
1require binutils-cross_${PV}.bb 1require binutils-cross_${PV}.bb
2 2
3PROVIDES = "virtual/cross-sdk-binutils"
4
5inherit crosssdk 3inherit crosssdk
6 4
7PN = "binutils-crosssdk-${SDK_SYS}" 5PN = "binutils-crosssdk-${SDK_SYS}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 4549f92c2f..7afdf58577 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -3,7 +3,6 @@ inherit cross
3INHIBIT_DEFAULT_DEPS = "1" 3INHIBIT_DEFAULT_DEPS = "1"
4EXTRADEPENDS = "" 4EXTRADEPENDS = ""
5DEPENDS = "virtual/cross-binutils ${EXTRADEPENDS} ${NATIVEDEPS}" 5DEPENDS = "virtual/cross-binutils ${EXTRADEPENDS} ${NATIVEDEPS}"
6PROVIDES = "virtual/cross-cc virtual/c++"
7python () { 6python () {
8 if d.getVar("TARGET_OS").startswith("linux"): 7 if d.getVar("TARGET_OS").startswith("linux"):
9 d.setVar("EXTRADEPENDS", "linux-libc-headers") 8 d.setVar("EXTRADEPENDS", "linux-libc-headers")