diff options
| author | Aidan Hobson Sayers <aidanhs@cantab.net> | 2015-06-14 23:55:01 +0100 |
|---|---|---|
| committer | Aidan Hobson Sayers <aidanhs@cantab.net> | 2015-06-15 13:42:18 +0100 |
| commit | 52862e4cda1ff72e52dfaea21cf82ae93725b3be (patch) | |
| tree | df3d3e906d5b1bcdffbf67fd01d48811c5b7b351 /src | |
| parent | 5ef250427d26af88a23e6e0d19bca00fc72ce2bc (diff) | |
| download | rust-52862e4cda1ff72e52dfaea21cf82ae93725b3be.tar.gz rust-52862e4cda1ff72e52dfaea21cf82ae93725b3be.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/liblibc/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index b7a40a3f9cf..2676d4879b5 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -146,7 +146,10 @@ pub use funcs::bsd43::*; #[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 {} |
