Skip to content

Commit 4b7908f

Browse files
committed
Auto merge of #2848 - Bryanskiy:android-crt-static, r=Amanieu
add crt-static for android
2 parents 424e7e3 + d6d7bfd commit 4b7908f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
#![deny(missing_copy_implementations, safe_packed_borrows)]
2727
#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
2828
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
29-
#![cfg_attr(
30-
feature = "rustc-dep-of-std",
31-
feature(native_link_modifiers, native_link_modifiers_bundle)
32-
)]
3329
#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]
3430

3531
#[macro_use]

src/unix/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,14 @@ cfg_if! {
346346
} else if #[cfg(target_os = "emscripten")] {
347347
#[link(name = "c")]
348348
extern {}
349+
} else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
350+
#[link(name = "c", kind = "static", modifiers = "-bundle",
351+
cfg(target_feature = "crt-static"))]
352+
#[link(name = "m", kind = "static", modifiers = "-bundle",
353+
cfg(target_feature = "crt-static"))]
354+
#[link(name = "m", cfg(not(target_feature = "crt-static")))]
355+
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
356+
extern {}
349357
} else if #[cfg(any(target_os = "macos",
350358
target_os = "ios",
351359
target_os = "watchos",

0 commit comments

Comments
 (0)