Bug 11528

Summary: Enable simple toolchain switching
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: mark.hatle, meta.mr.watcher, meta.watcher, raj.khem, randy.macleod, scott.branden
Version: 2.4   
Target Milestone: 5.3 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 9417    

Description Ross Burton 2017-05-18 16:26:00 UTC
It should be as simple to change toolchain as it is to change libc.

There's a few places where gcc is hardcoded such as base.bbclass:

BASE_DEFAULT_DEPS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"

meta-clang defines a TOOLCHAIN variable that can be set to gcc or clang, and changes what compiler is being used.  I think this should end up pulling in an include file such as the way TCLIBC is used, and oe-core can provide toolchain-gcc.inc with meta-clang providing toolchain-clang.inc.

Hopefully this will let us remove the nasty in clang.bbclass (https://github.com/kraj/meta-clang/blob/master/classes/clang.bbclass)
Comment 1 Scott Branden 2017-09-14 07:03:05 UTC
This worked fine in 2.4 M2.  Fails with latest
Comment 2 Scott Branden 2017-09-14 07:05:41 UTC
This worked fine in 2.4 M2.  Fails with latest
Comment 3 Scott Branden 2017-09-14 07:07:51 UTC
(In reply to comment #2)
> This worked fine in 2.4 M2.  Fails with latest

Sorry - I commented and modified the wrong Bug here
Comment 4 Ross Burton 2025-02-07 12:35:12 UTC
We might just make this in time for M3.
Comment 5 Ross Burton 2025-07-14 10:33:07 UTC
This merged in oe-core 45bdedd213aff8df3214b95ef2a8551c0abd93a0.