diff --git a/.gitignore b/.gitignore index f0ff2599d09b5..48fdc77961230 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ target Cargo.lock *~ +/style diff --git a/.travis.yml b/.travis.yml index 978772867518d..982b9994480af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ services: install: - if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi script: - - cargo build - - cargo build --no-default-features + - cargo build --target=$TARGET + - cargo build --no-default-features --target=$TARGET - cargo generate-lockfile --manifest-path libc-test/Cargo.toml - if [[ $TRAVIS_OS_NAME = "linux" ]]; then sh ci/run-docker.sh $TARGET; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index cc2de9136f971..0d7933af382ed 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -229,13 +229,18 @@ cfg_if! { // cargo build, don't pull in anything extra as the libstd dep // already pulls in all libs. } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] { - #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))] - #[link(name = "c", cfg(not(target_feature = "crt-static")))] + #[cfg_attr(stdbuild, + link(name = "c", kind = "static", + cfg(target_feature = "crt-static")))] + #[cfg_attr(stdbuild, + link(name = "c", + cfg(not(target_feature = "crt-static"))))] extern {} } else if #[cfg(target_os = "emscripten")] { #[link(name = "c")] extern {} - } else if #[cfg(all(target_os = "netbsd", target_vendor = "rumprun"))] { + } else if #[cfg(all(stdbuild, + target_os = "netbsd", target_vendor = "rumprun"))] { // Since we don't use -nodefaultlibs on Rumprun, libc is always pulled // in automatically by the linker. We avoid passing it explicitly, as it // causes some versions of binutils to crash with an assertion failure. diff --git a/src/windows.rs b/src/windows.rs index bdb0e02f1b5e3..0a74f1d57d292 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -160,8 +160,10 @@ pub const STRUNCATE: ::c_int = 80; // inline comment below appeases style checker #[cfg(all(target_env = "msvc", feature = "stdbuild"))] // " if " -#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))] -#[link(name = "libcmt", cfg(target_feature = "crt-static"))] +#[cfg_attr(stdbuild, + link(name = "msvcrt", cfg(not(target_feature = "crt-static"))))] +#[cfg_attr(stdbuild, + link(name = "libcmt", cfg(target_feature = "crt-static")))] extern {} extern {