-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
TEXTREL in i686 since 1.41.0 #68794
Comments
This apparently breaks Android builds, since that forbids text relocations https://users.rust-lang.org/t/cant-link-rust-code-on-i686-linux-android-with-rust-1-41/37807 |
+1 I am one of the unfortunate winner of a release-blocking CI build failure for Android now that we've upgraded to 1.41.0. We've disabled android-x86 builds for now :( |
I added a minimal repro to my repository here: https://github.com/brainlock/rust-1.41-android-linker-bug-repro, in the hope that it can help debugging this (and because I was curious to dig into this myself :-) ). You can clone the repo, then
In the container you can run I bisected it using rustup and nightly releases, 2012-12-09 is good, 2019-12-10 is bad:
When using nightly-2019-12-10:
|
Conveniently, no rollups! 76a252e Auto merge of #67110 - tmandry:bump-compiler-builtins, r=alexcrichton I would personally suspect #67110. Can you try checking this via https://crates.io/crates/rustup-toolchain-install-master/? |
While rustup-toolchain-install-master compiles ( 😅 ): I see that At this point I'm too much out of my depth, this needs people more knowledgeable than me 😉 . I hope I could help debugging this, and will continue watching the issue as I'm learning a great deal just by investigating this. Besides the actual fix, there are two additional things I'd love to understand:
|
Meanwhile, I can confirm that we got the right commit (76a252e):
|
triage: P-high. Assigning to self. Leaving nominated because I'd like to discuss this at today's meeting. |
It could be. Likely the difference is in the attributes of the probestack function (before that change it was a @brianlock could you try adding the line If that fixes it, it may break it in other environments (e.g. when generating code for a shared vs static library). We'd probably need to thread some new cfg flags through, but I'm not sure if that's actually possible. The other way is going back to defining the assembly in a naked function, but a bug, probably in rustc, prevented me from doing this the first time. |
cc @Amanieu (though they're on vacation this week I believe) on the inline assembly options as potentially relevant for RFC and if they have thoughts on how to fix it for this case |
I would agree with the conclusion that rust-lang/compiler-builtins#328 is the most likely candidate here for a cause of the regression. That being said I have no idea what TEXTREL is, what's happening there to cause it, or how we might fix this. |
Looking at the objdump output, you can see the difference between the 2019-12-09 and 2019-12-10 nightlies:
The textrel happens because the As @tmandry suggested, adding |
That's probably the correct fix then, I'm just not 100% sure it will work on all targets . If it fails we should see it in CI, though. |
This is to fix rust-lang#68794, but it may break some platforms.
Will this be released in a 1.41.1, or should distros just apply this downstream? We'd very much like Rust 1.41.0 without TEXTRELs on x86. |
Also, thanks for the quick fix of course :) |
I would not currently wait for a 1.41.1 release. I hope that it will make it into 1.42 though. |
Alright, thanks for the info. |
This is a minimal regression test for the issue rust-lang#68794: "TEXTREL in i686", which was fixed with e86019c. The test links a minimal rust static library into a shared library, and checks that the linker didn't have to add the TEXTREL flag.
This is a minimal regression test for the issue rust-lang#68794: "TEXTREL in i686", which was fixed with e86019c. The test links a minimal rust static library into a shared library, and checks that the linker didn't have to add the TEXTREL flag.
Thanks for fixing this! I verified that this solves the issue on our end, and opened a PR with a simple regression test. The test fails on i686-unknown-linux-gnu when I revert compiler-builtins to 0.1.24. |
I'm not sure this is the right place to bring it up, but without this fix it is impossible to deploy a rust static library to platforms that enforce properly-relocatable code (x86 android). It didn't make the cut for 1.41.1, is there any chance for 1.42? Can we help to make this happen? Thanks! |
#69086 is beta nominated, it will be backported soon and included in 1.42 release. |
CCing the reviewers @tmandry @Mark-Simulacrum |
awesome, I am waiting for a release with this fix. Any idea when 1.42 is planned? |
Stable releases usually occur every 6 weeks, so it should land in ~2 weeks. |
I've nominated the regression test as well! |
This is a minimal regression test for the issue rust-lang#68794: "TEXTREL in i686", which was fixed with e86019c. The test links a minimal rust static library into a shared library, and checks that the linker didn't have to add the TEXTREL flag.
[beta] another round of backports for 1.42 This backports the following pull requests: * Fix a leak in `DiagnosticBuilder::into_diagnostic`. #69628 * stash API: remove panic to fix ICE. #69623 * Do not ICE on invalid type node after parse recovery #69583 * Backport only: avoid ICE on bad placeholder type #69324 * add regression test for issue #68794 #69168 * Update compiler-builtins to 0.1.25 #69086 * Update RELEASES.md for 1.42.0 #68989
Hello,
I'm in the process of upgrading Rust to 1.41.0 on Alpine Linux and it appears that a TEXTREL has been introduced in 1.41.0:
The full build log is located here if it's of interest: https://gitlab.alpinelinux.org/Cogitri/aports/-/jobs/44396
The text was updated successfully, but these errors were encountered: