From: Shiz , updated by Rasmus Thomsen on 28th of July 2019 Date: Thu, 20 Aug 2017 01:52:36 +0200 Last-Updated: Sat, 28 Oct 2017 20:23:00 +0200 Subject: [PATCH] Add Alpine targets 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 @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + +pub fn target() -> TargetResult { + let mut base = super::aarch64_unknown_linux_musl::target()?; + + base.llvm_target = "aarch64-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 +++ b/src/librustc_target/spec/armv6_alpine_linux_musleabihf.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + +pub fn target() -> TargetResult { + let mut base = super::arm_unknown_linux_musleabihf::target()?; + + base.llvm_target = "armv6-alpine-linux-musleabihf".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 +++ b/src/librustc_target/spec/armv7_alpine_linux_musleabihf.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + +pub fn target() -> TargetResult { + let mut base = super::armv7_unknown_linux_musleabihf::target()?; + + base.llvm_target = "armv7-alpine-linux-musleabihf".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 +++ b/src/librustc_target/spec/i586_alpine_linux_musl.rs @@ -0,0 +1,14 @@ +use crate::spec::TargetResult; + +pub fn target() -> TargetResult { + let mut base = super::i686_unknown_linux_musl::target()?; + + base.options.cpu = "pentium4".to_string(); + base.llvm_target = "i586-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 +++ b/src/librustc_target/spec/powerpc64le_alpine_linux_musl.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + +pub fn target() -> TargetResult { + let mut base = super::powerpc64le_unknown_linux_musl::target()?; + + base.llvm_target = "powerpc64le-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 +++ b/src/librustc_target/spec/x86_64_alpine_linux_musl.rs @@ -0,0 +1,13 @@ +use crate::spec::TargetResult; + +pub fn target() -> TargetResult { + let mut base = super::x86_64_unknown_linux_musl::target()?; + + base.llvm_target = "x86_64-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) +}