-
Notifications
You must be signed in to change notification settings - Fork 19
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
Not compiling with LTO #48
Comments
Hi! Thanks for making an issue. Could you include the architecture of the machine your building on as well as the makepkg command? |
Seems related to this: rust-lang/cc-rs#354 (comment) |
Oh, I'm so sorry, my bad. Yes, this is my configuration:
My
rustup -V
Command to install hck from AUR I use
|
Unrelated, but https://aur.archlinux.org/packages/hck/ is out of date at the moment and I am not the maintainer of that. Does cloning the repo and runing This and this seem to indicate that the issue is linker related (which the error message confirms!). Could you try using the Total shot in the dark, but it might help to update your version of rust as well with |
Also, could you install and run the following (or any other way of getting the same info): cargo install default-target
default-target to show what target rust thinks it's compiling for. |
Isn't 0.7.0 latest version?
It build it without problem. If I disable
How can I do this?
I do
|
# Get these env vars into your AUR config
CARGO_PROFILE_RELEASE_LTO=true
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
RUSTFLAGS="-Clinker-plugin-lto -Clink-arg=-flto -Clink-arg=-fuse-ld=lld" Or, maybe, in a [target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"] From what I'm gathering in various other tickets and threads, the default linker on Arch doesn't mix well with Rust projects and LTO when there are C deps in the Rust project. The last option here would be for me to add feature flags so that libdeflater can be opt-opt and a pure rust backend could be used instead. |
Yeah, I saw yesterday
I tried both options, and they work without problem! Oh, my god. I love you! I can finally die with peace in my heart. RUSTFLAGS="-Copt-level=3 -Ctarget-cpu=native -Clinker-plugin-lto -Clink-arg=-flto -Clink-arg=-fuse-ld=lld" works without problem too! |
Woohoo! That's awesome and good to hear. Thanks for making a ticket so that others will find this eventually as well 👍 |
Hi,
If I enable in makepkg in Arch, to build package with LTO, it throw this:
The text was updated successfully, but these errors were encountered: