If I set TOOLCHAIN=clang in local.conf and then build a native recipe, the overrides that are used as not quite as expected: $ bitbake-getvar -r gn-native --value OVERRIDES linux:aarch64:pn-gn-native:layer-core::poky:class-native:toolchain-clang:forcevariable Specifically, "toolchain-clang" is unexpected because the build will be using the host GCC. I suspect the answer is "set PREFERRED_TOOLCHAIN instead", which is fine. But should native.bbclass be setting TOOLCHAIN=TOOLCHAIN_NATIVE too?
(In reply to Ross Burton from comment #0) > If I set TOOLCHAIN=clang in local.conf and then build a native recipe, the > overrides that are used as not quite as expected: > > $ bitbake-getvar -r gn-native --value OVERRIDES > linux:aarch64:pn-gn-native:layer-core::poky:class-native:toolchain-clang: > forcevariable > > Specifically, "toolchain-clang" is unexpected because the build will be > using the host GCC. > PREFERRED_TOOLCHAIN_{TARGET|NATIVE|SDK} are new interfaces > I suspect the answer is "set PREFERRED_TOOLCHAIN instead", which is fine. > But should native.bbclass be setting TOOLCHAIN=TOOLCHAIN_NATIVE too? yeah perhaps might be ok, I also wonder if we have similar issue with SDK case.
We should at least have something in the migration guide about this. We should say that clang has been integrated into core, meta-clang is no longer essential, but when picking a compiler at a distro level PREFERRED_TOOLCHAIN should be used instead of TOOLCHAIN. Antonin, can you add something like that?
I added a note on that to the release note updates I sent today: > .. warning:: > The :term:`TOOLCHAIN` should **not** be set globally. For overridding > the toolchain globally, use :term:`PREFERRED_TOOLCHAIN_TARGET`, > :term:`PREFERRED_TOOLCHAIN_NATIVE` and :term:`PREFERRED_TOOLCHAIN_SDK`. (I realize now I'm missing "variable" after TOOLCHAIN, will fix that) https://lore.kernel.org/yocto-docs/20251016-release-note-5-3-second-hunk-v1-17-20f21db1f93c@bootlin.com/ Do you think that's enough or should I mention something else?
The doc changes look good.