void-packages/srcpkgs/rust/patches/link-musl-dynamically.patch

67 lines
2.7 KiB
Diff

--- rustc-1.28.0-src/src/bootstrap/compile.rs.orig 2018-07-31 00:15:53.000000000 +0200
+++ rustc-1.28.0-src/src/bootstrap/compile.rs 2018-08-06 09:00:00.011914967 +0200
@@ -78,13 +78,6 @@ impl Step for Std {
});
builder.info(&format!("Uplifting stage1 std ({} -> {})", from.host, target));
- // Even if we're not building std this stage, the new sysroot must
- // still contain the musl startup objects.
- if target.contains("musl") {
- let libdir = builder.sysroot_libdir(compiler, target);
- copy_musl_third_party_objects(builder, target, &libdir);
- }
-
builder.ensure(StdLink {
compiler: from,
target_compiler: compiler,
@@ -101,11 +94,6 @@
return;
}
- if target.contains("musl") {
- let libdir = builder.sysroot_libdir(compiler, target);
- copy_musl_third_party_objects(builder, target, &libdir);
- }
-
let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
std_cargo(builder, &compiler, target, &mut cargo);
@@ -119,20 +107,6 @@ impl Step for Std {
}
}
-/// 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.
-fn copy_musl_third_party_objects(builder: &Builder,
- target: Interned<String>,
- into: &Path) {
- for &obj in &["crt1.o", "crti.o", "crtn.o"] {
- builder.copy(&builder.musl_root(target).unwrap().join("lib").join(obj), &into.join(obj));
- }
-}
-
/// Configure cargo to compile the standard library, adding appropriate env vars
/// and such.
pub fn std_cargo(builder: &Builder,
--- rustc-1.28.0-src/src/liblibc/src/unix/mod.rs.orig 2018-10-14 16:54:15.555482375 +0200
+++ rustc-1.28.0-src/src/liblibc/src/unix/mod.rs 2018-10-14 16:54:47.153240177 +0200
@@ -276,13 +276,6 @@
} 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 = "stdbuild",
- link(name = "c", kind = "static",
- cfg(target_feature = "crt-static")))]
- #[cfg_attr(feature = "stdbuild",
- link(name = "c", cfg(not(target_feature = "crt-static"))))]
- extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}