Skip to content

Commit

Permalink
Auto merge of #1038 - Amanieu:fix_netbsd, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix netbsd build with "stdbuild"

A bug was introduced in #930 which caused netbsd to not link to libm.

r? @alexcrichton
  • Loading branch information
bors committed Jul 12, 2018
2 parents ab63550 + 3d763ae commit bfe0e32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,9 @@ if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
opt="--release"
fi

cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
# Building with --no-default-features is currently broken on rumprun because we
# need cfg(target_vendor), which is currently unstable.
if [ "$TARGET" != "x86_64-rumprun-netbsd" ]; then
cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
fi
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET
4 changes: 2 additions & 2 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ cfg_if! {
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
} else if #[cfg(all(target_os = "netbsd"))] {
} else if #[cfg(all(target_os = "netbsd",
feature = "stdbuild", 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.
#[cfg_attr(feature = "stdbuild", cfg(target_vendor = "rumprun"))]
#[link(name = "m")]
extern {}
} else if #[cfg(any(target_os = "macos",
Expand Down

0 comments on commit bfe0e32

Please sign in to comment.