-
Notifications
You must be signed in to change notification settings - Fork 13.4k
clang -flto=thin incompatible with -Wl,-plugin-opt=-lto-embed-bit=optimized #86946
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
Comments
@teresajohnson: Please take a look. |
The section |
See also rust-lang/rust#84395 (comment) |
@mtrofin implemented this support and is the best person to take a look. I see in the test case added for this support that it is only tested with distributed ThinLTO: https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/thinlto_embed_bitcode.ll. It's possible that this is not (yet) supported for in process ThinLTO, but I will let @mtrofin clarify. Backing up a minute - what are you trying to do? The initial issue description says you are trying to obtain the whole program bitcode, but that is not something that is even possible with ThinLTO, which unlike regular LTO does not merge all IR. If you want to get the bitcode after each stage of the ThinLTO backend you can also try using the |
Thanks for the info! "Whole program bitcode" might be a bit confusing, what I meant is a bitcode file that can be assembled into the original executable (where it was extracted from). What I need is executables with different sanitizer instrumentations (asan, ubsan, memsan, sancov and potentially other custom instrumentation passes). Doing this post-build allows me to compile ONLY once and instrument as many times as I want. This will save compilation time, and bypass many of the sanitizer incompatibilities in the build process. -flto works fine for my purpose. Just that it's too slow for some of the larger binaries. |
IIUC you're using the (I'm trying to find the github accounts to |
Hi,
I was trying to obtain whole program bitcode through lto but run into some issues. Here's the step to reproduce.
Running
gives the following error
This issue does not occur when using -flto=full. The rust compiler also reports similar issues here: rust-lang/rust#84395
hello.c
foo.c
clang version:
The text was updated successfully, but these errors were encountered: