diff options
author | Ariadne Conill <ariadne@dereferenced.org> | 2020-10-31 18:25:23 +0000 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2020-10-31 19:55:20 +0000 |
commit | 57bc8e81a676fc6cf314b14122f27d817d0a6237 (patch) | |
tree | 672e86486af58040cdfcbc1a372432f56dee9b26 | |
parent | 6497c535e70f702740a6cb28ff12f5f2f270d0df (diff) |
community/rust: add targets for almost all architectures known to abuild
-rw-r--r-- | community/rust/APKBUILD | 8 | ||||
-rw-r--r-- | community/rust/alpine-target.patch | 165 | ||||
-rw-r--r-- | community/rust/musl-add-s390x-target.patch | 41 |
3 files changed, 189 insertions, 25 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD index 79d8ae48452..ea9c21ec9cf 100644 --- a/community/rust/APKBUILD +++ b/community/rust/APKBUILD @@ -7,10 +7,10 @@ pkgname=rust pkgver=1.47.0 _llvmver=10 _bootver=1.46.0 -pkgrel=0 +pkgrel=1 pkgdesc="The Rust Programming Language" url="https://www.rust-lang.org" -arch="x86_64 armv7 armhf aarch64 x86 ppc64le s390x" +arch="x86_64 armv7 armhf aarch64 x86 ppc64le" license="Apache-2.0 AND MIT" # gcc is needed at runtime just for linking. Someday rustc might invoke @@ -63,6 +63,7 @@ subpackages=" " source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz musl-fix-linux_musl_base.patch + musl-add-s390x-target.patch need-rpath.patch need-ssp_nonshared.patch alpine-move-py-scripts-to-share.patch @@ -305,10 +306,11 @@ _mv() { sha512sums="a6df9e2d599806eeddbfb35f7dea976781533f63d369a765b8a304221281c9f9e642ff952978f69eaaa0b28740ab5ea566b35ce481097c37fd5117bfec1f43dd rustc-1.47.0-src.tar.gz d78e4aa25704ce7df5f7675f730ab5d8acf6549db956fe06e3dbf83f1aa75d6293271c54696f4d5defda10ad230b3d9710684875aec2b7dea5bbb9d0b5347096 musl-fix-linux_musl_base.patch +74198599c0bedfd4da5a90b4ccd72741005a5d66f54d948c590e7109f85b06dce268d6feb312973a9c7854f35a32964c316d4d303b7d973cd640786bdefdb79e musl-add-s390x-target.patch 803c426f67cfa2bca93bd31c6a5228fdbcd51027073d482ada2854bb68c683bb1320c5c4db0d62ec8054b8cbc7ccb41120894a89843d4eff62ea422ca92d7340 need-rpath.patch 7a8fd00e034e069dc83a0238ba43ba685de89681fc98df49ca2c52bbf404ece475372ad094a5b9fa28d4fd42c2efdd68f7016113124413287ab13d680043e7bb need-ssp_nonshared.patch 03a179e31c95f88a98fb1ba6b2fd0baaf9fe1a74ade76d3096fe45ddc5e453c25109355e667783d9be1bcc585445d07b7270cb3e6e403de971049714f2c6f91a alpine-move-py-scripts-to-share.patch -080c3c1af15936c3795724d3cf0f60798ef470bce898e43b6757843bf56f6d46de3dd5b9ea3b116b2011b40373cf8daf17abc94cfff4bdb6221bd431aa0844fd alpine-target.patch +8a813c6b62bae0f559ba4c24f988239fc832a70707f3e744c94e65b041506baf55dd8152c4601a8a53c619221afb6942dd2ddd976f68c8fcb978f0b555a74337 alpine-target.patch 7d59258d4462eba0207739a5c0c8baf1f19d9a396e5547bb4d59d700eb94d50ba6add2e523f3e94e29e993821018594625ea4ac86304fb58f7f8c82622a26ab0 install-template-shebang.patch c31fdfe8a9b3411576c75da46645cf0465b9053000a2ab49cf9b2f2733f679d6d33acbf236d67a20e14935d094a685453b7f1840180249f39d610fd0902c3125 check-rustc 2a91c0d149f19a2268b2db8e375e0c10820529f588161d8d8e68900d929235d9b1cb4f0d64539c1e20ecca3948b4715f2d9d3d16a2754373d56b4b5808bed6bd link-musl-dynamically.patch diff --git a/community/rust/alpine-target.patch b/community/rust/alpine-target.patch index ea1113247f0..20aa888bb51 100644 --- a/community/rust/alpine-target.patch +++ b/community/rust/alpine-target.patch @@ -1,4 +1,6 @@ -From: Shiz <hi@shiz.me>, updated by Rasmus Thomsen <oss@cogitri.dev> on 28th of July 2019 +From: Shiz <hi@shiz.me> +Updated by Rasmus Thomsen <oss@cogitri.dev> on 28th of July 2019 +Updated again by Ariadne Conill <ariadne@dereferenced.org> on 31 October 2020 Date: Thu, 20 Aug 2017 01:52:36 +0200 Last-Updated: Sat, 28 Oct 2017 20:23:00 +0200 Subject: [PATCH] Add Alpine targets @@ -7,23 +9,8 @@ This adds `$arch-alpine-linux-musl` targets to Rust to encode our toolchain and distribution-specific quirks instead of polluting the main musl target of `$arch-unknown-linux-musl`. ---- a/src/librustc_target/spec/mod.rs.orig 2019-05-23 21:05:45.173347119 +0200 -+++ b/src/librustc_target/spec/mod.rs 2019-05-23 21:06:39.006681699 +0200 -@@ -328,6 +328,12 @@ macro_rules! supported_targets { - } - - supported_targets! { -+ ("i586-alpine-linux-musl", i586_alpine_linux_musl), -+ ("x86_64-alpine-linux-musl", x86_64_alpine_linux_musl), -+ ("aarch64-alpine-linux-musl", aarch64_alpine_linux_musl), -+ ("armv6-alpine-linux-musleabihf", armv6_alpine_linux_musleabihf), -+ ("armv7-alpine-linux-musleabihf", armv7_alpine_linux_musleabihf), -+ ("powerpc64le-alpine-linux-musl", powerpc64le_alpine_linux_musl), - ("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu), - ("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32), - ("i686-unknown-linux-gnu", i686_unknown_linux_gnu), --- /dev/null -+++ b/src/librustc_target/spec/aarch64_alpine_linux_musl.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/aarch64_alpine_linux_musl.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + @@ -39,7 +26,7 @@ and distribution-specific quirks instead of polluting the main musl target of + Ok(base) +} --- /dev/null -+++ b/src/librustc_target/spec/armv6_alpine_linux_musleabihf.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/armv6_alpine_linux_musleabihf.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + @@ -55,7 +42,7 @@ and distribution-specific quirks instead of polluting the main musl target of + Ok(base) +} --- /dev/null -+++ b/src/librustc_target/spec/armv7_alpine_linux_musleabihf.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/armv7_alpine_linux_musleabihf.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + @@ -71,7 +58,7 @@ and distribution-specific quirks instead of polluting the main musl target of + Ok(base) +} --- /dev/null -+++ b/src/librustc_target/spec/i586_alpine_linux_musl.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/i586_alpine_linux_musl.rs @@ -0,0 +1,14 @@ +use crate::spec::TargetResult; + @@ -88,7 +75,109 @@ and distribution-specific quirks instead of polluting the main musl target of + Ok(base) +} --- /dev/null -+++ b/src/librustc_target/spec/powerpc64le_alpine_linux_musl.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/mips64_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::mips64_unknown_linux_muslabi64::target()?; ++ ++ base.llvm_target = "mips64-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/mips64el_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::mips64el_unknown_linux_muslabi64::target()?; ++ ++ base.llvm_target = "mips64el-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/mips_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::mips_unknown_linux_musl::target()?; ++ ++ base.llvm_target = "mips-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/mipsel_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::mipsel_unknown_linux_musl::target()?; ++ ++ base.llvm_target = "mipsel-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- rustc-1.47.0-src.orig/src/librustc_target/spec/mod.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/mod.rs +@@ -490,6 +490,19 @@ + } + + supported_targets! { ++ ("i586-alpine-linux-musl", i586_alpine_linux_musl), ++ ("x86_64-alpine-linux-musl", x86_64_alpine_linux_musl), ++ ("aarch64-alpine-linux-musl", aarch64_alpine_linux_musl), ++ ("armv6-alpine-linux-musleabihf", armv6_alpine_linux_musleabihf), ++ ("armv7-alpine-linux-musleabihf", armv7_alpine_linux_musleabihf), ++ ("powerpc-alpine-linux-musl", powerpc_alpine_linux_musl), ++ ("powerpc64-alpine-linux-musl", powerpc64_alpine_linux_musl), ++ ("powerpc64le-alpine-linux-musl", powerpc64le_alpine_linux_musl), ++ ("s390x-alpine-linux-musl", s390x_alpine_linux_musl), ++ ("mips-alpine-linux-musl", mips_alpine_linux_musl), ++ ("mipsel-alpine-linux-musl", mipsel_alpine_linux_musl), ++ ("mips64-alpine-linux-musl", mips64_alpine_linux_musl), ++ ("mips64el-alpine-linux-musl", mips64el_alpine_linux_musl), + ("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu), + ("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32), + ("i686-unknown-linux-gnu", i686_unknown_linux_gnu), +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/powerpc64_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::powerpc64_unknown_linux_musl::target()?; ++ ++ base.llvm_target = "powerpc64-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/powerpc64le_alpine_linux_musl.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + @@ -104,7 +193,39 @@ and distribution-specific quirks instead of polluting the main musl target of + Ok(base) +} --- /dev/null -+++ b/src/librustc_target/spec/x86_64_alpine_linux_musl.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/powerpc_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::powerpc_unknown_linux_musl::target()?; ++ ++ base.llvm_target = "powerpc-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/s390x_alpine_linux_musl.rs +@@ -0,0 +1,13 @@ ++use crate::spec::TargetResult; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::s390x_unknown_linux_musl::target()?; ++ ++ base.llvm_target = "s390x-alpine-linux-musl".to_string(); ++ base.target_vendor = "alpine".to_string(); ++ base.options.crt_static_default = false; ++ base.options.static_position_independent_executables = true; ++ base.options.need_rpath = true; ++ ++ Ok(base) ++} +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/x86_64_alpine_linux_musl.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + diff --git a/community/rust/musl-add-s390x-target.patch b/community/rust/musl-add-s390x-target.patch new file mode 100644 index 00000000000..4782b6d06f2 --- /dev/null +++ b/community/rust/musl-add-s390x-target.patch @@ -0,0 +1,41 @@ +--- rustc-1.47.0-src.orig/src/librustc_target/spec/mod.rs ++++ rustc-1.47.0-src/src/librustc_target/spec/mod.rs +@@ -510,6 +510,7 @@ + ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu), + ("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl), + ("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu), ++ ("s390x-unknown-linux-musl", s390x_unknown_linux_musl), + ("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu), + ("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu), + ("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi), +--- /dev/null ++++ rustc-1.47.0-src/src/librustc_target/spec/s390x_unknown_linux_musl.rs +@@ -0,0 +1,28 @@ ++use crate::spec::{LinkerFlavor, Target, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::linux_base::opts(); ++ // z10 is the oldest CPU supported by LLVM ++ base.cpu = "z10".to_string(); ++ // FIXME: The data_layout string below and the ABI implementation in ++ // cabi_s390x.rs are for now hard-coded to assume the no-vector ABI. ++ // Pass the -vector feature string to LLVM to respect this assumption. ++ base.features = "-vector".to_string(); ++ base.max_atomic_width = Some(64); ++ base.min_global_align = Some(16); ++ base.static_position_independent_executables = true; ++ ++ Ok(Target { ++ llvm_target: "s390x-unknown-linux-musl".to_string(), ++ target_endian: "big".to_string(), ++ target_pointer_width: "64".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64".to_string(), ++ arch: "s390x".to_string(), ++ target_os: "linux".to_string(), ++ target_env: "musl".to_string(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ options: base, ++ }) ++} |