-
Notifications
You must be signed in to change notification settings - Fork 25
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 causes sysroot to be unlinkable by non-LLVM toolchains #72
Comments
Which version of |
I just created a pull request to use a different flag for the sysroot build in #73. Could you try whether this new version fixes your issue. You can install it through:
|
@phil-opp the
You can reproduce this issue by setting up a crossbuild docker image from https://github.com/rbtying/rust-xtensa-docker, and then opening a bash session in the container with
running
and calling
on an empty staticlib crate with LTO turned off, or this crate: https://github.com/rbtying/esp32-hello/tree/master/main To determine if the resulting file is valid or not, it should suffice to run |
What is your Have you tried compiling with the most recent crates.io release of |
With 0.5.31, I still get the error:
The That said, it would be unfortunate if |
Thanks for testing! Did you run
We would love to support older While it would be possible in theory to detect the rustc version and then act accordingly to the reported version, it would be an enormous task to keep support for all older nighlies. I don't have the necessary time for that, so I think it's a reasonable policy to just support the latest nightly. Users that pinned older rustc versions can just pin older As a side note, have you tried using cargo's own |
Thanks for looking into this! I did run I also rebased the xtensa patches onto the latest
I think it's reasonable not to support all nightlies into the past. Perhaps worthwhile to document when backwards-incompatible changes are made? In this case, the nightly is from a month or so ago, so the new flag is a very recent change.
I didn't know this existed! I'm not sure how to use |
On my embedded target and compiling with
This occurs both on |
@rbtying @zhaofengli Thanks for testing! I will merge the PR then.
This seems like a cargo problem then. I see that you already commented on rust-lang/cargo#8239, so let's hope that this gets resolved soon!
I agree that this would be a good idea, however it still requires a lot of work (e.g. testing new versions with many different nightlies, closely following the rustc/cargo development to know when new flags etc were introduced, etc). I'm open to pull requests that add such documentation, but I won't have the time to do it myself unfortunately.
I'm not sure about that either. I think the location of the Rust source code is detected by running |
Closing, as rust-lang/cargo#8239 was fixed. |
I'm using
cargo xbuild
to compile Rust binaries for the ESP32 via https://github.com/MabezDev/rust-xtensa, and then linking them via the Espressif xtensa-esp32-elf-ld, which is a GNU crosstool-NG linker that doesn't understand LLVM bitcode / LTO outputIs it possible to disable LTO by default for the sysroot, or make it a flag that can be passed in?
Reverting to 0.5.29 resolves the issue, so I imagine this is caused by the fix for #69 ?
The text was updated successfully, but these errors were encountered: