Skip to content

Commit

Permalink
arm
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 17, 2021
1 parent 6b431c5 commit 07b3bef
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 47 deletions.
40 changes: 5 additions & 35 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() {
exit 1
fi

for i in amd64 x86 arm64 armv7l mips64 mips64el mipsel mips; do
for i in amd64 x86 arm64 armv7l; do
if [ ! -f "$ATAROOT/OUT.${i}/.toolchain_stamp" ]; then
echo "Toolchain for $i is not found"
exit 1
Expand All @@ -40,8 +40,10 @@ main() {
patch -Np1 -i "$STUFF"/rust/0002-linux-musl-disable-crt-static.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
patch -Np1 -i "$STUFF"/rust/0005-force-clear_cache-for-arm.patch

clear_vendor_checksums openssl-src
clear_vendor_checksums compiler_builtins

cat >> config.toml <<-EOF
[llvm]
Expand All @@ -50,19 +52,15 @@ main() {
assertions = false
static-libstdcpp = true
ninja = true
targets = "AArch64;ARM;Mips;X86"
targets = "AArch64;ARM;X86"
experimental-targets = ""
[build]
host = [
"x86_64-unknown-linux-musl",
"i686-unknown-linux-musl",
"aarch64-unknown-linux-musl",
"armv7-unknown-linux-musleabihf",
"mips64-unknown-linux-muslabi64",
"mips64el-unknown-linux-muslabi64",
"mips-unknown-linux-musl",
"mipsel-unknown-linux-musl"
"armv7-unknown-linux-musleabihf"
]
cargo-native-static = true
compiler-docs = false
Expand Down Expand Up @@ -117,34 +115,6 @@ main() {
linker = "armv7l-linux-musleabihf-clang"
musl-root = "$ATAROOT/OUT.armv7l/rootfs/usr"
crt-static = false
[target.mips64-unknown-linux-muslabi64]
cc = "mips64-linux-musl-clang"
cxx = "mips64-linux-musl-clang++"
linker = "mips64-linux-musl-clang"
musl-root = "$ATAROOT/OUT.mips64/rootfs/usr"
crt-static = false
[target.mips64el-unknown-linux-muslabi64]
cc = "mips64el-linux-musl-clang"
cxx = "mips64el-linux-musl-clang++"
linker = "mips64el-linux-musl-clang"
musl-root = "$ATAROOT/OUT.mips64el/rootfs/usr"
crt-static = false
[target.mips-unknown-linux-musl]
cc = "mips-linux-musl-clang"
cxx = "mips-linux-musl-clang++"
linker = "mips-linux-musl-clang"
musl-root = "$ATAROOT/OUT.mips/rootfs/usr"
crt-static = false
[target.mipsel-unknown-linux-musl]
cc = "mipsel-linux-musl-clang"
cxx = "mipsel-linux-musl-clang++"
linker = "mipsel-linux-musl-clang"
musl-root = "$ATAROOT/OUT.mipsel/rootfs/usr"
crt-static = false
EOF

./x.py dist -j$(nproc)
Expand Down
6 changes: 3 additions & 3 deletions stuff/rust/0001-LLVM-clang-build.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cad32b6b6cce6c5232065d8fd7fbe33bc6dff15b Mon Sep 17 00:00:00 2001
From bc6f332c36eaa942f4fcd2ae8bf1fcf681bb2d86 Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Wed, 17 Feb 2021 01:28:49 +0900
Subject: [PATCH 1/4] LLVM/clang build
Date: Wed, 17 Feb 2021 06:52:44 +0900
Subject: [PATCH 1/5] LLVM/clang build

Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
---
Expand Down
6 changes: 3 additions & 3 deletions stuff/rust/0002-linux-musl-disable-crt-static.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From dfb3b14916833632e5c95adf2dbec32bb5133b4a Mon Sep 17 00:00:00 2001
From d0488e4ca557f21a139c92fd49eb3ded48511d08 Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Wed, 17 Feb 2021 01:29:37 +0900
Subject: [PATCH 2/4] linux-musl: disable crt-static
Date: Wed, 17 Feb 2021 06:53:07 +0900
Subject: [PATCH 2/5] 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 caeb8fe79ebf701f042b77abd99e722db88d82b8 Mon Sep 17 00:00:00 2001
From b333b22441983ee69f588080007b61faf840979c Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Wed, 17 Feb 2021 01:30:14 +0900
Subject: [PATCH 3/4] mips and mipsel: disable soft-float on musl libc
Date: Wed, 17 Feb 2021 06:53:23 +0900
Subject: [PATCH 3/5] mips and mipsel: disable soft-float on musl libc

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

Signed-off-by: Ishimoto Shinobu <nagakamira@gmail.com>
---
Expand Down
33 changes: 33 additions & 0 deletions stuff/rust/0005-force-clear_cache-for-arm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 0dd0a84cb70b35d0cb6a4440fdcb3d51bca3c29f Mon Sep 17 00:00:00 2001
From: Ishimoto Shinobu <nagakamira@gmail.com>
Date: Wed, 17 Feb 2021 06:55:50 +0900
Subject: [PATCH 5/5] force clear_cache for arm

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

diff --git a/vendor/compiler_builtins/build.rs b/vendor/compiler_builtins/build.rs
index f948edba9..83a85acf2 100644
--- a/vendor/compiler_builtins/build.rs
+++ b/vendor/compiler_builtins/build.rs
@@ -364,6 +364,7 @@ mod c {
("__sync_fetch_and_umin_8", "arm/sync_fetch_and_umin_8.S"),
("__sync_fetch_and_xor_4", "arm/sync_fetch_and_xor_4.S"),
("__sync_fetch_and_xor_8", "arm/sync_fetch_and_xor_8.S"),
+ ("__clear_cache", "clear_cache.c"),
]);
}

@@ -414,6 +415,7 @@ mod c {
("__floatunsitf", "floatunsitf.c"),
("__trunctfdf2", "trunctfdf2.c"),
("__trunctfsf2", "trunctfsf2.c"),
+ ("__clear_cache", "clear_cache.c"),
]);

if target_os != "windows" {
--
2.29.2

0 comments on commit 07b3bef

Please sign in to comment.