2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-12-25 16:50:07 -07:00
repo/extra/rust/patches/musl.patch

83 lines
3.3 KiB
Diff
Raw Normal View History

2020-01-30 11:02:23 -07:00
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
2020-03-12 13:21:16 -06:00
index eced035..f988315 100644
2020-01-30 11:02:23 -07:00
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
2020-03-12 13:21:16 -06:00
@@ -132,7 +132,7 @@ fn copy_third_party_objects(
2020-01-30 11:02:23 -07:00
// 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") {
+ if target.contains("noop") {
let srcdir = builder.musl_root(target).unwrap().join("lib");
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
copy_and_stamp(&srcdir, obj);
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
2020-03-12 13:21:16 -06:00
index 8ff7056..53c0194 100644
2020-01-30 11:02:23 -07:00
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
2020-03-12 13:21:16 -06:00
@@ -205,7 +205,7 @@ pub fn check(build: &mut Build) {
2020-01-30 11:02:23 -07:00
}
// Make sure musl-root is valid
- if target.contains("musl") {
+ if target.contains("noop") {
// If this is a native target (host is also musl) and no musl-root is given,
// fall back to the system toolchain in /usr before giving up
if build.musl_root(*target).is_none() && build.config.build == *target {
diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
2020-03-12 13:21:16 -06:00
index e294e63..17fecb3 100644
2020-01-30 11:02:23 -07:00
--- a/src/librustc_target/spec/linux_musl_base.rs
+++ b/src/librustc_target/spec/linux_musl_base.rs
@@ -26,7 +26,7 @@ pub fn opts() -> TargetOptions {
base.post_link_objects_crt.push("crtn.o".to_string());
// These targets statically link libc by default
- base.crt_static_default = true;
+ base.crt_static_default = false;
// These targets allow the user to choose between static and dynamic linking.
base.crt_static_respected = true;
2020-03-12 13:21:16 -06:00
2020-01-30 11:02:23 -07:00
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
2020-03-12 13:21:16 -06:00
index a24808b..25300a5 100644
2020-01-30 11:02:23 -07:00
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -10,7 +10,7 @@ fn main() {
// Build the unwinding from libunwind C/C++ source code.
llvm_libunwind::compile();
} else if target.contains("linux") {
- if target.contains("musl") {
+ if target.contains("noop") {
// linking for musl is handled in lib.rs
llvm_libunwind::compile();
} else if !target.contains("android") {
2020-03-12 13:21:16 -06:00
2020-01-30 11:02:23 -07:00
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
2020-03-12 13:21:16 -06:00
index 18d41be..6fddd6d 100644
2020-01-30 11:02:23 -07:00
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
2020-03-12 13:21:16 -06:00
@@ -18,7 +18,7 @@ cfg_if::cfg_if! {
2020-01-30 11:02:23 -07:00
}
}
-#[cfg(target_env = "musl")]
+#[cfg(target_env = "noop")]
#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
2020-03-12 13:21:16 -06:00
extern "C" {}
2020-01-30 11:02:23 -07:00
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
2020-03-12 13:21:16 -06:00
index 238da24..71d4f31 100644
2020-01-30 11:02:23 -07:00
--- a/vendor/libc/src/unix/mod.rs
+++ b/vendor/libc/src/unix/mod.rs
2020-03-12 13:21:16 -06:00
@@ -298,7 +298,7 @@ cfg_if! {
2020-01-30 11:02:23 -07:00
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
- } else if #[cfg(target_env = "musl")] {
+ } else if #[cfg(target_env = "noop")] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static",
cfg(target_feature = "crt-static")))]
2020-03-12 13:21:16 -06:00