diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-10-29 19:00:33 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-10-29 19:01:12 +0100 |
commit | b38e5615c529095f8e77a98f2e93dde7b77e31d0 (patch) | |
tree | 0895ad481b1a40975a2dfcddedff9e8f308b963b /community/rust | |
parent | 36690e46f546725a183a89b366b3723e0e706997 (diff) | |
download | aports-b38e5615c529095f8e77a98f2e93dde7b77e31d0.tar.bz2 aports-b38e5615c529095f8e77a98f2e93dde7b77e31d0.tar.xz |
community/rust: prepare alpine targets for aarch64 and armhf
Diffstat (limited to 'community/rust')
-rw-r--r-- | community/rust/APKBUILD | 2 | ||||
-rw-r--r-- | community/rust/alpine-target.patch | 115 |
2 files changed, 102 insertions, 15 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD index eca58eb739..00d52e177b 100644 --- a/community/rust/APKBUILD +++ b/community/rust/APKBUILD @@ -174,5 +174,5 @@ b5c8a4faf3571b5c79b052103639ea3b14f094ec0999963602111608afa1159219f958decf0b45dd d352614e7c774e181decae210140e789de7fc090327ff371981ad28a11ce51c8c01b27c1101a24bb84d75ed2f706f67868f7dbc52196d4ccdf4ebd2d6d6b6b5e minimize-rpath.patch 498f4649163974afc4f042c43cd0c15d36784031514201a2962061f288a9336c2bc9749f8d2308b8ce3656f8097b5fc5bef505f61e2a6ed422ef4153f5339d77 alpine-move-py-scripts-to-share.patch 0542e8ffeb7ff6017aeec84d99c14802c6536433b41dafe7c8fc0c40908548228f34ef142ad6ad94235115b05f02ce157553b470b0f242292f90f3125b249e94 alpine-change-rpath-to-rustlib.patch -509de3e39f5f38ab56a20c37e72f97e326027a59de0f7899eaef2940c56daa6330fba09a8c20d323e34aed42bfcdc977acf9d0239887bbb229a590a598aec08f alpine-target.patch +b9d07a5dcc2485da72d02667891f7ccb015b1a4e648273d15532756ed98e7eeeff35f3af53d1aae1d953dc4364e42491fadb78e8bac1643851e25b81b490356d alpine-target.patch 79549055dea81379c890b495c82456ab497a9179ec6702c59e11d0748bc668f47fc3d6a69c27a0545bb87c01318631dffc69260bf2d4badc75f53cbf7fad7528 check-rustc" diff --git a/community/rust/alpine-target.patch b/community/rust/alpine-target.patch index fccbafc07e..0bd52655e1 100644 --- a/community/rust/alpine-target.patch +++ b/community/rust/alpine-target.patch @@ -1,11 +1,28 @@ From: Shiz <hi@shiz.me> 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_back/target/mod.rs ++++ b/src/librustc_back/target/mod.rs +@@ -223,8 +223,13 @@ + ("thumbv7m-none-eabi", thumbv7m_none_eabi), + ("thumbv7em-none-eabi", thumbv7em_none_eabi), + ("thumbv7em-none-eabihf", thumbv7em_none_eabihf), + + ("msp430-none-elf", msp430_none_elf), ++ ++ ("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), ++ ("arm-alpine-linux-musleabihf", arm_alpine_linux_musleabihf), + } + + /// Everything `rustc` knows about how to compile for a specific target. --- /dev/null +++ b/src/librustc_back/target/i586_alpine_linux_musl.rs @@ -0,0 +1,34 @@ @@ -43,20 +60,6 @@ and distribution-specific quirks instead of polluting the main musl target of + options: base, + }) +} ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -214,8 +214,11 @@ - ("thumbv7m-none-eabi", thumbv7m_none_eabi), - ("thumbv7em-none-eabi", thumbv7em_none_eabi), - ("thumbv7em-none-eabihf", thumbv7em_none_eabihf), - - ("msp430-none-elf", msp430_none_elf), -+ -+ ("i586-alpine-linux-musl", i586_alpine_linux_musl), -+ ("x86_64-alpine-linux-musl", x86_64_alpine_linux_musl), - } - - /// Everything `rustc` knows about how to compile for a specific target. --- /dev/null +++ b/src/librustc_back/target/x86_64_alpine_linux_musl.rs @@ -0,0 +1,34 @@ @@ -94,3 +97,87 @@ and distribution-specific quirks instead of polluting the main musl target of + options: base, + }) +} +--- /dev/null ++++ b/src/librustc_back/target/aarch64_alpine_linux_musl.rs +@@ -0,0 +1,38 @@ ++// Copyright 2017 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or ++// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license ++// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use LinkerFlavor; ++use target::{Target, TargetOptions, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::linux_musl_base::opts(); ++ base.max_atomic_width = Some(128); ++ base.crt_static_default = false; ++ base.static_position_independent_executables = true; ++ base.need_rpath = true; ++ // see #36994 ++ base.exe_allocation_crate = None; ++ ++ Ok(Target { ++ llvm_target: "aarch64-alpine-linux-musl".to_string(), ++ target_endian: "little".to_string(), ++ target_pointer_width: "64".to_string(), ++ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(), ++ arch: "aarch64".to_string(), ++ target_os: "linux".to_string(), ++ target_env: "musl".to_string(), ++ target_vendor: "alpine".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ options: TargetOptions { ++ abi_blacklist: super::arm_base::abi_blacklist(), ++ .. base ++ }, ++ }) ++} +--- /dev/null ++++ b/src/librustc_back/target/arm_alpine_linux_musleabihf.rs +@@ -0,0 +1,40 @@ ++// Copyright 2017 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or ++// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license ++// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use LinkerFlavor; ++use target::{Target, TargetOptions, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::linux_musl_base::opts(); ++ ++ // Most of these settings are copied from the arm_unknown_linux_gnueabihf ++ // target. ++ base.features = "+v6,+vfp2".to_string(); ++ base.max_atomic_width = Some(64); ++ base.crt_static_default = false; ++ base.static_position_independent_executables = true; ++ base.need_rpath = true; ++ ++ Ok(Target { ++ llvm_target: "arm-alpine-linux-musleabihf".to_string(), ++ target_endian: "little".to_string(), ++ target_pointer_width: "32".to_string(), ++ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), ++ arch: "arm".to_string(), ++ target_os: "linux".to_string(), ++ target_env: "musl".to_string(), ++ target_vendor: "alpine".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ options: TargetOptions { ++ abi_blacklist: super::arm_base::abi_blacklist(), ++ .. base ++ }, ++ }) ++} |