Skip to content

Commit 64d47e8

Browse files
committed
add crt-static for android
1 parent b01a39a commit 64d47e8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,17 @@ 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",
352-
target_os = "android",
353360
target_os = "openbsd"))] {
354361
#[link(name = "c")]
355362
#[link(name = "m")]

0 commit comments

Comments
 (0)