Skip to content

Commit bfe0e32

Browse files
committed
Auto merge of #1038 - Amanieu:fix_netbsd, r=alexcrichton
Fix netbsd build with "stdbuild" A bug was introduced in #930 which caused netbsd to not link to libm. r? @alexcrichton
2 parents ab63550 + 3d763ae commit bfe0e32

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ci/run.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,9 @@ if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
8686
opt="--release"
8787
fi
8888

89-
cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
89+
# Building with --no-default-features is currently broken on rumprun because we
90+
# need cfg(target_vendor), which is currently unstable.
91+
if [ "$TARGET" != "x86_64-rumprun-netbsd" ]; then
92+
cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
93+
fi
9094
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET

src/unix/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ cfg_if! {
306306
} else if #[cfg(target_os = "emscripten")] {
307307
#[link(name = "c")]
308308
extern {}
309-
} else if #[cfg(all(target_os = "netbsd"))] {
309+
} else if #[cfg(all(target_os = "netbsd",
310+
feature = "stdbuild", target_vendor = "rumprun"))] {
310311
// Since we don't use -nodefaultlibs on Rumprun, libc is always pulled
311312
// in automatically by the linker. We avoid passing it explicitly, as it
312313
// causes some versions of binutils to crash with an assertion failure.
313-
#[cfg_attr(feature = "stdbuild", cfg(target_vendor = "rumprun"))]
314314
#[link(name = "m")]
315315
extern {}
316316
} else if #[cfg(any(target_os = "macos",

0 commit comments

Comments
 (0)