summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-10 14:45:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-21 23:09:33 +0000
commit90e0a0f7f4536e1aeb311ab2b061be71b4129e4e (patch)
treea8c5678389dcf034529921537322a6d929c619a3 /meta/classes-global/base.bbclass
parent01c335432524f250ca806381ebcb8a208524eb34 (diff)
downloadpoky-90e0a0f7f4536e1aeb311ab2b061be71b4129e4e.tar.gz
classes/recipes: Switch virtual/XXX-gcc to virtual/cross-cc (and c++/binutils)
The idea of the base class dependency is to say "yes, I need a C cross compiler" and this was never meant to be gcc specific. Looking at the codebase, whilst we code triplets into this, it does overcomplicate things as there are only ever limited, "target", "sdk" and the class extended versions like mutlilib. After much thought, we can simplify this to virtual/cross-cc and virtual/nativesdk-cross-cc. This lets us remove the "gcc" specific element as well as removing the over complicated triplet usage. At the same time, change the much less widely used "g++" variant to "c++" for similar reasons and remove the triplet from virtual/XXX-binutils too. Backwards compatibility mappings could be left but are just going to confuse things in future so we'll just require users to update. This simplification, whilst disruptive for any toolchain focused layers, will make improved toolchain selection in the future much easier. Since we no longer have overlapping variables, some code for that can just be removed. The class extension code does need to start remapping some variables but not the crosssdk target recipe names. This patch is in two pieces, this one handles the renaming with the functional changes separate in a second for easier review even if this breaks bisection. (From OE-Core rev: 4ccc3bc8266c327bcc18c9a3faf7536210dfb9f0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/base.bbclass')
-rw-r--r--meta/classes-global/base.bbclass12
1 files changed, 1 insertions, 11 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index c8268abcdf..dbbf6cef8c 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -48,7 +48,7 @@ def get_base_dep(d):
48 return "" 48 return ""
49 return "${BASE_DEFAULT_DEPS}" 49 return "${BASE_DEFAULT_DEPS}"
50 50
51BASE_DEFAULT_DEPS = "virtual/${HOST_PREFIX}gcc virtual/${HOST_PREFIX}compilerlibs virtual/libc" 51BASE_DEFAULT_DEPS = "virtual/cross-cc virtual/compilerlibs virtual/libc"
52 52
53BASEDEPENDS = "" 53BASEDEPENDS = ""
54BASEDEPENDS:class-target = "${@get_base_dep(d)}" 54BASEDEPENDS:class-target = "${@get_base_dep(d)}"
@@ -312,16 +312,6 @@ python base_eventhandler() {
312 if statusheader: 312 if statusheader:
313 bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines))) 313 bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
314 314
315 # This code is to silence warnings where the SDK variables overwrite the
316 # target ones and we'd see duplicate key names overwriting each other
317 # for various PREFERRED_PROVIDERS
318 if isinstance(e, bb.event.RecipePreFinalise):
319 if d.getVar("TARGET_PREFIX") == d.getVar("SDK_PREFIX"):
320 d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils")
321 d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc")
322 d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++")
323 d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs")
324
325 if isinstance(e, bb.event.RecipeParsed): 315 if isinstance(e, bb.event.RecipeParsed):
326 # 316 #
327 # If we have multiple providers of virtual/X and a PREFERRED_PROVIDER_virtual/X is set 317 # If we have multiple providers of virtual/X and a PREFERRED_PROVIDER_virtual/X is set