-
Notifications
You must be signed in to change notification settings - Fork 1.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
add crt-static for android #2848
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. Please see the contribution instructions for more information. |
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.
Also, it'd be helpful to provide the context/reason for this change.
#![cfg_attr( | ||
feature = "rustc-dep-of-std", | ||
feature(native_link_modifiers, native_link_modifiers_bundle) | ||
)] |
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.
Could you explain why this change is necessary?
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.
native_link_modifiers
and native_link_modifiers_bundle
are already stable, so these features produce #[warn(stable_features)]
in rustc-dep-of-std
mode (which turns into an error when building standard library in rust-lang/rust).
This is the libc part of supporting statically linked executables on Android, the rustc part is rust-lang/rust#99421. |
@bors r+ |
💔 Test failed - checks-actions |
|
src/unix/mod.rs
Outdated
} else if #[cfg(any(target_os = "macos", | ||
target_os = "ios", | ||
target_os = "watchos", | ||
target_os = "android", |
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.
With these changes as is the case of Android without rustc-dep-of-std
is never covered, so this line needs to be kept.
Sorry, didn't notice this previously.
Does anybody know why libc on musl and redox doesn't link anything at all in regular no-std mode (without |
Implementation for glibc is also incorrect, but in a different way - in regular no-std mode the libraries are linked dynamically even if |
Ah, I see, all of this is indeed incorrect but cannot be properly fixed on stable version of libc because link time Anyway, this PR is about Android and the least bad thing to do for this target would be to follow what glibc does (i.e. #2848 (comment)). |
@bors r+ |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
@Amanieu |
No description provided.