-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
rust: update from 1.53.0 to 1.54.0 #7261
Conversation
@@ -1,13 +1,12 @@ | |||
TERMUX_PKG_HOMEPAGE=https://www.rust-lang.org/ | |||
TERMUX_PKG_DESCRIPTION="Systems programming language focused on safety, speed and concurrency" | |||
TERMUX_PKG_LICENSE="MIT" | |||
TERMUX_PKG_MAINTAINER="Kevin Cotugno @kcotugno" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing @kcotugno as maintainer, since he hasn't been doing it for a couple years. No slight, Kevin, but I think it's better if this line were accurate, and we fully understand if you're too busy to volunteer for this. If you'd like me to keep this line the way it is, just let me know.
e9232f4
to
bedc595
Compare
max_level_info = ['tracing/max_level_info'] | ||
+ | ||
+[target.armv7-linux-androideabi] | ||
+ldflags = "-lgcc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you also need to add -lgcc_eh
https://stackoverflow.com/questions/7885246/what-is-the-emutls-get-address-symbol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that is for mac, there is no such lib in the NDK. The one that has it for armv7 in the NDK is libgcc_real.a
, with -lgcc
forwarding to that.
I'm not sure it's forwarding this linker flag, so having it blow up with fake flags now so I can check it went through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, cargo throws out the ldflags
I'm passing in, as I suspected:
warning: /home/builder/.termux-build/rust/src/compiler/rustc_driver/Cargo.toml: unused manifest key: target.armv7-linux-androideabi.ldflags
@its-pointless, got a clue here? My guess is that one of the rust driver's dependencies started using thread-local storage (on ARM only?), which requires The question is how do we add in linker flags to compensate for this, as the rust compiler build throws out this flag no matter how I pass it in to the arm build. |
@buttaface that's the wrong place to put linker flags - try setting a |
OK, trying out |
Nope, the rust compiler build is undefeated at spitting our puny flags back at us:
|
I am seeing some -lgcc issues with ndk r23 as well. Maybe updating both of them in the same PR would work (I'll try) |
Since this is failing with NDK 21, I don't think the NDK is the reason. Something changed in one of the Rust compiler driver's files on armv7 with this 1.54.0 bump, to where it's using emulated thread-locals now and therefore needs libgcc on Android. The question is how to pass that into the Rust compiler build, which is now built by Cargo but doesn't accept the same build flags as other Cargo builds. |
You are for sure more familiar with what is happening here, just note that the NDK r23 changed so that libunwind is used instead of libgcc on arm as well (so no more libgcc). Maybe it is easier to get it to work for arm on r23, as arm there behaves more like the other arches |
Oh, you may be right that this problem goes away with NDK 23: I didn't see that the new NDK removed libgcc when I said the NDK wouldn't make a difference earlier. |
Ah, sorry I missed the comment five days ago- rustflags doesn't go in Cargo.toml, it goes in |
Maybe that's not the issue anyway though |
93199fe
to
d83cfa0
Compare
0442f00
to
924b0f6
Compare
Btw, I rebased on your updated ndk 23 branch because the armv7 build failed in the ndk packages, and I want to see if rust builds for armv7 now. |
@buttaface I understand. I'll stop force pushing now to not interfer with your work. It will most likely fail when it tries to link some hostbuilt thing with libz from device now (if it behaves as when I tried local build) |
Heh, no, your change to the I don't use rust, so if @coolreader18 could test this once the zip is uploaded, we'll know if this is ready to go once we switch to NDK 23. |
Not sure why, and maybe I'm doing this wrong, but the rust deb is empty - the only binary in |
Also |
@coolreader18 thanks, will remove it from ndk-23 (and thereby ndk-sysroot). |
To fix error: In file included from /termux-build/_cache/android-r23-api-24-v0/bin/../sysroot/usr/include/termios.h:154: In file included from /termux-build/_cache/android-r23-api-24-v0/bin/../sysroot/usr/include/android/legacy_termios_inlines.h:43: /termux-build/_cache/android-r23-api-24-v0/bin/../sysroot/usr/include/bits/termios_inlines.h:120:10: error: duplicate case value '0' case TCSAFLUSH: cmd = TCSETSF; break; ^ /termux-build/_cache/android-r23-api-24-v0/bin/../sysroot/usr/include/asm-generic/termbits.h:194:19: note: expanded from macro 'TCSAFLUSH' ^ /termux-build/_cache/android-r23-api-24-v0/bin/../sysroot/usr/include/bits/termios_inlines.h:118:10: note: previous case defined here case TCSANOW: cmd = TCSETS; break; ^ /termux-build/_cache/android-r23-api-24-v0/bin/../sysroot/usr/include/asm-generic/termbits.h:191:17: note: expanded from macro 'TCSANOW' ^
Compiler and tool names need to be updated in Makefile. Also fix some patch offsets while we are at it
It does not build with ndk r23, it uses its own stdio.h file, which does not seem to be compatible with the ndk headers.
Error: ld: error: duplicate symbol: debug >>> defined at rr.c >>> rr.o:(debug) >>> defined at main.c >>> main.o:(.bss+0x0) happen when trying to build with android-ndk r22 or r23. More info: https://go-review.googlesource.com/c/go/+/280312
3722c0c
to
3d14a0d
Compare
Closing for the NDK 23 update in #7339, which finally gets this build to finish. |
Since rust has to be bumped after changing the LLVM version, let's try updating the version again, as in #7211.