aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust/link-musl-dynamically.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/rust/link-musl-dynamically.patch')
-rw-r--r--community/rust/link-musl-dynamically.patch52
1 files changed, 19 insertions, 33 deletions
diff --git a/community/rust/link-musl-dynamically.patch b/community/rust/link-musl-dynamically.patch
index 20a41fe3e78..5ba322cb4bf 100644
--- a/community/rust/link-musl-dynamically.patch
+++ b/community/rust/link-musl-dynamically.patch
@@ -1,41 +1,27 @@
-We don't need those, we provide musl ourselves.
---- rustc-1.35.0-src/src/bootstrap/compile.rs
-+++ rustc-1.35.0-src/src/bootstrap/compile.rs
-@@ -114,20 +114,7 @@ impl Step for Std {
- fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>) {
- let libdir = builder.sysroot_libdir(*compiler, target);
+--- rustc-1.38.0-src/vendor/libc/src/lib.rs
++++ rustc-1.38.0-src/vendor/libc/src/lib.rs
+@@ -27,6 +27,7 @@
+ #![deny(missing_copy_implementations, safe_packed_borrows)]
+ #![no_std]
+ #![cfg_attr(feature = "rustc-dep-of-std", no_core)]
++#![cfg_attr(feature = "rustc-dep-of-std", feature(static_nobundle))]
+ #![cfg_attr(target_os = "redox", feature(static_nobundle))]
-- // 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),
-- );
-- }
-- } else if target.ends_with("-wasi") {
-+ if target.ends_with("-wasi") {
- for &obj in &["crt1.o"] {
- builder.copy(
- &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj),
---- rustc-1.35.0-src/vendor/libc/src/unix/mod.rs
-+++ rustc-1.35.0-src/vendor/libc/src/unix/mod.rs
-@@ -306,13 +306,6 @@ cfg_if! {
- } else if #[cfg(feature = "use_std")] {
+ #[macro_use]
+--- rustc-1.38.0-src/vendor/libc/src/unix/mod.rs
++++ rustc-1.38.0-src/vendor/libc/src/unix/mod.rs
+@@ -297,11 +297,11 @@ cfg_if! {
// 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",
+ } else if #[cfg(target_env = "musl")] {
++ #[link(name = "c")]
++ extern {}
+ #[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", kind = "static",
-- cfg(target_feature = "crt-static")))]
++ link(name = "gcc", kind = "static-nobundle",
+ cfg(target_feature = "crt-static")))]
- #[cfg_attr(feature = "rustc-dep-of-std",
- link(name = "c", cfg(not(target_feature = "crt-static"))))]
-- extern {}
+ extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
- extern {}