Skip to content

Commit

Permalink
cope
Browse files Browse the repository at this point in the history
Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
  • Loading branch information
Ishimoto Shinobu committed Feb 16, 2021
1 parent 2014662 commit 24edb00
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 39 deletions.
3 changes: 1 addition & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ main() {
cd rustc-$RUSTVER-src
patch -Np1 -i "$STUFF"/rust/0001-LLVM-clang-build.patch
patch -Np1 -i "$STUFF"/rust/0002-linux-musl-disable-crt-static.patch
patch -Np1 -i "$STUFF"/rust/0003-mips-and-mipsel-disable-soft-float-for-musl-libc.patch
patch -Np1 -i "$STUFF"/rust/0003-mips-and-mipsel-disable-soft-float-on-musl-libc.patch
patch -Np1 -i "$STUFF"/rust/0004-openssl-src-add-more-linux-musl-targets.patch

clear_vendor_checksums openssl-src
Expand Down Expand Up @@ -86,7 +86,6 @@ main() {
debug-assertions = false
debuginfo-level = 0
jemalloc = false
llvm-libunwind = "system"
rpath = true
[target.x86_64-unknown-linux-musl]
Expand Down
45 changes: 19 additions & 26 deletions stuff/rust/0001-LLVM-clang-build.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
From a772d86fdebd666b193c004e59507cb21ce0fe1b Mon Sep 17 00:00:00 2001
From cad32b6b6cce6c5232065d8fd7fbe33bc6dff15b Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Sun, 14 Feb 2021 18:41:07 +0900
Date: Wed, 17 Feb 2021 01:28:49 +0900
Subject: [PATCH 1/4] LLVM/clang build

Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
---
library/unwind/build.rs | 9 ---------
library/unwind/src/lib.rs | 7 +++----
library/unwind/build.rs | 12 +-----------
library/unwind/src/lib.rs | 3 +--
.../CodeGen/TargetLoweringObjectFileImpl.cpp | 2 +-
src/llvm-project/llvm/lib/LTO/LTO.cpp | 17 +++++++++++++++++
.../llvm/lib/MC/MCObjectFileInfo.cpp | 13 +++++--------
.../llvm/lib/Object/RelocationResolver.cpp | 3 +++
.../lib/Target/PowerPC/PPCTargetMachine.cpp | 4 ++++
.../lib/Target/RISCV/RISCVTargetMachine.cpp | 13 +++++++++++++
.../llvm/lib/Target/RISCV/RISCVTargetMachine.h | 3 +++
9 files changed, 49 insertions(+), 22 deletions(-)
9 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/library/unwind/build.rs b/library/unwind/build.rs
index fae760c4a..a360d9967 100644
index fae760c4a..3bf162bdc 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
@@ -141,15 +141,6 @@ mod llvm_libunwind {
@@ -12,9 +12,8 @@ fn main() {
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
} else if target.contains("linux") {
- // linking for Linux is handled in lib.rs
if target.contains("musl") {
- llvm_libunwind::compile();
+ println!("cargo:rustc-link-lib=unwind")
}
} else if target.contains("freebsd") {
println!("cargo:rustc-link-lib=gcc_s");
@@ -141,15 +140,6 @@ mod llvm_libunwind {
cfg.file(root.join("src").join(src));
}

Expand All @@ -37,7 +48,7 @@ index fae760c4a..a360d9967 100644
}
}
diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs
index d145c6767..c9bca3d69 100644
index d145c6767..29529024c 100644
--- a/library/unwind/src/lib.rs
+++ b/library/unwind/src/lib.rs
@@ -37,8 +37,7 @@ cfg_if::cfg_if! {
Expand All @@ -50,24 +61,6 @@ index d145c6767..c9bca3d69 100644
extern "C" {}

// When building with crt-static, we get `gcc_eh` from the `libc` crate, since
@@ -50,7 +49,7 @@ extern "C" {}
not(feature = "llvm-libunwind"),
not(feature = "system-llvm-libunwind")
))]
-#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
+#[link(name = "unwind")]
extern "C" {}

#[cfg(all(
@@ -59,7 +58,7 @@ extern "C" {}
not(feature = "llvm-libunwind"),
feature = "system-llvm-libunwind"
))]
-#[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
+#[link(name = "unwind")]
extern "C" {}

#[cfg(target_os = "redox")]
diff --git a/src/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/src/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 27bebe503..1a0a65eed 100644
--- a/src/llvm-project/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Expand Down
4 changes: 2 additions & 2 deletions stuff/rust/0002-linux-musl-disable-crt-static.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 187c05b5e9f36b9fe389b49808bcdbd5f5ca4594 Mon Sep 17 00:00:00 2001
From dfb3b14916833632e5c95adf2dbec32bb5133b4a Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Sun, 14 Feb 2021 18:42:11 +0900
Date: Wed, 17 Feb 2021 01:29:37 +0900
Subject: [PATCH 2/4] linux-musl: disable crt-static

Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c4658761bc0892f5a2dd95c2cf7f71a0d978beaa Mon Sep 17 00:00:00 2001
From caeb8fe79ebf701f042b77abd99e722db88d82b8 Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Sun, 14 Feb 2021 18:43:20 +0900
Subject: [PATCH 3/4] mips and mipsel: disable soft-float for musl libc
Date: Wed, 17 Feb 2021 01:30:14 +0900
Subject: [PATCH 3/4] mips and mipsel: disable soft-float on musl libc

Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
---
Expand Down
24 changes: 18 additions & 6 deletions stuff/rust/0004-openssl-src-add-more-linux-musl-targets.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From d4e9686477c629f37080153d2d358c0a8808d8f7 Mon Sep 17 00:00:00 2001
From 430c2d9289713233669925f632853fd2ff929726 Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Sun, 14 Feb 2021 18:44:38 +0900
Date: Wed, 17 Feb 2021 01:32:51 +0900
Subject: [PATCH 4/4] openssl-src: add more linux-musl targets

Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
---
vendor/openssl-src/src/lib.rs | 2 ++
1 file changed, 2 insertions(+)
vendor/openssl-src/src/lib.rs | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/vendor/openssl-src/src/lib.rs b/vendor/openssl-src/src/lib.rs
index 4019e8123..1a0c88c4a 100644
index 4019e8123..b55564dbf 100644
--- a/vendor/openssl-src/src/lib.rs
+++ b/vendor/openssl-src/src/lib.rs
@@ -191,7 +191,9 @@ impl Build {
@@ -191,15 +191,21 @@ impl Build {
"mips-unknown-linux-gnu" => "linux-mips32",
"mips-unknown-linux-musl" => "linux-mips32",
"mips64-unknown-linux-gnuabi64" => "linux64-mips64",
Expand All @@ -22,6 +22,18 @@ index 4019e8123..1a0c88c4a 100644
"mipsel-unknown-linux-gnu" => "linux-mips32",
"mipsel-unknown-linux-musl" => "linux-mips32",
"powerpc-unknown-linux-gnu" => "linux-ppc",
+ "powerpc-unknown-linux-musl" => "linux-ppc",
"powerpc64-unknown-freebsd" => "BSD-generic64",
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
+ "powerpc64-unknown-linux-musl" => "linux-ppc64",
"powerpc64le-unknown-freebsd" => "BSD-generic64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
+ "powerpc64le-unknown-linux-musl" => "linux-ppc64le",
"riscv64gc-unknown-linux-gnu" => "linux-generic64",
+ "riscv64gc-unknown-linux-musl" => "linux-generic64",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
"x86_64-linux-android" => "linux-x86_64",
--
2.29.2

0 comments on commit 24edb00

Please sign in to comment.