-
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
Support Android ndk versions r23-beta3
and up
#85806
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@petrochenkov -- do you have a read on this PR perhaps? It seems like this could break downstream users if they're relying on libgcc linked in (due to std asking for it), even though they sort of shouldn't be doing so. Ultimately seems ok, though, especially if upstream is going to drop it... |
If this passes CI (which uses an old NDK?) then I'm happy with this. We are linking compiler-builtins anyway so Rust code is covered, and if
|
@bors r+ rollup=iffy |
📌 Commit f077233ab84a97c71300cc37e94d1d1c7d584349 has been approved by |
⌛ Testing commit f077233ab84a97c71300cc37e94d1d1c7d584349 with merge 144163b601605bc1e85ec5580115659ca3faf399... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
There seem to be two main issues: 1.
|
Since android ndk version `r23-beta3`, `libgcc` has been replaced with `libunwind`. This moves the linking of `libgcc`/`libunwind` into the `unwind` crate where we check if the system compiler can find `libunwind` and fall back to `libgcc` if needed.
libgcc
on Androidr23-beta3
and up
The mentioned issues should now be resolved as |
@ATiltedTree @bors r+ |
📌 Commit 965997b has been approved by |
Yes, I am going to use this for custom std builds.
And that is fine as long as I can do custom builds with newer toolchains. |
⌛ Testing commit 965997b with merge 96acff98ad88f528eac1e23f2c1f6ce47f4b0f2b... |
…Simulacrum Upgrade cc for working is_flag_supported on cross-compiles rust-lang#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
…Simulacrum Upgrade cc for working is_flag_supported on cross-compiles rust-lang#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
…Simulacrum Upgrade cc for working is_flag_supported on cross-compiles rust-lang#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
…Simulacrum Upgrade cc for working is_flag_supported on cross-compiles rust-lang#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
…Simulacrum Upgrade cc for working is_flag_supported on cross-compiles rust-lang#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
change Rust toolchain version to the latest nightly, because the "-lunwind" problem has gone after upgrading the latest Android NDK The Rust team has made some changes to support new versions of Android NDK, so if I still use an old NDK, "-lunwind" problem appears. - rust-lang/rust#85806
…Simulacrum Upgrade cc for working is_flag_supported on cross-compiles rust-lang#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
Confirmed that @ssrlive's dummy Here's a one-liner script to drop these find "${ndk_dir}" -name "libunwind.a" \
-execdir bash -c 'echo "INPUT(-lunwind)" > libgcc.a' \;
|
In case you are using busybox find (e.g. alpine linux), this should work: find "${ndk_dir}" -name 'libunwind.a' | \
sed 's@libunwind.a$@libgcc.a@' | \
while read x; do
echo "INPUT(-lunwind)" > $x
done |
920: Update Android NDK (21 -> 25), workaround Rust bug r=Bromeon a=Bromeon Newer NDKs don't work out of the box due to a Rust bug (only fixed in nightly). See rust-lang/rust#85806 and workaround c4dt/lightarti-rest#104. Co-authored-by: Jan Haller <bromeon@gmail.com>
920: Update Android NDK (21 -> 25), workaround Rust bug r=Bromeon a=Bromeon Newer NDKs don't work out of the box due to a Rust bug (only fixed in nightly). See rust-lang/rust#85806 and workaround c4dt/lightarti-rest#104. Co-authored-by: Jan Haller <bromeon@gmail.com>
Upgrade cc for working is_flag_supported on cross-compiles rust-lang/rust#85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to rust-lang/cc-rs#675, this didn't work properly on cross-compiles. rust-lang/cc-rs@3eeb50b fixes this, and was released in cc 1.0.74, hence the upgrade
920: Update Android NDK (21 -> 25), workaround Rust bug r=Bromeon a=Bromeon Newer NDKs don't work out of the box due to a Rust bug (only fixed in nightly). See rust-lang/rust#85806 and workaround c4dt/lightarti-rest#104. Co-authored-by: Jan Haller <bromeon@gmail.com>
Failing due to not locating libunwind This is related to: cross-rs/cross#1128 There are workarounds here: rust-lang/rust#85806 (comment) Someone might want to try implement it later For now I'm pulling the android compiles
* v0.5.0 Update: changelog Update: wasm binary and files Bump: deps Add: release on version tag github action Add: release checklist * Remove: Android CI target Failing due to not finding libunwind This is related to: cross-rs/cross#1128 There is a workaround: rust-lang/rust#85806 (comment) Someone might want to try implement it later For now I'm pulling out the android compiles from CI
920: Update Android NDK (21 -> 25), workaround Rust bug r=Bromeon a=Bromeon Newer NDKs don't work out of the box due to a Rust bug (only fixed in nightly). See rust-lang/rust#85806 and workaround c4dt/lightarti-rest#104. Co-authored-by: Jan Haller <bromeon@gmail.com>
Since android ndk version
r23-beta3
,libgcc
has been replaced withlibunwind
. This moves the linking oflibgcc
/libunwind
into theunwind
crate where we check if the system compiler can findlibunwind
and fall back tolibgcc
if needed.