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.
This commit is contained in:
Sebastian Wicki 2016-02-27 14:27:10 +01:00
parent 5d514b6c6a
commit 37d4bb95f2
2 changed files with 7 additions and 1 deletions

View File

@ -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))]

View File

@ -143,6 +143,12 @@ cfg_if! {
} 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",