1
Fork 0

bootstrap: Add directives to not double-link libs

Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate
`#[cfg]` definitions to all crates to avoid linking anything if this is passed.
This should help allow libstd to compile with both the makefiles and with Cargo.
This commit is contained in:
Alex Crichton 2016-01-21 15:36:25 -08:00
parent 4da4970767
commit eac0a8bc30
15 changed files with 38 additions and 5 deletions

View file

@ -38,7 +38,10 @@ use libc::{c_int, c_void, size_t};
not(target_os = "android"),
not(target_env = "musl")),
link(name = "pthread"))]
extern "C" {
#[cfg(not(cargobuild))]
extern {}
extern {
fn je_mallocx(size: size_t, flags: c_int) -> *mut c_void;
fn je_rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
fn je_xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;