Don't link against lib{c,rt} on Rumprun for libstd
The Rumprun linker wrapper already includes -lc when linking. Passing it
twice unfortunately causes binutils to crash with an assertion failure.
Rumprun does currently not provide librt.
diff --git a/src/lib.rs b/src/lib.rs
index c9d7701..57919c5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -74,7 +74,7 @@
))]
// Attributes needed when building as part of the standard library
-#![cfg_attr(stdbuild, feature(no_std, core, core_slice_ext, staged_api, custom_attribute))]
+#![cfg_attr(stdbuild, feature(no_std, core, core_slice_ext, staged_api, custom_attribute, cfg_target_vendor))]
#![cfg_attr(stdbuild, no_std)]
#![cfg_attr(stdbuild, staged_api)]
#![cfg_attr(stdbuild, allow(warnings))]
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index dd8351d..f911398 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -143,6 +143,12 @@
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
+ } else if #[cfg(all(target_vendor = "rumprun", target_os = "netbsd"))] {
+ // 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.
+ #[link(name = "m")]
+ extern {}
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "android",