-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Allow stripping debuginfo from LLVM's shared library #114259
Conversation
to strip the debuginfo present libLLVM.so, when applicable (on linux, when llvm.link-shared is true, when llvm.release-debuginfo is false)
@bors try |
⌛ Trying commit 2ba4bae with merge a9b44723d564723ba744f3dce36c875d5c4786c8... |
☀️ Try build successful - checks-actions |
This flag is a bit hacky, because it basically just removes pre-existing debuginfo that isn't generated by bootstrap. And if we're going to only do it for Linux and only for LLVM built as a shared library, which is a pretty specific use-case, it would make more sense to me to have it in Alternatively, maybe we could just always strip |
Ok I'll do this without a flag. |
As seen in #114175, there's still some small amount of debuginfo in LLVM's shared library on linux, even when not requesting it (much like in
librustc_driver.so
), coming fromlibstdc++
.This PR adds a
llvm.strip-debuginfo
config to strip it away, when all of the following hold:llvm.link-shared
is truellvm.release-debuginfo
is false#114175 did the same thing unconditionally in
opt-dist
, prior to BOLTing LLVM. But this should be validated and used in conjunction with these other config options above, and whichopt-dist
doesn't know about. Therefore, it makes more sense as a dedicated option, to be used in bootstrap when building LLVM (and enabled in CI on e.g. thedist-x86_64-linux
builder).From the other PR,
libLLVM-16-rust-1.73.0-nightly.so
prior to #114141:And from this PR,
libLLVM-16-rust-1.73.0-nightly.so
after #114141:(Draft while I do some try builds to ensure this is working as expected on CI, and until I ask e.g. cuviper whether it's a good idea 😓. Or if we could avoid emitting that debuginfo in the first place, if at all possible).
(After we validate whether it's interesting, I could add similar mechanism for
librustc_driver.so
, which also has some debuginfo fromlibstdc++
, as well ascompiler_builtins
: I tested locally that removing that would reduce its size by about 10%.)(I also don't know if it should be added to
src/bootstrap/configure.py
, I don't think so. And may also need itscheck_ci_llvm!
to be removed, where CI needsdownload-ci-llvm
...)