| Message ID | 20251230064832.2257911-1-raj.khem@gmail.com |
|---|---|
| State | Under Review |
| Headers | show |
| Series | toolchain/classes: Add lld-native dependency when using lld as system linker | expand |
> On 30 Dec 2025, at 06:48, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@lists.openembedded.org> wrote: > > This was not an issue before lld split from clang, but now its an independent > recipe and needs to be brought into dependency chain, otherwise clang fails to > build with -flto as it does not find gold or lld plugins. Conditional python in a very core variable like this isn’t ideal, and the clang-cross recipe already has this dependency. Is that not sufficient, or is there some edge case where that dependency isn’t enough? Ross
On Mon, Jan 12, 2026 at 8:18 AM Ross Burton <Ross.Burton@arm.com> wrote: > > > > On 30 Dec 2025, at 06:48, Khem Raj via lists.openembedded.org <raj.khem= > gmail.com@lists.openembedded.org> wrote: > > > > This was not an issue before lld split from clang, but now its an > independent > > recipe and needs to be brought into dependency chain, otherwise clang > fails to > > build with -flto as it does not find gold or lld plugins. > > Conditional python in a very core variable like this isn’t ideal, and the > clang-cross recipe already has this dependency. Is that not sufficient, or > is there some edge case where that dependency isn’t enough? Yeah I am also troubled by this. It shows up when enabling LTO since gold linker is gone clang would work with LLD but it does not find it in rootfs I will dig recipe that shows it but generally I think clang expects lld when lto is enabled. Cross clang would pull it into its own build but not into systoots its building packages in somehow > > Ross
diff --git a/meta/classes/toolchain/clang.bbclass b/meta/classes/toolchain/clang.bbclass index 9a3cd0e584..9648063f1d 100644 --- a/meta/classes/toolchain/clang.bbclass +++ b/meta/classes/toolchain/clang.bbclass @@ -26,7 +26,7 @@ PREFERRED_PROVIDER_virtual/nativesdk-cross-c++:class-crosssdk = "clang-crosssdk- PREFERRED_PROVIDER_virtual/nativesdk-cross-cc:class-cross-canadian = "clang-crosssdk-${SDK_SYS}" PREFERRED_PROVIDER_virtual/nativesdk-cross-c++:class-cross-canadian = "clang-crosssdk-${SDK_SYS}" -BASE_DEFAULT_DEPS:append = " compiler-rt libcxx" +BASE_DEFAULT_DEPS:append = " compiler-rt libcxx ${@bb.utils.contains("DISTRO_FEATURES", "ld-is-lld", "lld-native", "", d)}" TUNE_CCARGS += "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}"
This was not an issue before lld split from clang, but now its an independent recipe and needs to be brought into dependency chain, otherwise clang fails to build with -flto as it does not find gold or lld plugins. Signed-off-by: Khem Raj <raj.khem@gmail.com> --- meta/classes/toolchain/clang.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)