mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
When building libc crate with musl, don't look for libc.a
musl may not be available on the target user's machine, and even if it is, we may not be able to find it because of how static libraries are searched for. Instead, use the transitively included liblibc which includes libc.a.
This commit is contained in:
+4
-1
@@ -146,7 +146,10 @@
|
||||
#[link(name = "m")]
|
||||
extern {}
|
||||
|
||||
#[cfg(all(target_env = "musl", not(test)))]
|
||||
// When compiling rust with musl, statically include libc.a in liblibc.rlib.
|
||||
// A cargo build of the libc crate will therefore automatically pick up the
|
||||
// libc.a symbols because liblibc is transitively linked to by the stdlib.
|
||||
#[cfg(all(target_env = "musl", not(feature = "cargo-build"), not(test)))]
|
||||
#[link(name = "c", kind = "static")]
|
||||
extern {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user