void-packages/srcpkgs/rust/patches/link-musl-dynamically.patch
Rasmus Thomsen f2a05f33b1 rust: update to 1.33.0.
[ci skip]
2019-03-27 14:30:32 +01:00

40 lines
1.8 KiB
Diff

--- rustc-1.33.0-src/src/bootstrap/compile.rs
+++ rustc-1.33.0-src/src/bootstrap/compile.rs
@@ -114,21 +114,6 @@ impl Step for Std {
fn copy_third_party_objects(builder: &Builder, compiler: &Compiler, target: Interned<String>) {
let libdir = builder.sysroot_libdir(*compiler, target);
- // Copies the crt(1,i,n).o startup objects
- //
- // Since musl supports fully static linking, we can cross link for it even
- // with a glibc-targeting toolchain, given we have the appropriate startup
- // files. As those shipped with glibc won't work, copy the ones provided by
- // musl so we have them on linux-gnu hosts.
- if target.contains("musl") {
- for &obj in &["crt1.o", "crti.o", "crtn.o"] {
- builder.copy(
- &builder.musl_root(target).unwrap().join("lib").join(obj),
- &libdir.join(obj),
- );
- }
- }
-
// Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
//
// This target needs to be linked to Fortanix's port of llvm's libunwind.
--- rustc-1.33.0-src/vendor/libc/src/unix/mod.rs
+++ rustc-1.33.0-src/vendor/libc/src/unix/mod.rs
@@ -317,13 +317,6 @@ cfg_if! {
} else if #[cfg(feature = "use_std")] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
- } else if #[cfg(target_env = "musl")] {
- #[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", kind = "static",
- cfg(target_feature = "crt-static")))]
- #[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", cfg(not(target_feature = "crt-static"))))]
- extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}