From 90e0a0f7f4536e1aeb311ab2b061be71b4129e4e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 10 Jan 2025 14:45:57 +0000 Subject: 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 --- meta/classes-global/base.bbclass | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'meta/classes-global/base.bbclass') 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): return "" return "${BASE_DEFAULT_DEPS}" -BASE_DEFAULT_DEPS = "virtual/${HOST_PREFIX}gcc virtual/${HOST_PREFIX}compilerlibs virtual/libc" +BASE_DEFAULT_DEPS = "virtual/cross-cc virtual/compilerlibs virtual/libc" BASEDEPENDS = "" BASEDEPENDS:class-target = "${@get_base_dep(d)}" @@ -312,16 +312,6 @@ python base_eventhandler() { if statusheader: bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines))) - # This code is to silence warnings where the SDK variables overwrite the - # target ones and we'd see duplicate key names overwriting each other - # for various PREFERRED_PROVIDERS - if isinstance(e, bb.event.RecipePreFinalise): - if d.getVar("TARGET_PREFIX") == d.getVar("SDK_PREFIX"): - d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils") - d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc") - d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++") - d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs") - if isinstance(e, bb.event.RecipeParsed): # # If we have multiple providers of virtual/X and a PREFERRED_PROVIDER_virtual/X is set -- cgit v1.2.3-54-g00ecf