-
Notifications
You must be signed in to change notification settings - Fork 88
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
LTO doesn't work with rust nightlies after 2020-04-29 #15
Comments
This is likely related to Don't force rustc to do codegen for LTO builds, which makes cargo more lto-aware to speed up builds. But I am not sure where the problem lies exactly. |
This was merged only 3 days ago, so it probably isn't that specific PR (I'm assuming rust nightlies are built from master). However there seem to be a lot of related PRs concerning LTO and changing how it works in the past weeks. Edit: I think rust-lang/rust#71528 might have something to with this, which was also merged on the 29th of April. According to the description
The PR indicates that no object files should be generated, while the error indicates otherwise. This might be related to libhermit-rs being built by a build script instead of directly via cargo. But I don't really know enough about rusts build system and cargo to dig deeper. |
The problem is solved. At least it works on my test system. |
It's still broken for me. |
I fixed it, but we have still an issue by building application with LTO support. The linker encodes the wrong OS ABI. See also rust-lang/rust#73606 |
Looking at the PR, this only works for thin LTO, right? Commit 66325e6 suggests that using full lto |
Yes, but this is also a bug in the Linker Plugin. I am able to link and to run with |
The |
Hm, can you set |
I close this issue. The readme describes, how LTO can be activated. |
A recent version of nightly rust gets the following link error: error: failed to get bitcode from object file for LTO (Bitcode section not found in object file) This issue can be fixed by supplying `-C linker-plugin-lto` and set lto option to "thin"[1]. [1] hermit-os/hermit-rs#15 Signed-off-by: Akira Moroo <retrage01@gmail.com>
As reported in #7 building the rusty-demo with LTO doesn't work with rust nightlies newer than 2020-04-29. If this doesn't resolve by itself we should investigate what changed and if this requires any changes on our end in order to reenable LTO.
The error that gets printed when linking is the following:
error: failed to get bitcode from object file for LTO (Bitcode section not found in object file)
As a temporary workaround LTO was disabled in the release profile in #14
The text was updated successfully, but these errors were encountered: