From 6f11b191798b06fdb8f13c7f2f3d38416db15a96 Mon Sep 17 00:00:00 2001 From: Aric Belsito Date: Wed, 27 Jun 2018 10:22:21 -0700 Subject: dev-lang/rust: version bump to 1.27.0 --- dev-lang/rust/Manifest | 13 +- ...-nostdlib-and-musl_root-from-musl-targets.patch | 384 +++++++++++++++++++++ ...sl-targets-to-link-dynamically-by-default.patch | 12 + .../rust/files/rust-1.27.0-libressl-2.7.0.patch | 24 ++ dev-lang/rust/rust-1.27.0.ebuild | 355 +++++++++++++++++++ 5 files changed, 787 insertions(+), 1 deletion(-) create mode 100644 dev-lang/rust/files/1.27.0/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch create mode 100644 dev-lang/rust/files/1.27.0/0003-Switch-musl-targets-to-link-dynamically-by-default.patch create mode 100644 dev-lang/rust/files/rust-1.27.0-libressl-2.7.0.patch create mode 100644 dev-lang/rust/rust-1.27.0.ebuild (limited to 'dev-lang') diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index 7815bff6..1d791550 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -8,5 +8,16 @@ DIST rust-1.25.0-i686-unknown-linux-gnu.tar.xz 102453124 BLAKE2B 8986ebab6a7a9d0 DIST rust-1.25.0-i686-unknown-linux-musl.tar.xz 100253196 BLAKE2B 2bc6d9d2a1dfabd8d88733921c3f1a5558174e8e915bc6f2a38f71097603796480d88bfb40c4ebcc2a877290906079099a1f7c965931a5378fffde556193905f SHA512 93eb29d86e209e0bc2aa92f3e534393ad37658a6b4f91ae3da7f3aaf05e82a5c04376f2e6d24410f0a1647ba3d7c6945254c74704084d53bf6be806a064754c1 DIST rust-1.25.0-x86_64-unknown-linux-gnu.tar.xz 111059260 BLAKE2B ae982976a735c2b5226722207a983bb638cb7c0cb0ceb6b438456d54fac86a5d1892b535f01ac463157205c0ae27ae876482f6ac1fa269a9ec3e1177be0cef2e SHA512 aea93ff64f620a1dd6b48d07ec3dcbc126b2f5c17b4697c096ec8cd02a3c7dfec7ae7d5df70a55eceb372897ad12f3d01c67d5aaea0167a80270931c61323f78 DIST rust-1.25.0-x86_64-unknown-linux-musl.tar.xz 97724224 BLAKE2B ad0accfb670acf2a02f9bb1c8e6a80ab7be2d1e0f01bc2da13744ab164774cc318255d78a657b84ad0f97ab1ee3fc4a53b4cf1ee71ba52984cbcd52bd64f2387 SHA512 ee250193db5e20edb80fe864609b1c16ca5da5f2ca16700f5f938195d43dd5d3de8cd138f64feebd73f77fbf4f61196459c13420ba6c4f451b9db266db92219a +DIST rust-1.26.2-aarch64-unknown-linux-gnu.tar.xz 90964988 BLAKE2B 7e5de737ff2b4711e0a5b3085f10c3f2918fc5823dcb52bc5f897a5617b65d648d5e59664dbfaa904ff08923d1bbd11aae21349760fefef6ff18ea0e45391e07 SHA512 b565ec988d3b946dabc8902eba60b446070e77b7c27aa98d981b7ba5e9285bda95565627600e6be057970de5006d9640ef77fa920849160f5cf98508b48d1673 +DIST rust-1.26.2-aarch64-unknown-linux-musl.tar.xz 96634640 BLAKE2B fe74fec5c20d7d74e261b30cc3e3eb375da35332ab54e528eca78270608c6830fc4ed15bfa0f8126fc4e77f8476ab9c008565191667ba278713194e38c2d7b59 SHA512 2643021d99bafc3da58bab7a40aeb9c0127b099b26b59c4ebb073d7f807262e65ec8b12618fb8fe5d75fa8809319c3b08518371c04f406cb7fcdbf795b3bdb35 +DIST rust-1.26.2-arm-unknown-linux-gnueabi.tar.xz 98267104 BLAKE2B ae44fcead124e5e3993240be0c8a46e545df5d045d39184cfada86d9a820fa30a771396a2ced86c2454aef224951e85cf0b6965c13ed98a3024e07d4ca1ec6a9 SHA512 a96295ef2d0eca5a682e3b3bcfe3b3ffeb5bbe45bc949f467cfd1e7ac7252d74e86d2d8f25e5722e75e7f537afeb3b0ae9054bd3908916ea461623f8c13ba5bf +DIST rust-1.26.2-arm-unknown-linux-musleabi.tar.xz 97679732 BLAKE2B e5bdd376c1a5a1d8ebf3e8cacd80f0a8165e24ed8c7ed3755cf2ca7f3688f3f278534021e8d1487875cab657ad9391023577692afaff45f001e52d76d9417058 SHA512 a1e20e2a93b40ec8bc8a90d9e5b57801e7fa79649b45ae6ca1133ec24779edc00ff73b5f8a1836856b2cdd78b643390518d58694e5661834b6091a5d6e924660 +DIST rust-1.26.2-armv7-unknown-linux-gnueabihf.tar.xz 98828932 BLAKE2B 2f60e65128bd32d97422d82d99f5c5447d1c1e77582028089d52208e3ede4af5e72c278a3fb5001348c864087f3e85af05604a0b6078891c5ed812d745840d93 SHA512 7b8e3f39a62b7b5fdaa6d53e5638de26968799d97b5d53e09bf49456b02f968495cff4757f25d38bc3393ca33dc1b9da353ec290ba9416770e082548aa5079ac +DIST rust-1.26.2-armv7-unknown-linux-musleabihf.tar.xz 97326548 BLAKE2B c955fe3fd4dbdc12c6c8101538a930169dc62e7461964b8f900e8afd3973fea783116ed25aff5db15eded8173377db412c67232b12e0cba6a3278793f08de2ae SHA512 ed1d9828d2f12e782fd73865a0403c7b26c11cab665c635308e8e1cd23e6101402b448f0334f33b33193162bb9e6b30eba8a541b3d128925407f17b9d8f4f9f3 +DIST rust-1.26.2-i686-unknown-linux-gnu.tar.xz 143090096 BLAKE2B 7871fa4e4d0f320ff949cd31cefa116bc7b741927626958e1d10197f05fc9a662b8d6c21ddd4d2910700e6f7273e4fc18738e6ff58cd85b9af4ed25eceea31d9 SHA512 859b5b72c78cca8cd473012599ca12539ef9a5ee38d1aaaad024019fd84220e344e1cd0efd2b027ef333555b158b23529f35ceb5d59d76c35e7946b5fe4a8a52 +DIST rust-1.26.2-i686-unknown-linux-musl.tar.xz 103964468 BLAKE2B f1bcc5be07239917517302389c91ca68427f4f50f98ca38832606377b011f4c7d50159b0481fe9075b497d1493b4d40445d8026e115fbae1c970f459d6e8a63a SHA512 528a761a22ee22007de4511a46d97db3cab625622d4f94de5305fbbefb6a5f7582826aae3bcb459f91a3f57d535153b8cb35b692806060ced92655cdf9c81e2a +DIST rust-1.26.2-x86_64-unknown-linux-gnu.tar.xz 138609432 BLAKE2B 54507a8ce3ab2676e6e66852b6d3f1a47ca07ad4b56383f6247149309a0f60f67fbf0a6ba27d968c24340c07d7d5074942c6eaccbc1207c5e75fd9a6f47b2481 SHA512 29e474b0eab4dd2ffa0b964d83f52ffce530e75c4193e307410ef6d20ef9ad2b300a4f467bdf06b3311157340e9295cb9b1efdcf08dafee66979b076c2afba7e +DIST rust-1.26.2-x86_64-unknown-linux-musl.tar.xz 101703244 BLAKE2B d69fafba82b9e98f5c9d45c606a732c1a698141f543f7d8671a715cd95dbb4948def4e8593f7355ec88b0c7aa7199dec65d7af0acec0857095641dab6df19f0c SHA512 563ed60897c5df26a407b288a44bd1d09c53ab08901fe3660426d0744f81ab32c144494af134edeea0f4c915d5844819f5987d9291622cccc7de0691e8eb4a8c DIST rustc-1.25.0-src.tar.xz 56108536 BLAKE2B c4a5e56b0e345b5ccde699f68659ac10793670047d2806bdab856d56aa5b960a0df5b947f7c0a7dadfcb7edbe4f9c1a71a94c5f240e91c93296a90d232030645 SHA512 45baaaa47d8b6433f61b1a6f2637d8f4fe013b534a8a94365025dfcf786815c95111b9bd3beb2544ba8587fb4c8b38431765c4d68bc9c19285da4ccf7c7eeda2 -DIST rustc-1.26.2-src.tar.xz 54613640 BLAKE2B f361b7a0ed40ccb026750b4a70b99931f1abf52024e907b588e339902de2fbbd15501d237ac048d0537005834b0a2f49935f654a8c75d40ed95c65894f611481 SHA512 a598858ddce0e05d1d431be383400f44fc551eb2e368f37b01670c0b65ea5da6a7d5b2b68bb6ef806d2107cfa0d5007008442ad4d5ddb17d18d04e0ab31600b0 +DIST rustc-1.26.2-src.tar.xz 8975336 BLAKE2B 8003e48f406262b7579593219ddec2d34372af6db1a3d4751a3e058ab63a8c7d4a1db5421973c14ef391c244081aec278274e5163cb0cc0acce49d96d83289fa SHA512 9fa421fb682e8fe4b0f01d5dfb1491adb2249ed98060b805c74af222f12b551260f473dca8bd186e1c1d095567b66dc33b812daba80329f607d1a2aa5e3145d5 +DIST rustc-1.27.0-src.tar.xz 55455772 BLAKE2B 5c1b26a3e8c6e45aaa43b3ccb5819089cf03c32807ac1adc46ec4f9ff8cf803ec444587ccb737b5d701c4ef5fa634fc4c89de3d71e6202b64ec125f986e54ffd SHA512 b80af48c637741add1d2846e6e3153b0125fb22ed587036fb9d27ad3961419af64802aa91a79258277b1be20718281558989ea0283db0c482fe1512354ba79d8 diff --git a/dev-lang/rust/files/1.27.0/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch b/dev-lang/rust/files/1.27.0/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch new file mode 100644 index 00000000..bd637734 --- /dev/null +++ b/dev-lang/rust/files/1.27.0/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch @@ -0,0 +1,384 @@ +diff -Naur rustc-1.27.0-src.orig/config.toml.example rustc-1.27.0-src/config.toml.example +--- rustc-1.27.0-src.orig/config.toml.example 2018-06-27 09:52:27.113947671 -0700 ++++ rustc-1.27.0-src/config.toml.example 2018-06-27 09:53:12.820946852 -0700 +@@ -395,12 +395,6 @@ + # only use static libraries. If unset, the target's default linkage is used. + #crt-static = false + +-# The root location of the MUSL installation directory. The library directory +-# will also need to contain libunwind.a for an unwinding implementation. Note +-# that this option only makes sense for MUSL targets that produce statically +-# linked binaries +-#musl-root = "..." +- + # Used in testing for configuring where the QEMU images are located, you + # probably don't want to use this. + #qemu-rootfs = "..." +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/bin/rustc.rs rustc-1.27.0-src/src/bootstrap/bin/rustc.rs +--- rustc-1.27.0-src.orig/src/bootstrap/bin/rustc.rs 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/bin/rustc.rs 2018-06-27 09:53:37.396946412 -0700 +@@ -30,7 +30,6 @@ + extern crate bootstrap; + + use std::env; +-use std::ffi::OsString; + use std::io; + use std::path::PathBuf; + use std::process::Command; +@@ -126,15 +125,6 @@ + cmd.arg("-Cprefer-dynamic"); + } + +- // Help the libc crate compile by assisting it in finding the MUSL +- // native libraries. +- if let Some(s) = env::var_os("MUSL_ROOT") { +- let mut root = OsString::from("native="); +- root.push(&s); +- root.push("/lib"); +- cmd.arg("-L").arg(&root); +- } +- + // Override linker if necessary. + if let Ok(target_linker) = env::var("RUSTC_TARGET_LINKER") { + cmd.arg(format!("-Clinker={}", target_linker)); +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/cc_detect.rs rustc-1.27.0-src/src/bootstrap/cc_detect.rs +--- rustc-1.27.0-src.orig/src/bootstrap/cc_detect.rs 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/cc_detect.rs 2018-06-27 09:55:01.019944915 -0700 +@@ -95,7 +95,7 @@ + if let Some(cc) = config.and_then(|c| c.cc.as_ref()) { + cfg.compiler(cc); + } else { +- set_compiler(&mut cfg, Language::C, target, config, build); ++ set_compiler(&mut cfg, Language::C, target, config); + } + + let compiler = cfg.get_compiler(); +@@ -124,7 +124,7 @@ + if let Some(cxx) = config.and_then(|c| c.cxx.as_ref()) { + cfg.compiler(cxx); + } else { +- set_compiler(&mut cfg, Language::CPlusPlus, host, config, build); ++ set_compiler(&mut cfg, Language::CPlusPlus, host, config); + } + let compiler = cfg.get_compiler(); + build.verbose(&format!("CXX_{} = {:?}", host, compiler.path())); +@@ -135,8 +135,7 @@ + fn set_compiler(cfg: &mut cc::Build, + compiler: Language, + target: Interned, +- config: Option<&Target>, +- build: &Build) { ++ config: Option<&Target>) { + match &*target { + // When compiling for android we may have the NDK configured in the + // config.toml in which case we look there. Otherwise the default +@@ -173,26 +172,6 @@ + } + } + +- "mips-unknown-linux-musl" => { +- if cfg.get_compiler().path().to_str() == Some("gcc") { +- cfg.compiler("mips-linux-musl-gcc"); +- } +- } +- "mipsel-unknown-linux-musl" => { +- if cfg.get_compiler().path().to_str() == Some("gcc") { +- cfg.compiler("mipsel-linux-musl-gcc"); +- } +- } +- +- t if t.contains("musl") => { +- if let Some(root) = build.musl_root(target) { +- let guess = root.join("bin/musl-gcc"); +- if guess.exists() { +- cfg.compiler(guess); +- } +- } +- } +- + _ => {} + } + } +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/compile.rs rustc-1.27.0-src/src/bootstrap/compile.rs +--- rustc-1.27.0-src.orig/src/bootstrap/compile.rs 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/compile.rs 2018-06-27 09:55:41.457944191 -0700 +@@ -78,13 +78,6 @@ + }); + builder.info(&format!("Uplifting stage1 std ({} -> {})", from.host, target)); + +- // Even if we're not building std this stage, the new sysroot must +- // still contain the musl startup objects. +- if target.contains("musl") { +- let libdir = builder.sysroot_libdir(compiler, target); +- copy_musl_third_party_objects(builder, target, &libdir); +- } +- + builder.ensure(StdLink { + compiler: from, + target_compiler: compiler, +@@ -93,11 +86,6 @@ + return; + } + +- if target.contains("musl") { +- let libdir = builder.sysroot_libdir(compiler, target); +- copy_musl_third_party_objects(builder, target, &libdir); +- } +- + let out_dir = builder.cargo_out(compiler, Mode::Libstd, target); + builder.clear_if_dirty(&out_dir, &builder.rustc(compiler)); + let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "build"); +@@ -119,20 +107,6 @@ + } + } + +-/// Copies the crt(1,i,n).o startup objects +-/// +-/// Since musl supports fully static linking, we can cross link for it even +-/// with a glibc-targeting toolchain, given we have the appropriate startup +-/// files. As those shipped with glibc won't work, copy the ones provided by +-/// musl so we have them on linux-gnu hosts. +-fn copy_musl_third_party_objects(builder: &Builder, +- target: Interned, +- into: &Path) { +- for &obj in &["crt1.o", "crti.o", "crtn.o"] { +- builder.copy(&builder.musl_root(target).unwrap().join("lib").join(obj), &into.join(obj)); +- } +-} +- + /// Configure cargo to compile the standard library, adding appropriate env vars + /// and such. + pub fn std_cargo(builder: &Builder, +@@ -187,11 +161,6 @@ + cargo.env("JEMALLOC_OVERRIDE", jemalloc); + } + } +- if target.contains("musl") { +- if let Some(p) = builder.musl_root(target) { +- cargo.env("MUSL_ROOT", p); +- } +- } + } + } + +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/config.rs rustc-1.27.0-src/src/bootstrap/config.rs +--- rustc-1.27.0-src.orig/src/bootstrap/config.rs 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/config.rs 2018-06-27 09:56:06.336943745 -0700 +@@ -129,8 +129,6 @@ + pub save_toolstates: Option, + pub print_step_timings: bool, + +- // Fallback musl-root for all targets +- pub musl_root: Option, + pub prefix: Option, + pub sysconfdir: Option, + pub datadir: Option, +@@ -163,7 +161,6 @@ + pub linker: Option, + pub ndk: Option, + pub crt_static: Option, +- pub musl_root: Option, + pub qemu_rootfs: Option, + pub no_std: bool, + } +@@ -291,7 +288,6 @@ + backtrace: Option, + default_linker: Option, + channel: Option, +- musl_root: Option, + rpath: Option, + optimize_tests: Option, + debuginfo_tests: Option, +@@ -322,7 +318,6 @@ + linker: Option, + android_ndk: Option, + crt_static: Option, +- musl_root: Option, + qemu_rootfs: Option, + } + +@@ -530,7 +525,6 @@ + set(&mut config.lld_enabled, rust.lld); + config.rustc_parallel_queries = rust.experimental_parallel_queries.unwrap_or(false); + config.rustc_default_linker = rust.default_linker.clone(); +- config.musl_root = rust.musl_root.clone().map(PathBuf::from); + config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from); + set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings)); + set(&mut config.backtrace_on_ice, rust.backtrace_on_ice); +@@ -568,7 +562,6 @@ + target.ar = cfg.ar.clone().map(PathBuf::from); + target.linker = cfg.linker.clone().map(PathBuf::from); + target.crt_static = cfg.crt_static.clone(); +- target.musl_root = cfg.musl_root.clone().map(PathBuf::from); + target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from); + + config.target_config.insert(INTERNER.intern_string(triple.clone()), target); +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/configure.py rustc-1.27.0-src/src/bootstrap/configure.py +--- rustc-1.27.0-src.orig/src/bootstrap/configure.py 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/configure.py 2018-06-27 09:56:30.159943318 -0700 +@@ -108,28 +108,6 @@ + "aarch64-linux-android NDK standalone path") + v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk", + "x86_64-linux-android NDK standalone path") +-v("musl-root", "target.x86_64-unknown-linux-musl.musl-root", +- "MUSL root installation directory (deprecated)") +-v("musl-root-x86_64", "target.x86_64-unknown-linux-musl.musl-root", +- "x86_64-unknown-linux-musl install directory") +-v("musl-root-i586", "target.i586-unknown-linux-musl.musl-root", +- "i586-unknown-linux-musl install directory") +-v("musl-root-i686", "target.i686-unknown-linux-musl.musl-root", +- "i686-unknown-linux-musl install directory") +-v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root", +- "arm-unknown-linux-musleabi install directory") +-v("musl-root-armhf", "target.arm-unknown-linux-musleabihf.musl-root", +- "arm-unknown-linux-musleabihf install directory") +-v("musl-root-armv5te", "target.armv5te-unknown-linux-musleabi.musl-root", +- "armv5te-unknown-linux-musleabi install directory") +-v("musl-root-armv7", "target.armv7-unknown-linux-musleabihf.musl-root", +- "armv7-unknown-linux-musleabihf install directory") +-v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root", +- "aarch64-unknown-linux-musl install directory") +-v("musl-root-mips", "target.mips-unknown-linux-musl.musl-root", +- "mips-unknown-linux-musl install directory") +-v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root", +- "mipsel-unknown-linux-musl install directory") + v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs", + "rootfs in qemu testing, you probably don't want to use this") + v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs", +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/lib.rs rustc-1.27.0-src/src/bootstrap/lib.rs +--- rustc-1.27.0-src.orig/src/bootstrap/lib.rs 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/lib.rs 2018-06-27 09:56:40.317943136 -0700 +@@ -751,14 +751,6 @@ + } + } + +- /// Returns the "musl root" for this `target`, if defined +- fn musl_root(&self, target: Interned) -> Option<&Path> { +- self.config.target_config.get(&target) +- .and_then(|t| t.musl_root.as_ref()) +- .or(self.config.musl_root.as_ref()) +- .map(|p| &**p) +- } +- + /// Returns true if this is a no-std `target`, if defined + fn no_std(&self, target: Interned) -> Option { + self.config.target_config.get(&target) +diff -Naur rustc-1.27.0-src.orig/src/bootstrap/sanity.rs rustc-1.27.0-src/src/bootstrap/sanity.rs +--- rustc-1.27.0-src.orig/src/bootstrap/sanity.rs 2018-06-27 09:52:24.438947719 -0700 ++++ rustc-1.27.0-src/src/bootstrap/sanity.rs 2018-06-27 09:57:09.096942621 -0700 +@@ -21,7 +21,7 @@ + use std::collections::HashMap; + use std::env; + use std::ffi::{OsString, OsStr}; +-use std::fs::{self, File}; ++use std::fs::File; + use std::io::Read; + use std::path::PathBuf; + use std::process::Command; +@@ -186,34 +186,6 @@ + } + } + +- // Make sure musl-root is valid +- if target.contains("musl") { +- // If this is a native target (host is also musl) and no musl-root is given, +- // fall back to the system toolchain in /usr before giving up +- if build.musl_root(*target).is_none() && build.config.build == *target { +- let target = build.config.target_config.entry(target.clone()) +- .or_insert(Default::default()); +- target.musl_root = Some("/usr".into()); +- } +- match build.musl_root(*target) { +- Some(root) => { +- if fs::metadata(root.join("lib/libc.a")).is_err() { +- panic!("couldn't find libc.a in musl dir: {}", +- root.join("lib").display()); +- } +- if fs::metadata(root.join("lib/libunwind.a")).is_err() { +- panic!("couldn't find libunwind.a in musl dir: {}", +- root.join("lib").display()); +- } +- } +- None => { +- panic!("when targeting MUSL either the rust.musl-root \ +- option or the target.$TARGET.musl-root option must \ +- be specified in config.toml") +- } +- } +- } +- + if target.contains("msvc") { + // There are three builds of cmake on windows: MSVC, MinGW, and + // Cygwin. The Cygwin build does not have generators for Visual +diff -Naur rustc-1.27.0-src.orig/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile rustc-1.27.0-src/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile +--- rustc-1.27.0-src.orig/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile 2018-06-27 09:52:23.560947734 -0700 ++++ rustc-1.27.0-src/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile 2018-06-27 09:57:22.478942381 -0700 +@@ -30,8 +30,6 @@ + RUN sh /scripts/sccache.sh + + ENV RUST_CONFIGURE_ARGS \ +- --musl-root-i586=/musl-i586 \ +- --musl-root-i686=/musl-i686 \ + --enable-extended \ + --disable-docs + +diff -Naur rustc-1.27.0-src.orig/src/ci/docker/dist-various-1/Dockerfile rustc-1.27.0-src/src/ci/docker/dist-various-1/Dockerfile +--- rustc-1.27.0-src.orig/src/ci/docker/dist-various-1/Dockerfile 2018-06-27 09:52:23.561947734 -0700 ++++ rustc-1.27.0-src/src/ci/docker/dist-various-1/Dockerfile 2018-06-27 09:57:47.163941939 -0700 +@@ -110,13 +110,6 @@ + CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft" + + ENV RUST_CONFIGURE_ARGS \ +- --musl-root-armv5te=/musl-armv5te \ +- --musl-root-arm=/musl-arm \ +- --musl-root-armhf=/musl-armhf \ +- --musl-root-armv7=/musl-armv7 \ +- --musl-root-aarch64=/musl-aarch64 \ +- --musl-root-mips=/musl-mips \ +- --musl-root-mipsel=/musl-mipsel \ + --enable-emscripten \ + --disable-docs + +diff -Naur rustc-1.27.0-src.orig/src/ci/docker/dist-x86_64-musl/Dockerfile rustc-1.27.0-src/src/ci/docker/dist-x86_64-musl/Dockerfile +--- rustc-1.27.0-src.orig/src/ci/docker/dist-x86_64-musl/Dockerfile 2018-06-27 09:52:23.559947734 -0700 ++++ rustc-1.27.0-src/src/ci/docker/dist-x86_64-musl/Dockerfile 2018-06-27 09:58:00.620941698 -0700 +@@ -30,7 +30,6 @@ + RUN sh /scripts/sccache.sh + + ENV RUST_CONFIGURE_ARGS \ +- --musl-root-x86_64=/musl-x86_64 \ + --enable-extended \ + --disable-docs + +diff -Naur rustc-1.27.0-src.orig/src/librustc_target/spec/linux_musl_base.rs rustc-1.27.0-src/src/librustc_target/spec/linux_musl_base.rs +--- rustc-1.27.0-src.orig/src/librustc_target/spec/linux_musl_base.rs 2018-06-27 09:52:22.322947757 -0700 ++++ rustc-1.27.0-src/src/librustc_target/spec/linux_musl_base.rs 2018-06-27 09:59:09.776940460 -0700 +@@ -13,10 +13,6 @@ + pub fn opts() -> TargetOptions { + let mut base = super::linux_base::opts(); + +- // Make sure that the linker/gcc really don't pull in anything, including +- // default objects, libs, etc. +- base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-nostdlib".to_string()); +- + // At least when this was tested, the linker would not add the + // `GNU_EH_FRAME` program header to executables generated, which is required + // when unwinding to locate the unwinding information. I'm not sure why this +@@ -48,17 +44,6 @@ + base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,-(".to_string()); + base.post_link_args.insert(LinkerFlavor::Gcc, vec!["-Wl,-)".to_string()]); + +- // When generating a statically linked executable there's generally some +- // small setup needed which is listed in these files. These are provided by +- // a musl toolchain and are linked by default by the `musl-gcc` script. Note +- // that `gcc` also does this by default, it just uses some different files. +- // +- // Each target directory for musl has these object files included in it so +- // they'll be included from there. +- base.pre_link_objects_exe.push("crt1.o".to_string()); +- base.pre_link_objects_exe.push("crti.o".to_string()); +- base.post_link_objects.push("crtn.o".to_string()); +- + // These targets statically link libc by default + base.crt_static_default = true; + // These targets allow the user to choose between static and dynamic linking. diff --git a/dev-lang/rust/files/1.27.0/0003-Switch-musl-targets-to-link-dynamically-by-default.patch b/dev-lang/rust/files/1.27.0/0003-Switch-musl-targets-to-link-dynamically-by-default.patch new file mode 100644 index 00000000..f0b4b746 --- /dev/null +++ b/dev-lang/rust/files/1.27.0/0003-Switch-musl-targets-to-link-dynamically-by-default.patch @@ -0,0 +1,12 @@ +diff -Naur rustc-1.27.0-src.orig/src/librustc_target/spec/linux_musl_base.rs rustc-1.27.0-src/src/librustc_target/spec/linux_musl_base.rs +--- rustc-1.27.0-src.orig/src/librustc_target/spec/linux_musl_base.rs 2018-06-27 09:52:22.322947757 -0700 ++++ rustc-1.27.0-src/src/librustc_target/spec/linux_musl_base.rs 2018-06-27 10:08:26.989930481 -0700 +@@ -59,8 +59,6 @@ + base.pre_link_objects_exe.push("crti.o".to_string()); + base.post_link_objects.push("crtn.o".to_string()); + +- // These targets statically link libc by default +- base.crt_static_default = true; + // These targets allow the user to choose between static and dynamic linking. + base.crt_static_respected = true; + diff --git a/dev-lang/rust/files/rust-1.27.0-libressl-2.7.0.patch b/dev-lang/rust/files/rust-1.27.0-libressl-2.7.0.patch new file mode 100644 index 00000000..d794284e --- /dev/null +++ b/dev-lang/rust/files/rust-1.27.0-libressl-2.7.0.patch @@ -0,0 +1,24 @@ +--- a/src/vendor/libgit2-sys/libgit2/src/streams/openssl.c 2018-05-07 18:50:07 UTC ++++ b/src/vendor/libgit2-sys/libgit2/src/streams/openssl.c +@@ -104,7 +104,8 @@ int git_openssl_stream_global_init(void) + ssl_opts |= SSL_OP_NO_COMPRESSION; + #endif + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \ ++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) + SSL_load_error_strings(); + OpenSSL_add_ssl_algorithms(); + #else +--- a/src/vendor/libgit2-sys/libgit2/src/streams/openssl.h 2018-05-07 18:50:07 UTC ++++ b/src/vendor/libgit2-sys/libgit2/src/streams/openssl.h +@@ -31,7 +31,8 @@ extern int git_openssl__set_cert_location(const char * + + + +-# if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) ++# if OPENSSL_VERSION_NUMBER < 0x10100000L || \ ++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) + + GIT_INLINE(BIO_METHOD*) BIO_meth_new(int type, const char *name) + { diff --git a/dev-lang/rust/rust-1.27.0.ebuild b/dev-lang/rust/rust-1.27.0.ebuild new file mode 100644 index 00000000..a8758743 --- /dev/null +++ b/dev-lang/rust/rust-1.27.0.ebuild @@ -0,0 +1,355 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +LLVM_MAX_SLOT=6 +PYTHON_COMPAT=( python2_7 python3_{5,6} pypy ) + +inherit llvm multiprocessing multilib-build python-any-r1 versionator toolchain-funcs + +if [[ ${PV} = *beta* ]]; then + betaver=${PV//*beta} + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" + MY_P="rustc-beta" + SLOT="beta/${PV}" + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz" + KEYWORDS="" +else + ABI_VER="$(get_version_component_range 1-2)" + SLOT="stable/${ABI_VER}" + MY_P="rustc-${PV}" + SRC="${MY_P}-src.tar.xz" + KEYWORDS="~amd64 ~arm ~arm64 ~x86" +fi + +RUST_STAGE0_VERSION="1.$(($(get_version_component_range 2) - 1)).2" + +# there is no cargo 0.28 tag, so use 0.27 +CARGO_DEPEND_VERSION="0.$(($(get_version_component_range 2))).0" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" + +SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz + amd64? ( + elibc_glibc? ( https://static.rust-lang.org/dist/rust-${RUST_STAGE0_VERSION}-x86_64-unknown-linux-gnu.tar.xz ) + elibc_musl? ( https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-x86_64-unknown-linux-musl.tar.xz ) + ) + arm? ( + elibc_glibc? ( + https://static.rust-lang.org/dist/rust-${RUST_STAGE0_VERSION}-arm-unknown-linux-gnueabi.tar.xz + https://static.rust-lang.org/dist/rust-${RUST_STAGE0_VERSION}-armv7-unknown-linux-gnueabihf.tar.xz + ) + elibc_musl? ( + https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-arm-unknown-linux-musleabi.tar.xz + https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-armv7-unknown-linux-musleabihf.tar.xz + ) + ) + arm64? ( + elibc_glibc? ( https://static.rust-lang.org/dist/rust-${RUST_STAGE0_VERSION}-aarch64-unknown-linux-gnu.tar.xz ) + elibc_musl? ( https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-aarch64-unknown-linux-musl.tar.xz ) + ) + x86? ( + elibc_glibc? ( https://static.rust-lang.org/dist/rust-${RUST_STAGE0_VERSION}-i686-unknown-linux-gnu.tar.xz ) + elibc_musl? ( https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-i686-unknown-linux-musl.tar.xz ) + ) +" + +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 + NVPTX PowerPC Sparc SystemZ X86 XCore ) +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" + +IUSE="debug doc extended jemalloc libressl system-llvm wasm ${ALL_LLVM_TARGETS[*]}" + +RDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425 + jemalloc? ( dev-libs/jemalloc ) + system-llvm? ( sys-devel/llvm ) + extended? ( + libressl? ( dev-libs/libressl:0= ) + !libressl? ( dev-libs/openssl:0= ) + net-libs/http-parser:0/2.8.0 + net-libs/libssh2:= + net-misc/curl:=[ssl] + sys-libs/zlib:= + !dev-util/rustfmt + !dev-util/cargo + ) +" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + || ( + >=sys-devel/gcc-4.7 + >=sys-devel/clang-3.5 + ) + !system-llvm? ( + dev-util/cmake + dev-util/ninja + ) +" +PDEPEND="!extended? ( >=dev-util/cargo-${CARGO_DEPEND_VERSION} )" + +REQUIRED_USE="!system-llvm? ( || ( ${ALL_LLVM_TARGETS[*]} ) )" + +PATCHES=( + "${FILESDIR}/1.25.0/0001-Require-static-native-libraries-when-linking-static-.patch" + "${FILESDIR}/1.27.0/0002-Remove-nostdlib-and-musl_root-from-musl-targets.patch" + "${FILESDIR}/1.27.0/0003-Switch-musl-targets-to-link-dynamically-by-default.patch" + "${FILESDIR}/1.25.0/0004-Prefer-libgcc_eh-over-libunwind-for-musl.patch" + "${FILESDIR}/1.25.0/0005-Fix-LLVM-build.patch" + "${FILESDIR}/1.25.0/0006-Fix-rustdoc-for-cross-targets.patch" + "${FILESDIR}/1.25.0/0007-Add-openssl-configuration-for-musl-targets.patch" + "${FILESDIR}/1.26.2/0008-Don-t-pass-CFLAGS-to-the-C-compiler.patch" + "${FILESDIR}/1.25.0/0009-liblibc.patch" + "${FILESDIR}/1.25.0/0010-llvm.patch" + "${FILESDIR}/rust-1.27.0-libressl-2.7.0.patch" +) + +S="${WORKDIR}/${MY_P}-src" + +toml_usex() { + usex "$1" true false +} + +rust_host() { + case "${1}" in + arm) + if [[ ${1} == ${DEFAULT_ABI} ]]; then + if [[ ${CHOST} == armv7* ]]; then + RUSTARCH=armv7 + else + RUSTARCH=arm + fi + else + RUSTARCH=arm + fi ;; + amd64) + RUSTARCH=x86_64 ;; + arm64) + RUSTARCH=aarch64 ;; + x86) + RUSTARCH=i686 ;; + esac + case "${1}" in + arm) + if [[ ${1} == ${DEFAULT_ABI} ]]; then + if [[ ${CHOST} == armv7a-hardfloat* ]]; then + RUSTLIBC=${ELIBC/glibc/gnu}eabihf + else + RUSTLIBC=${CHOST##*-} + fi + else + RUSTLIBC=${ELIBC/glibc/gnu} + fi ;; + *) + RUSTLIBC=${ELIBC/glibc/gnu} ;; + esac + RUSTHOST=${RUSTARCH}-unknown-${KERNEL}-${RUSTLIBC} + echo "${RUSTHOST}" +} + +pkg_setup() { + export RUST_BACKTRACE=1 + if use system-llvm; then + llvm_pkg_setup + local llvm_config="$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config" + + export LLVM_LINK_SHARED=1 + export RUSTFLAGS="$RUSTFLAGS -L native=$("$llvm_config" --libdir)" + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + "${WORKDIR}/rust-${RUST_STAGE0_VERSION}-$(rust_host ${ARCH})/install.sh" \ + --destdir="${WORKDIR}/stage0" \ + --prefix=/ \ + --components=rust-std-$(rust_host ${ARCH}),rustc,cargo \ + --disable-ldconfig \ + || die + + default +} + +src_configure() { + local rust_target="" rust_targets="" rust_target_name arch_cflags + + # Collect rust target names to compile standard libs for all ABIs. + for v in $(multilib_get_enabled_abi_pairs); do + rust_targets="${rust_targets},\"$(rust_host ${v##*.})\"" + done + if use wasm; then + rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" + fi + rust_targets="${rust_targets#,}" + + rust_target=$(rust_host $ARCH) + + cat <<- EOF > "${S}"/config.toml + [llvm] + ninja = true + optimize = $(toml_usex !debug) + release-debuginfo = $(toml_usex debug) + assertions = $(toml_usex debug) + targets = "${LLVM_TARGETS// /;}" + [build] + build = "${rust_target}" + host = ["${rust_target}"] + target = [${rust_targets}] + cargo = "${WORKDIR}/stage0/bin/cargo" + rustc = "${WORKDIR}/stage0/bin/rustc" + docs = $(toml_usex doc) + compiler-docs = $(toml_usex doc) + submodules = false + python = "${EPYTHON}" + locked-deps = true + vendor = true + verbose = 2 + extended = $(toml_usex extended) + [install] + prefix = "${EPREFIX}/usr" + libdir = "$(get_libdir)" + docdir = "share/doc/${P}" + mandir = "share/${P}/man" + [rust] + optimize = $(toml_usex !debug) + debuginfo = $(toml_usex debug) + debug-assertions = $(toml_usex debug) + use-jemalloc = $(toml_usex jemalloc) + default-linker = "$(tc-getCC)" + channel = "${SLOT%%/*}" + rpath = false + lld = $(toml_usex wasm) + optimize-tests = $(toml_usex !debug) + dist-src = false + [dist] + src-tarball = false + EOF + + for v in $(multilib_get_enabled_abi_pairs); do + rust_target=$(rust_host ${v##*.}) + arch_cflags="$(get_abi_CFLAGS ${v##*.})" + + cat <<- EOF >> "${S}"/config.env + CFLAGS_${rust_target}=${arch_cflags} + EOF + + cat <<- EOF >> "${S}"/config.toml + [target.${rust_target}] + cc = "$(tc-getBUILD_CC)" + cxx = "$(tc-getBUILD_CXX)" + linker = "$(tc-getCC)" + ar = "$(tc-getAR)" + EOF + + use system-llvm && cat <<- EOF >> "${S}"/config.toml + llvm-config = "$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config" + EOF + done + + if use wasm; then + cat <<- EOF >> "${S}"/config.toml + [target.wasm32-unknown-unknown] + linker = "lld" + EOF + fi +} + +src_compile() { + env $(cat "${S}"/config.env)\ + ./x.py build --verbose --config="${S}"/config.toml -j$(makeopts_jobs) || die +} + +src_install() { + local rust_target abi_libdir + + env DESTDIR="${D}" ./x.py install || die + + mv "${D}/usr/bin/rustc" "${D}/usr/bin/rustc-${PV}" || die + mv "${D}/usr/bin/rustdoc" "${D}/usr/bin/rustdoc-${PV}" || die + mv "${D}/usr/bin/rust-gdb" "${D}/usr/bin/rust-gdb-${PV}" || die + mv "${D}/usr/bin/rust-lldb" "${D}/usr/bin/rust-lldb-${PV}" || die + + # Copy shared library versions of standard libraries for all targets + # into the system's abi-dependent lib directories because the rust + # installer only does so for the native ABI. + for v in $(multilib_get_enabled_abi_pairs); do + if [ ${v##*.} = ${DEFAULT_ABI} ]; then + continue + fi + abi_libdir=$(get_abi_LIBDIR ${v##*.}) + rust_target=$(rust_host ${v##*.}) + mkdir -p "${D}/usr/${abi_libdir}" + cp "${D}/usr/$(get_libdir)/rustlib/${rust_target}/lib"/*.so \ + "${D}/usr/${abi_libdir}" || die + done + + rm "${D}/usr/$(get_libdir)/rustlib/components" || die + rm "${D}/usr/$(get_libdir)/rustlib/install.log" || die + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rust-std-$(rust_host ${ARCH})" || die + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rustc" || die + rm "${D}/usr/$(get_libdir)/rustlib/rust-installer-version" || die + rm "${D}/usr/$(get_libdir)/rustlib/uninstall.sh" || die + + + if use doc; then + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rust-docs" || die + fi + + if use extended; then + rm "${D}/usr/$(get_libdir)/rustlib/manifest-cargo" || die + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rls-preview" || die + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rust-analysis-$(rust_host ${ARCH})" || die + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rust-src" || die + rm "${D}/usr/$(get_libdir)/rustlib/manifest-rustfmt-preview" || die + + rm "${D}/usr/share/doc/${P}/LICENSE-APACHE.old" || die + rm "${D}/usr/share/doc/${P}/LICENSE-MIT.old" || die + fi + + rm "${D}/usr/share/doc/${P}/LICENSE-APACHE" || die + rm "${D}/usr/share/doc/${P}/LICENSE-MIT" || die + + docompress "/usr/share/${P}/man" + + cat <<-EOF > "${T}"/50${P} + MANPATH="/usr/share/${P}/man" + EOF + doenvd "${T}"/50${P} + + cat <<-EOF > "${T}/provider-${P}" + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-lldb + EOF + dodir /etc/env.d/rust + insinto /etc/env.d/rust + doins "${T}/provider-${P}" +} + +pkg_postinst() { + eselect rust update --if-unset + + elog "Rust installs a helper script for calling GDB and LLDB," + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." + + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi + + if has_version 'app-shells/zsh'; then + elog "install app-shells/rust-zshcomp to get zsh completion for rust." + fi +} + +pkg_postrm() { + eselect rust unset --if-invalid +} -- cgit v1.2.3-65-gdbad