-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kirkstone: OpenMP fails to build with thin LTO enabled. #708
Comments
Thanks for the report @jaskij yes I know there are some issues with LTO enabling with meta-clang. I think the linker plugin is not configured correctly when linking with lto objects. It needs to be root caused a bit more. |
@kraj can you direct me on how to dig into it? |
you can start by looking at the linking step and extract it out of build and try to do manual link. Then you can add |
Looks like it's picking up the GNU linker.
|
You set me on the right track. Knowing that it's the wrong linker, I tested some stuff and adding LDFLAGS:append = "-fuse-ld=lld" Now, why is it using the GNU linker? |
Sorry for the comment spam, but I seem to have found it - using lld distrowide is hidden behind a separate distro features, meta-clang/classes/clang.bbclass Line 73 in 299a5fd
|
@jaskij good ! yes You are right about documenting this distro feature. Perhaps its worth adding it to README. Patches welcome!! |
@kraj |
yes |
When built with thin LTO enabled, LLVM produces object files containing LLVM IR, which ld can't understand. Since we're forcing the toolchain to clang anyway, let's also force using lld. Fixes GitHub kraj#708 Signed-off-by: Jan Dorniak <jaskij@gmail.com>
When built with thin LTO enabled, LLVM produces object files containing LLVM IR, which ld can't understand. Since we're forcing the toolchain to clang anyway, let's also force using lld. Fixes GitHub #708 Signed-off-by: Jan Dorniak <jaskij@gmail.com>
With the proposed patch (Which has been picked in the kirkstone branch) openmp fails to build here: https://pastebin.com/m00Recv6 Reverting the commit makes the build pass again. Is there something which I am missing? |
When using clang as the default toolchain and
thin-lto
is enabeld in distro configuration, OpenMP fails to build.The error given is:
After unpacking
libLLVMSupport.a
I found out that the object files are, in fact, LLVM IR:I'm not actually using any LLVM libs on the target, so for now have disabled LTO for clang as a workaround.
The text was updated successfully, but these errors were encountered: