commit:     bb3caa60e2f9a6d7a983423bc60b38ea510d398e
Author:     stefson <herrtimson <AT> yahoo <DOT> de>
AuthorDate: Tue Oct 29 21:29:06 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Wed Nov  6 22:57:44 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=bb3caa60

dev-lang/rust: reimport rust-1.34.2 from github.com/smaeul/portage-overlay/

it's old, but uses the now stable llvm-8 and is suitable for building esr
more important: it doesn't suffer from a bug where cflags are bleeding
into the compile env when adding cross compile crates, this makes it a
good base for exploring these unknown waters.

if you're going to use with system-llvm, please check out the nifty
patchset and drop those targeting llvm into /etc/portage/patches/

Signed-off-by: Steffen Kuhn <nielson2 <AT> yandex.com>
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 dev-lang/rust/Manifest                             |   7 +
 .../0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch |  26 ++
 dev-lang/rust/files/0002-Fix-LLVM-build.patch      |  26 ++
 ...tdoc-to-work-when-cross-compiling-on-musl.patch |  36 ++
 ...tic-native-libraries-when-linking-static-.patch |  56 +++
 ...-nostdlib-and-musl_root-from-musl-targets.patch | 388 +++++++++++++++++++++
 ...-Prefer-libgcc_eh-over-libunwind-for-musl.patch |  24 ++
 ...untest-Fix-proc-macro-tests-on-musl-hosts.patch |  37 ++
 ...rect-minimum-system-LLVM-version-in-tests.patch | 206 +++++++++++
 ...-extern-for-plugins-Don-t-assume-multilib.patch |  30 ++
 ...t-crates-are-unstable-Fix-test-when-rpath.patch |  25 ++
 ...11-Ignore-broken-and-non-applicable-tests.patch | 104 ++++++
 ...-Link-stage-2-tools-dynamically-to-libstd.patch |  27 ++
 ...3-Move-debugger-scripts-to-usr-share-rust.patch |  53 +++
 .../rust/files/0014-Add-gentoo-target-specs.patch  | 179 ++++++++++
 dev-lang/rust/files/0030-liblibc-linkage.patch     |  33 ++
 dev-lang/rust/files/0040-rls-atomics.patch         |  58 +++
 dev-lang/rust/files/0050-llvm.patch                |  20 ++
 dev-lang/rust/files/0051-llvm-D45520.patch         | 101 ++++++
 dev-lang/rust/files/0052-llvm-D52013.patch         |  15 +
 dev-lang/rust/files/0053-llvm-secureplt.patch      |  28 ++
 .../files/0060-fix-build-with-libressl-2.9.1.patch |  35 ++
 dev-lang/rust/metadata.xml                         |  17 +
 dev-lang/rust/rust-1.34.2.ebuild                   | 337 ++++++++++++++++++
 24 files changed, 1868 insertions(+)

diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
new file mode 100644
index 0000000..8111391
--- /dev/null
+++ b/dev-lang/rust/Manifest
@@ -0,0 +1,7 @@
+DIST rust-1.33.0-aarch64-gentoo-linux-musl.tar.xz 103260664 BLAKE2B 
2eeecf50ab275abc5679e4be56c3322c1967bbb1926e375910df1d3b5aee042cbb37c56ecede542668a63360bc9db82ec731a927a180399df99b30ff09b70c15
 SHA512 
de9ae088cc4ca76fc619dc8de4fe7f362bc8039c03d9b09ab905b7e551ef0b0fa2d678a984200efddfee542adf5f5a951bd24788a39940bace03d3fe829f4747
+DIST rust-1.33.0-armv7a-unknown-linux-musleabihf.tar.xz 102032976 BLAKE2B 
9f00a004d575962ca3dd3d0d70190210111e9347f35e6858fc30a085495d48a03751645bfdb4940c7db2dc8bf74d08611dfec05fe53e5022e7360ed51c39f33a
 SHA512 
45b5af051663c7ee7ff7c663af57dfbaaa3c9f69dd22c36134534e77a715d1acc101891f4a7e798fcab38e8accd284cc15df35da20552872894bc6da6dab89ff
+DIST rust-1.33.0-i686-gentoo-linux-musl.tar.xz 116133752 BLAKE2B 
a9cf13caa12da6ad20bbcbb592d3fa423eb6f90d50c9af41db17cb2f587d0ef90d19652e75742da49d8e187c8e393137998e384b5d9686cfff28553c7aab1f71
 SHA512 
eaef8169451b02cdee67fe40def8d0ab0d91e527ad4964b8bdafca8677bd2bcea265ba3be5a90c99589b8639ca3e026a540d295a5233f73da873e56e9ffea83f
+DIST rust-1.33.0-powerpc-gentoo-linux-musl.tar.xz 104602692 BLAKE2B 
bef7cacfd7d9e411f18f6b64403c3bdc33bb17270f966aa9cb6ff99e80d8da9bd1346e8c3e3081df7bee3f367d3940b3badd6aeec6859f4a3de75cfeb108de1a
 SHA512 
2314b5d31c9cc31b28a3668ebd4e1a88a4f090c60b141c8e3e4fb06b4c311ef64ab9217acbdb34417e1f3aaf74fda2087ba90ad70075b7197471bf8bfc804370
+DIST rust-1.33.0-powerpc64-gentoo-linux-musl.tar.xz 98455708 BLAKE2B 
fde1ca61ddcfe1091aa2c39ffb9ea47ef4ef2b63557059eeda4df6c90bcf30b22bf09e0bd301d7993d27d18e0c5dbc84db123613a8ac31c68abcb56d1b3892bc
 SHA512 
9dbe37abd4edd519ac3596d405b9af7a4a3de1da56161bed66f9f2f40d505beaa9d7c998c6775d6c86d4e086e5cb085f65702b6be7a182663c1e0c6b2095a242
+DIST rust-1.33.0-x86_64-gentoo-linux-musl.tar.xz 113838416 BLAKE2B 
2d118520a118746ca16aac7b336e03805c3a02df20b2abdd2e9f6a4fcc062c17b0d057347447027287f8fdceeaa34a171835e6f22d45098097b540c97cee23a1
 SHA512 
cd2a6277af99cfaf84f5d293a09e0af9189e1d9148bc4031dd32620f0eb086695e175c6a04e6cceb673af976566114e4a75d42654505d295135a8fc95eb2f850
+DIST rustc-1.34.2-src.tar.xz 95048792 BLAKE2B 
e81e4bfda87ddfb09ab8a74792346970aa440c678d2bb1279c329db4929282f761ada6fea9d81ceeecfd513613025c8e636487626fc36bd0b33559e045bb1b15
 SHA512 
f1bd2b226d90aae8a4657e6117b9a8451d4ce8129f79cc0fce0da7613a3b7800e690bc0ede8fec20a2f5f32c13fa8e22ac97d3838e0d36936793535a75d9c381

diff --git a/dev-lang/rust/files/0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch 
b/dev-lang/rust/files/0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch
new file mode 100644
index 0000000..f4df88e
--- /dev/null
+++ b/dev-lang/rust/files/0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch
@@ -0,0 +1,26 @@
+From 4b5cdf991eb8776927a2730ed73446559856b468 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Wed, 10 Jan 2018 13:36:41 -0600
+Subject: [PATCH 01/14] Don't pass CFLAGS to the C++ compiler
+
+---
+ src/bootstrap/builder.rs | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index a471af2576..f4273729bb 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1068,8 +1068,7 @@ impl<'a> Builder<'a> {
+             if let Ok(cxx) = self.cxx(target) {
+                 let cxx = ccacheify(&cxx);
+                 cargo
+-                    .env(format!("CXX_{}", target), &cxx)
+-                    .env(format!("CXXFLAGS_{}", target), cflags);
++                    .env(format!("CXX_{}", target), &cxx);
+             }
+         }
+ 
+-- 
+2.21.0
+

diff --git a/dev-lang/rust/files/0002-Fix-LLVM-build.patch 
b/dev-lang/rust/files/0002-Fix-LLVM-build.patch
new file mode 100644
index 0000000..0a8ecec
--- /dev/null
+++ b/dev-lang/rust/files/0002-Fix-LLVM-build.patch
@@ -0,0 +1,26 @@
+From 22fac16a9a1651eb9ac121761583ff6031a15077 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Fri, 8 Sep 2017 00:04:29 -0500
+Subject: [PATCH 02/14] Fix LLVM build
+
+---
+ src/bootstrap/lib.rs | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
+index 7e6fbdff12..f1e7f05aa9 100644
+--- a/src/bootstrap/lib.rs
++++ b/src/bootstrap/lib.rs
+@@ -764,7 +764,8 @@ impl Build {
+         // cc-rs because the build scripts will determine that for themselves.
+         let mut base = self.cc[&target].args().iter()
+                            .map(|s| s.to_string_lossy().into_owned())
+-                           .filter(|s| !s.starts_with("-O") && 
!s.starts_with("/O"))
++                           .filter(|s| !s.starts_with("-O") && 
!s.starts_with("/O")
++                                   && !s.starts_with("-static"))
+                            .collect::<Vec<String>>();
+ 
+         // If we're compiling on macOS then we add a few unconditional flags
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
 
b/dev-lang/rust/files/0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
new file mode 100644
index 0000000..087dea2
--- /dev/null
+++ 
b/dev-lang/rust/files/0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -0,0 +1,36 @@
+From c4565fab697249c4233c97f7855fe692a5a880a4 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Sat, 2 Dec 2017 17:25:44 -0600
+Subject: [PATCH 03/14] Allow rustdoc to work when cross-compiling on musl
+
+musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
+---
+ src/bootstrap/bin/rustdoc.rs | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
+index 52b5971f0a..c779e35e26 100644
+--- a/src/bootstrap/bin/rustdoc.rs
++++ b/src/bootstrap/bin/rustdoc.rs
+@@ -23,9 +23,6 @@ fn main() {
+         Err(_) => 0,
+     };
+ 
+-    let mut dylib_path = bootstrap::util::dylib_path();
+-    dylib_path.insert(0, PathBuf::from(libdir.clone()));
+-
+     //FIXME(misdreavus): once stdsimd uses cfg(rustdoc) instead of cfg(dox), 
remove the `--cfg dox`
+     //arguments here
+     let mut cmd = Command::new(rustdoc);
+@@ -37,7 +34,7 @@ fn main() {
+         .arg("--sysroot")
+         .arg(sysroot)
+         .env(bootstrap::util::dylib_path_var(),
+-             env::join_paths(&dylib_path).unwrap());
++             PathBuf::from(libdir.clone()));
+ 
+     // Force all crates compiled by this compiler to (a) be unstable and (b)
+     // allow the `rustc_private` feature to link to other unstable crates
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0004-Require-static-native-libraries-when-linking-static-.patch
 
b/dev-lang/rust/files/0004-Require-static-native-libraries-when-linking-static-.patch
new file mode 100644
index 0000000..6238e50
--- /dev/null
+++ 
b/dev-lang/rust/files/0004-Require-static-native-libraries-when-linking-static-.patch
@@ -0,0 +1,56 @@
+From 859624e56281aff33673dcceb34698bd30eceea3 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Fri, 8 Sep 2017 00:05:18 -0500
+Subject: [PATCH 04/14] Require static native libraries when linking static
+ executables
+
+On ELF targets like Linux, gcc/ld will create a dynamically-linked
+executable without warning, even when passed `-static`, when asked to
+link to a `.so`. Avoid this confusing and unintended behavior by always
+using the static version of libraries when trying to link static
+executables.
+
+Fixes #54243
+---
+ src/librustc_codegen_llvm/back/link.rs | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/src/librustc_codegen_llvm/back/link.rs 
b/src/librustc_codegen_llvm/back/link.rs
+index 819f7f9410..49adc5dfca 100644
+--- a/src/librustc_codegen_llvm/back/link.rs
++++ b/src/librustc_codegen_llvm/back/link.rs
+@@ -1413,9 +1413,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker,
+     }
+ }
+ 
+-// Link in all of our upstream crates' native dependencies. Remember that
+-// all of these upstream native dependencies are all non-static
+-// dependencies. We've got two cases then:
++// Link in all of our upstream crates' native dependencies. We have two cases:
+ //
+ // 1. The upstream crate is an rlib. In this case we *must* link in the
+ // native dependency because the rlib is just an archive.
+@@ -1458,7 +1456,19 @@ fn add_upstream_native_libraries(cmd: &mut dyn Linker,
+                 continue
+             }
+             match lib.kind {
+-                NativeLibraryKind::NativeUnknown => 
cmd.link_dylib(&name.as_str()),
++                NativeLibraryKind::NativeUnknown => {
++                    // On some targets, like Linux, linking a static 
executable inhibits using
++                    // dylibs at all. Force native libraries to be static, 
even if for example
++                    // an upstream rlib was originally linked against a 
native shared library.
++                    if crate_type == config::CrateType::Executable
++                        && sess.crt_static()
++                        && 
!sess.target.target.options.crt_static_allows_dylibs
++                    {
++                        cmd.link_staticlib(&name.as_str())
++                    } else {
++                        cmd.link_dylib(&name.as_str())
++                    }
++                },
+                 NativeLibraryKind::NativeFramework => 
cmd.link_framework(&name.as_str()),
+                 NativeLibraryKind::NativeStaticNobundle => {
+                     // Link "static-nobundle" native libs only if the crate 
they originate from
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch
 
b/dev-lang/rust/files/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch
new file mode 100644
index 0000000..b8ca293
--- /dev/null
+++ 
b/dev-lang/rust/files/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch
@@ -0,0 +1,388 @@
+From d84f9863017bd4bb38c5a2063c679dc3132ecf28 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Fri, 8 Sep 2017 22:11:14 -0500
+Subject: [PATCH 05/14] Remove -nostdlib and musl_root from musl targets
+
+---
+ config.toml.example                           |  6 ----
+ src/bootstrap/bin/rustc.rs                    | 12 --------
+ src/bootstrap/cc_detect.rs                    | 27 ++----------------
+ src/bootstrap/compile.rs                      | 21 --------------
+ src/bootstrap/config.rs                       |  7 -----
+ src/bootstrap/configure.py                    | 22 ---------------
+ src/bootstrap/lib.rs                          |  8 ------
+ src/bootstrap/sanity.rs                       | 28 -------------------
+ .../dist-i586-gnu-i586-i686-musl/Dockerfile   |  2 --
+ src/ci/docker/dist-various-1/Dockerfile       |  7 -----
+ src/ci/docker/dist-x86_64-musl/Dockerfile     |  1 -
+ src/librustc_target/spec/linux_musl_base.rs   | 16 -----------
+ 12 files changed, 3 insertions(+), 154 deletions(-)
+
+diff --git a/config.toml.example b/config.toml.example
+index f45db37c33..50692bf74a 100644
+--- a/config.toml.example
++++ b/config.toml.example
+@@ -470,12 +470,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 --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
+index b6afe317a0..0eace41a5a 100644
+--- a/src/bootstrap/bin/rustc.rs
++++ b/src/bootstrap/bin/rustc.rs
+@@ -18,7 +18,6 @@
+ #![deny(warnings)]
+ 
+ use std::env;
+-use std::ffi::OsString;
+ use std::io;
+ use std::path::PathBuf;
+ use std::process::Command;
+@@ -114,17 +113,6 @@ fn main() {
+             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") {
+-            if target.contains("musl") {
+-                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 --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
+index dfc243b705..848d1d4b2b 100644
+--- a/src/bootstrap/cc_detect.rs
++++ b/src/bootstrap/cc_detect.rs
+@@ -84,7 +84,7 @@ pub fn find(build: &mut Build) {
+         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();
+@@ -113,7 +113,7 @@ pub fn find(build: &mut Build) {
+         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()));
+@@ -124,8 +124,7 @@ pub fn find(build: &mut Build) {
+ fn set_compiler(cfg: &mut cc::Build,
+                 compiler: Language,
+                 target: Interned<String>,
+-                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
+@@ -165,26 +164,6 @@ fn set_compiler(cfg: &mut cc::Build,
+             }
+         }
+ 
+-        "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 --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
+index 249a183189..bfc62c762a 100644
+--- a/src/bootstrap/compile.rs
++++ b/src/bootstrap/compile.rs
+@@ -114,21 +114,6 @@ impl Step for Std {
+ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, 
target: Interned<String>) {
+     let libdir = builder.sysroot_libdir(*compiler, target);
+ 
+-    // 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.
+-    if target.contains("musl") {
+-        for &obj in &["crt1.o", "crti.o", "crtn.o"] {
+-            builder.copy(
+-                &builder.musl_root(target).unwrap().join("lib").join(obj),
+-                &libdir.join(obj),
+-            );
+-        }
+-    }
+-
+     // Copies libunwind.a compiled to be linked wit 
x86_64-fortanix-unknown-sgx.
+     //
+     // This target needs to be linked to Fortanix's port of llvm's libunwind.
+@@ -182,12 +167,6 @@ pub fn std_cargo(builder: &Builder<'_>,
+         cargo.arg("--features").arg(features)
+             .arg("--manifest-path")
+             .arg(builder.src.join("src/libstd/Cargo.toml"));
+-
+-        if target.contains("musl") {
+-            if let Some(p) = builder.musl_root(target) {
+-                cargo.env("MUSL_ROOT", p);
+-            }
+-        }
+     }
+ }
+ 
+diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
+index 7d3e584f1a..3f0113e11a 100644
+--- a/src/bootstrap/config.rs
++++ b/src/bootstrap/config.rs
+@@ -132,8 +132,6 @@ pub struct Config {
+     pub print_step_timings: bool,
+     pub missing_tools: bool,
+ 
+-    // Fallback musl-root for all targets
+-    pub musl_root: Option<PathBuf>,
+     pub prefix: Option<PathBuf>,
+     pub sysconfdir: Option<PathBuf>,
+     pub datadir: Option<PathBuf>,
+@@ -168,7 +166,6 @@ pub struct Target {
+     pub linker: Option<PathBuf>,
+     pub ndk: Option<PathBuf>,
+     pub crt_static: Option<bool>,
+-    pub musl_root: Option<PathBuf>,
+     pub qemu_rootfs: Option<PathBuf>,
+     pub no_std: bool,
+ }
+@@ -304,7 +301,6 @@ struct Rust {
+     backtrace: Option<bool>,
+     default_linker: Option<String>,
+     channel: Option<String>,
+-    musl_root: Option<String>,
+     rpath: Option<bool>,
+     optimize_tests: Option<bool>,
+     debuginfo_tests: Option<bool>,
+@@ -343,7 +339,6 @@ struct TomlTarget {
+     linker: Option<String>,
+     android_ndk: Option<String>,
+     crt_static: Option<bool>,
+-    musl_root: Option<String>,
+     qemu_rootfs: Option<String>,
+ }
+ 
+@@ -562,7 +557,6 @@ impl Config {
+             set(&mut config.llvm_tools_enabled, rust.llvm_tools);
+             config.rustc_parallel = rust.parallel_compiler.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);
+@@ -605,7 +599,6 @@ impl Config {
+                 target.ranlib = cfg.ranlib.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 --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
+index b2d8f2d8eb..c3bb94938f 100755
+--- a/src/bootstrap/configure.py
++++ b/src/bootstrap/configure.py
+@@ -109,28 +109,6 @@ v("aarch64-linux-android-ndk", 
"target.aarch64-linux-android.android-ndk",
+   "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 --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
+index f1e7f05aa9..4ee1444db3 100644
+--- a/src/bootstrap/lib.rs
++++ b/src/bootstrap/lib.rs
+@@ -842,14 +842,6 @@ impl Build {
+         }
+     }
+ 
+-    /// Returns the "musl root" for this `target`, if defined
+-    fn musl_root(&self, target: Interned<String>) -> 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<String>) -> Option<bool> {
+         self.config.target_config.get(&target)
+diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
+index ff4fb85bbf..ff45200bde 100644
+--- a/src/bootstrap/sanity.rs
++++ b/src/bootstrap/sanity.rs
+@@ -169,34 +169,6 @@ pub fn check(build: &mut Build) {
+             }
+         }
+ 
+-        // 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_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 --git a/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile 
b/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
+index ba2d32a929..412c37fdd1 100644
+--- a/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
++++ b/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
+@@ -30,8 +30,6 @@ COPY scripts/sccache.sh /scripts/
+ RUN sh /scripts/sccache.sh
+ 
+ ENV RUST_CONFIGURE_ARGS \
+-      --musl-root-i586=/musl-i586 \
+-      --musl-root-i686=/musl-i686 \
+       --enable-extended \
+       --disable-docs
+ 
+diff --git a/src/ci/docker/dist-various-1/Dockerfile 
b/src/ci/docker/dist-various-1/Dockerfile
+index f80293b182..52f28df826 100644
+--- a/src/ci/docker/dist-various-1/Dockerfile
++++ b/src/ci/docker/dist-various-1/Dockerfile
+@@ -130,13 +130,6 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc 
\
+     CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
+     
+ 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 --git a/src/ci/docker/dist-x86_64-musl/Dockerfile 
b/src/ci/docker/dist-x86_64-musl/Dockerfile
+index 06f8a2fbba..f5dd379528 100644
+--- a/src/ci/docker/dist-x86_64-musl/Dockerfile
++++ b/src/ci/docker/dist-x86_64-musl/Dockerfile
+@@ -30,7 +30,6 @@ COPY scripts/sccache.sh /scripts/
+ RUN sh /scripts/sccache.sh
+ 
+ ENV RUST_CONFIGURE_ARGS \
+-      --musl-root-x86_64=/musl-x86_64 \
+       --enable-extended \
+       --disable-docs
+ 
+diff --git a/src/librustc_target/spec/linux_musl_base.rs 
b/src/librustc_target/spec/linux_musl_base.rs
+index e294e63982..58ae91a96a 100644
+--- a/src/librustc_target/spec/linux_musl_base.rs
++++ b/src/librustc_target/spec/linux_musl_base.rs
+@@ -3,28 +3,12 @@ use crate::spec::{LinkerFlavor, TargetOptions};
+ 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_crt.insert(LinkerFlavor::Gcc, Vec::new());
+-    
base.pre_link_args_crt.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
+     // argument is *not* necessary for normal builds, but it can't hurt!
+     
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".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_crt.push("crt1.o".to_string());
+-    base.pre_link_objects_exe_crt.push("crti.o".to_string());
+-    base.post_link_objects_crt.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.
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch 
b/dev-lang/rust/files/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch
new file mode 100644
index 0000000..ea8a7a0
--- /dev/null
+++ b/dev-lang/rust/files/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch
@@ -0,0 +1,24 @@
+From af88a145ea4fbcda9f1d16a53a341282d2129b07 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/14] Prefer libgcc_eh over libunwind for musl
+
+---
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
+index 0ccffea317..935175dd8d 100644
+--- a/src/libunwind/lib.rs
++++ b/src/libunwind/lib.rs
+@@ -26,6 +26,6 @@ cfg_if! {
+ }
+ 
+ #[cfg(target_env = "musl")]
+-#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
++#[link(name = "gcc_eh", cfg(target_feature = "crt-static"))]
+ #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
+ extern {}
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0007-runtest-Fix-proc-macro-tests-on-musl-hosts.patch 
b/dev-lang/rust/files/0007-runtest-Fix-proc-macro-tests-on-musl-hosts.patch
new file mode 100644
index 0000000..06eebb9
--- /dev/null
+++ b/dev-lang/rust/files/0007-runtest-Fix-proc-macro-tests-on-musl-hosts.patch
@@ -0,0 +1,37 @@
+From a7c6bcd4834952f3f5b0483dd71b47407d9fb186 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Sun, 16 Sep 2018 16:40:04 +0000
+Subject: [PATCH 07/14] runtest: Fix proc-macro tests on musl hosts
+
+---
+ src/tools/compiletest/src/runtest.rs | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/src/tools/compiletest/src/runtest.rs 
b/src/tools/compiletest/src/runtest.rs
+index 7781ce74f4..5d73545b1f 100644
+--- a/src/tools/compiletest/src/runtest.rs
++++ b/src/tools/compiletest/src/runtest.rs
+@@ -1604,7 +1604,6 @@ impl<'test> TestCx<'test> {
+                 None
+             } else if self.config.target.contains("cloudabi")
+                 || self.config.target.contains("emscripten")
+-                || (self.config.target.contains("musl") && 
!aux_props.force_host)
+                 || self.config.target.contains("wasm32")
+             {
+                 // We primarily compile all auxiliary libraries as dynamic 
libraries
+@@ -1612,10 +1611,8 @@ impl<'test> TestCx<'test> {
+                 // for the test suite (otherwise including libstd statically 
in all
+                 // executables takes up quite a bit of space).
+                 //
+-                // For targets like MUSL or Emscripten, however, there is no 
support for
+-                // dynamic libraries so we just go back to building a normal 
library. Note,
+-                // however, that for MUSL if the library is built with 
`force_host` then
+-                // it's ok to be a dylib as the host should always support 
dylibs.
++                // For targets like Emscripten, however, there is no support 
for
++                // dynamic libraries so we just go back to building a normal 
library.
+                 Some("lib")
+             } else {
+                 Some("dylib")
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0008-Correct-minimum-system-LLVM-version-in-tests.patch 
b/dev-lang/rust/files/0008-Correct-minimum-system-LLVM-version-in-tests.patch
new file mode 100644
index 0000000..1da2bec
--- /dev/null
+++ 
b/dev-lang/rust/files/0008-Correct-minimum-system-LLVM-version-in-tests.patch
@@ -0,0 +1,206 @@
+From b038aa4b514a520c3ad2a6ab0e518cb8d45c4ca0 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Fri, 22 Mar 2019 17:08:06 -0500
+Subject: [PATCH 08/14] Correct minimum system LLVM version in tests
+
+Since commit 9452a8dfa3ba, the new debug info format is only generated
+for LLVM 8 and newer versions. However, the tests still assume that LLVM
+7 will use the new debug info format. Fix the tests (and a comment in
+the code) to match the actual version check.
+---
+ src/librustc_codegen_llvm/debuginfo/metadata.rs           | 8 +++++---
+ src/test/codegen/enum-debug-clike.rs                      | 2 +-
+ src/test/codegen/enum-debug-niche-2.rs                    | 2 +-
+ src/test/codegen/enum-debug-niche.rs                      | 2 +-
+ src/test/codegen/enum-debug-tagged.rs                     | 2 +-
+ src/test/debuginfo/borrowed-enum.rs                       | 2 +-
+ .../debuginfo/generic-enum-with-different-disr-sizes.rs   | 2 +-
+ src/test/debuginfo/generic-struct-style-enum.rs           | 2 +-
+ src/test/debuginfo/generic-tuple-style-enum.rs            | 2 +-
+ src/test/debuginfo/recursive-struct.rs                    | 2 +-
+ src/test/debuginfo/struct-style-enum.rs                   | 2 +-
+ src/test/debuginfo/tuple-style-enum.rs                    | 2 +-
+ src/test/debuginfo/unique-enum.rs                         | 2 +-
+ 13 files changed, 17 insertions(+), 15 deletions(-)
+
+diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs 
b/src/librustc_codegen_llvm/debuginfo/metadata.rs
+index ddcbf29da8..8efa025e3d 100644
+--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
++++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
+@@ -1156,12 +1156,14 @@ fn prepare_union_metadata(
+ // Enums
+ 
//=-----------------------------------------------------------------------------
+ 
+-// DWARF variant support is only available starting in LLVM 7.
++// DWARF variant support is only available starting in LLVM 8.
+ // Although the earlier enum debug info output did not work properly
+ // in all situations, it is better for the time being to continue to
+ // sometimes emit the old style rather than emit something completely
+-// useless when rust is compiled against LLVM 6 or older.  This
+-// function decides which representation will be emitted.
++// useless when rust is compiled against LLVM 6 or older. LLVM 7
++// contains an early version of the DWARF variant support, and will
++// crash when handling the new debug info format. This function
++// decides which representation will be emitted.
+ fn use_enum_fallback(cx: &CodegenCx<'_, '_>) -> bool {
+     // On MSVC we have to use the fallback mode, because LLVM doesn't
+     // lower variant parts to PDB.
+diff --git a/src/test/codegen/enum-debug-clike.rs 
b/src/test/codegen/enum-debug-clike.rs
+index 62cfef5a84..f268c8bcbc 100644
+--- a/src/test/codegen/enum-debug-clike.rs
++++ b/src/test/codegen/enum-debug-clike.rs
+@@ -4,7 +4,7 @@
+ 
+ // ignore-tidy-linelength
+ // ignore-windows
+-// min-system-llvm-version 7.0
++// min-system-llvm-version 8.0
+ 
+ // compile-flags: -g -C no-prepopulate-passes
+ 
+diff --git a/src/test/codegen/enum-debug-niche-2.rs 
b/src/test/codegen/enum-debug-niche-2.rs
+index 369fa1fcfd..aa6cbf66b4 100644
+--- a/src/test/codegen/enum-debug-niche-2.rs
++++ b/src/test/codegen/enum-debug-niche-2.rs
+@@ -4,7 +4,7 @@
+ 
+ // ignore-tidy-linelength
+ // ignore-windows
+-// min-system-llvm-version 7.0
++// min-system-llvm-version 8.0
+ 
+ // compile-flags: -g -C no-prepopulate-passes
+ 
+diff --git a/src/test/codegen/enum-debug-niche.rs 
b/src/test/codegen/enum-debug-niche.rs
+index 1273a785ba..93eebde7b8 100644
+--- a/src/test/codegen/enum-debug-niche.rs
++++ b/src/test/codegen/enum-debug-niche.rs
+@@ -4,7 +4,7 @@
+ 
+ // ignore-tidy-linelength
+ // ignore-windows
+-// min-system-llvm-version 7.0
++// min-system-llvm-version 8.0
+ 
+ // compile-flags: -g -C no-prepopulate-passes
+ 
+diff --git a/src/test/codegen/enum-debug-tagged.rs 
b/src/test/codegen/enum-debug-tagged.rs
+index 5c37e40c27..84976ce97a 100644
+--- a/src/test/codegen/enum-debug-tagged.rs
++++ b/src/test/codegen/enum-debug-tagged.rs
+@@ -4,7 +4,7 @@
+ 
+ // ignore-tidy-linelength
+ // ignore-windows
+-// min-system-llvm-version 7.0
++// min-system-llvm-version 8.0
+ 
+ // compile-flags: -g -C no-prepopulate-passes
+ 
+diff --git a/src/test/debuginfo/borrowed-enum.rs 
b/src/test/debuginfo/borrowed-enum.rs
+index e27a31dd0e..63c11f59c1 100644
+--- a/src/test/debuginfo/borrowed-enum.rs
++++ b/src/test/debuginfo/borrowed-enum.rs
+@@ -1,7 +1,7 @@
+ // ignore-tidy-linelength
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb or lldb that can read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ // rust-lldb
+ 
+diff --git a/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 
b/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
+index 9392aa7097..e26294cb73 100644
+--- a/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
++++ b/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
+@@ -3,7 +3,7 @@
+ // min-lldb-version: 310
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ 
+ // compile-flags:-g
+diff --git a/src/test/debuginfo/generic-struct-style-enum.rs 
b/src/test/debuginfo/generic-struct-style-enum.rs
+index 3e59347030..3dc5cb807b 100644
+--- a/src/test/debuginfo/generic-struct-style-enum.rs
++++ b/src/test/debuginfo/generic-struct-style-enum.rs
+@@ -2,7 +2,7 @@
+ // min-lldb-version: 310
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ 
+ // compile-flags:-g
+diff --git a/src/test/debuginfo/generic-tuple-style-enum.rs 
b/src/test/debuginfo/generic-tuple-style-enum.rs
+index 3c136add07..b16634ee6d 100644
+--- a/src/test/debuginfo/generic-tuple-style-enum.rs
++++ b/src/test/debuginfo/generic-tuple-style-enum.rs
+@@ -2,7 +2,7 @@
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
+ // read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ // rust-lldb
+ 
+diff --git a/src/test/debuginfo/recursive-struct.rs 
b/src/test/debuginfo/recursive-struct.rs
+index c3d2bea913..8fb83b7956 100644
+--- a/src/test/debuginfo/recursive-struct.rs
++++ b/src/test/debuginfo/recursive-struct.rs
+@@ -2,7 +2,7 @@
+ // ignore-lldb
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ 
+ // compile-flags:-g
+diff --git a/src/test/debuginfo/struct-style-enum.rs 
b/src/test/debuginfo/struct-style-enum.rs
+index 1654c93209..5843b076b1 100644
+--- a/src/test/debuginfo/struct-style-enum.rs
++++ b/src/test/debuginfo/struct-style-enum.rs
+@@ -2,7 +2,7 @@
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
+ // read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ // rust-lldb
+ 
+diff --git a/src/test/debuginfo/tuple-style-enum.rs 
b/src/test/debuginfo/tuple-style-enum.rs
+index fd76bcb0af..4d9727a388 100644
+--- a/src/test/debuginfo/tuple-style-enum.rs
++++ b/src/test/debuginfo/tuple-style-enum.rs
+@@ -2,7 +2,7 @@
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
+ // read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ // rust-lldb
+ 
+diff --git a/src/test/debuginfo/unique-enum.rs 
b/src/test/debuginfo/unique-enum.rs
+index da0d06213e..32bd93f1ed 100644
+--- a/src/test/debuginfo/unique-enum.rs
++++ b/src/test/debuginfo/unique-enum.rs
+@@ -2,7 +2,7 @@
+ 
+ // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
+ // read it.
+-// min-system-llvm-version: 7.0
++// min-system-llvm-version: 8.0
+ // min-gdb-version: 8.2
+ // rust-lldb
+ 
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0009-test-use-extern-for-plugins-Don-t-assume-multilib.patch
 
b/dev-lang/rust/files/0009-test-use-extern-for-plugins-Don-t-assume-multilib.patch
new file mode 100644
index 0000000..121e3c8
--- /dev/null
+++ 
b/dev-lang/rust/files/0009-test-use-extern-for-plugins-Don-t-assume-multilib.patch
@@ -0,0 +1,30 @@
+From ecfd3927df50b811ef1dff61abbdeed15daf7cd2 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Sat, 6 Oct 2018 04:01:48 +0000
+Subject: [PATCH 09/14] test/use-extern-for-plugins: Don't assume multilib
+
+---
+ src/test/run-make-fulldeps/use-extern-for-plugins/Makefile | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile 
b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
+index 3976da3113..567a8d3157 100644
+--- a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
++++ b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
+@@ -5,12 +5,7 @@
+ # ignore-bitrig
+ # ignore-sunos
+ 
+-HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
+-ifeq ($(findstring i686,$(HOST)),i686)
+-TARGET := $(subst i686,x86_64,$(HOST))
+-else
+-TARGET := $(subst x86_64,i686,$(HOST))
+-endif
++TARGET := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
+ 
+ all:
+       $(RUSTC) foo.rs -C extra-filename=-host
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0010-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
 
b/dev-lang/rust/files/0010-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
new file mode 100644
index 0000000..029544a
--- /dev/null
+++ 
b/dev-lang/rust/files/0010-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
@@ -0,0 +1,25 @@
+From 91e0c28a5642ef1eead598910e4a6bff071c9a4d Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Mon, 17 Sep 2018 01:32:20 +0000
+Subject: [PATCH 10/14] test/sysroot-crates-are-unstable: Fix test when rpath
+ is disabled
+
+Without this environment var, the test can't run rustc to find
+the sysroot path.
+---
+ .../run-make-fulldeps/sysroot-crates-are-unstable/Makefile    | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile 
b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+index a35174b3c2..9e77070685 100644
+--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
++++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+@@ -1,2 +1,4 @@
++-include ../tools.mk
++
+ all:
+-      python2.7 test.py
++      env '$(HOST_RPATH_ENV)' python2.7 test.py
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0011-Ignore-broken-and-non-applicable-tests.patch 
b/dev-lang/rust/files/0011-Ignore-broken-and-non-applicable-tests.patch
new file mode 100644
index 0000000..59d6b71
--- /dev/null
+++ b/dev-lang/rust/files/0011-Ignore-broken-and-non-applicable-tests.patch
@@ -0,0 +1,104 @@
+From 0495caf6d9c4745ba3cedbdbb4dd690571e1cec0 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Sun, 16 Sep 2018 16:38:48 +0000
+Subject: [PATCH 11/14] Ignore broken and non-applicable tests
+
+c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, #56475
+env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
+long-linker-command-lines: takes >10 minutes to run (but still passes)
+simd-intrinsic-generic-bitmask.rs: broken on BE, #59356
+simd-intrinsic-generic-select.rs: broken on BE, #59356
+sparc-struct-abi: no sparc target
+sysroot-crates-are-unstable: can't run rustc without RPATH
+---
+ src/test/codegen/sparc-struct-abi.rs                            | 1 +
+ src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile   | 2 ++
+ src/test/run-make-fulldeps/long-linker-command-lines/Makefile   | 2 ++
+ src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 2 ++
+ src/test/run-pass/env-funky-keys.rs                             | 1 +
+ src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs        | 2 ++
+ src/test/run-pass/simd/simd-intrinsic-generic-select.rs         | 2 ++
+ 7 files changed, 12 insertions(+)
+
+diff --git a/src/test/codegen/sparc-struct-abi.rs 
b/src/test/codegen/sparc-struct-abi.rs
+index 78e5b14a21..6f93e93286 100644
+--- a/src/test/codegen/sparc-struct-abi.rs
++++ b/src/test/codegen/sparc-struct-abi.rs
+@@ -4,6 +4,7 @@
+ 
+ // only-sparc64
+ // compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib
++// ignore-test
+ #![feature(no_core, lang_items)]
+ #![no_core]
+ 
+diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile 
b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
+index f124ca2ab6..363b18f098 100644
+--- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
++++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
+@@ -1,3 +1,5 @@
++# ignore-aarch64
++
+ -include ../tools.mk
+ 
+ all:
+diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile 
b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
+index 5876fbc94b..5f167ece1a 100644
+--- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
++++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
+@@ -1,3 +1,5 @@
++# ignore-test
++
+ -include ../tools.mk
+ 
+ all:
+diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile 
b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+index 9e77070685..6d92ec5cec 100644
+--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
++++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+@@ -1,3 +1,5 @@
++# ignore-test
++
+ -include ../tools.mk
+ 
+ all:
+diff --git a/src/test/run-pass/env-funky-keys.rs 
b/src/test/run-pass/env-funky-keys.rs
+index 79f32bd6c2..fc171687c9 100644
+--- a/src/test/run-pass/env-funky-keys.rs
++++ b/src/test/run-pass/env-funky-keys.rs
+@@ -1,5 +1,6 @@
+ // Ignore this test on Android, because it segfaults there.
+ 
++// ignore-test
+ // ignore-android
+ // ignore-windows
+ // ignore-cloudabi no execve
+diff --git a/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs 
b/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs
+index b28f742a92..3ee4ccce73 100644
+--- a/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs
++++ b/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs
+@@ -2,6 +2,8 @@
+ #![allow(non_camel_case_types)]
+ 
+ // ignore-emscripten
++// ignore-powerpc
++// ignore-powerpc64
+ 
+ // Test that the simd_bitmask intrinsic produces correct results.
+ 
+diff --git a/src/test/run-pass/simd/simd-intrinsic-generic-select.rs 
b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs
+index f79b140494..39080c8c90 100644
+--- a/src/test/run-pass/simd/simd-intrinsic-generic-select.rs
++++ b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs
+@@ -2,6 +2,8 @@
+ #![allow(non_camel_case_types)]
+ 
+ // ignore-emscripten
++// ignore-powerpc
++// ignore-powerpc64
+ 
+ // Test that the simd_select intrinsics produces correct results.
+ 
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0012-Link-stage-2-tools-dynamically-to-libstd.patch 
b/dev-lang/rust/files/0012-Link-stage-2-tools-dynamically-to-libstd.patch
new file mode 100644
index 0000000..e4cac48
--- /dev/null
+++ b/dev-lang/rust/files/0012-Link-stage-2-tools-dynamically-to-libstd.patch
@@ -0,0 +1,27 @@
+From d7e94a443cd0876d384ccbc36a6eb21cfc3636d4 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Mon, 24 Sep 2018 23:42:23 +0000
+Subject: [PATCH 12/14] Link stage 2 tools dynamically to libstd
+
+---
+ src/bootstrap/tool.rs | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
+index fc1a17d546..880c2d52ba 100644
+--- a/src/bootstrap/tool.rs
++++ b/src/bootstrap/tool.rs
+@@ -207,7 +207,9 @@ pub fn prepare_tool_cargo(
+ 
+     // We don't want to build tools dynamically as they'll be running across
+     // stages and such and it's just easier if they're not dynamically linked.
+-    cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
++    if compiler.stage < 2 {
++        cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
++    }
+ 
+     if source_type == SourceType::Submodule {
+         cargo.env("RUSTC_EXTERNAL_TOOL", "1");
+-- 
+2.21.0
+

diff --git 
a/dev-lang/rust/files/0013-Move-debugger-scripts-to-usr-share-rust.patch 
b/dev-lang/rust/files/0013-Move-debugger-scripts-to-usr-share-rust.patch
new file mode 100644
index 0000000..8f5b2fb
--- /dev/null
+++ b/dev-lang/rust/files/0013-Move-debugger-scripts-to-usr-share-rust.patch
@@ -0,0 +1,53 @@
+From b3b713b954619af8768ad21bd73700291e9d7b58 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Mon, 17 Sep 2018 02:09:10 +0000
+Subject: [PATCH 13/14] Move debugger scripts to /usr/share/rust
+
+---
+ src/bootstrap/dist.rs | 2 +-
+ src/etc/rust-gdb      | 2 +-
+ src/etc/rust-lldb     | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
+index 2dae3f9135..642e4bfba8 100644
+--- a/src/bootstrap/dist.rs
++++ b/src/bootstrap/dist.rs
+@@ -595,7 +595,7 @@ impl Step for DebuggerScripts {
+     fn run(self, builder: &Builder<'_>) {
+         let host = self.host;
+         let sysroot = self.sysroot;
+-        let dst = sysroot.join("lib/rustlib/etc");
++        let dst = sysroot.join("share/rust");
+         t!(fs::create_dir_all(&dst));
+         let cp_debugger_script = |file: &str| {
+             builder.install(&builder.src.join("src/etc/").join(file), &dst, 
0o644);
+diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
+index 23ba93da8e..dc51b16c57 100755
+--- a/src/etc/rust-gdb
++++ b/src/etc/rust-gdb
+@@ -4,7 +4,7 @@ set -e
+ 
+ # Find out where the pretty printer Python module is
+ RUSTC_SYSROOT=`rustc --print=sysroot`
+-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
++GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust"
+ 
+ # Run GDB with the additional arguments that load the pretty printers
+ # Set the environment variable `RUST_GDB` to overwrite the call to a
+diff --git a/src/etc/rust-lldb b/src/etc/rust-lldb
+index 424302d495..460e119210 100755
+--- a/src/etc/rust-lldb
++++ b/src/etc/rust-lldb
+@@ -26,7 +26,7 @@ display the contents of local variables!"
+ fi
+ 
+ # Prepare commands that will be loaded before any file on the command line 
has been loaded
+-script_import="command script import 
\"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_rust_formatters.py\""
++script_import="command script import 
\"$RUSTC_SYSROOT/share/rust/lldb_rust_formatters.py\""
+ category_definition="type summary add --no-value --python-function 
lldb_rust_formatters.print_val -x \".*\" --category Rust"
+ category_enable="type category enable Rust"
+ 
+-- 
+2.21.0
+

diff --git a/dev-lang/rust/files/0014-Add-gentoo-target-specs.patch 
b/dev-lang/rust/files/0014-Add-gentoo-target-specs.patch
new file mode 100644
index 0000000..36afe06
--- /dev/null
+++ b/dev-lang/rust/files/0014-Add-gentoo-target-specs.patch
@@ -0,0 +1,179 @@
+From d4b28cd40d12ef2a801658176b31c6663c25d66f Mon Sep 17 00:00:00 2001
+From: Samuel Holland <sam...@sholland.org>
+Date: Mon, 17 Sep 2018 02:29:06 +0000
+Subject: [PATCH 14/14] Add gentoo target specs
+
+---
+ .../spec/aarch64_gentoo_linux_musl.rs               | 11 +++++++++++
+ .../spec/arm_gentoo_linux_musleabi.rs               | 11 +++++++++++
+ .../spec/armv7a_gentoo_linux_musleabihf.rs          | 11 +++++++++++
+ src/librustc_target/spec/i686_gentoo_linux_musl.rs  | 13 +++++++++++++
+ src/librustc_target/spec/mod.rs                     | 11 ++++++++++-
+ .../spec/powerpc64_gentoo_linux_musl.rs             | 11 +++++++++++
+ .../spec/powerpc_gentoo_linux_musl.rs               | 13 +++++++++++++
+ .../spec/x86_64_gentoo_linux_musl.rs                | 11 +++++++++++
+ 8 files changed, 91 insertions(+), 1 deletion(-)
+ create mode 100644 src/librustc_target/spec/aarch64_gentoo_linux_musl.rs
+ create mode 100644 src/librustc_target/spec/arm_gentoo_linux_musleabi.rs
+ create mode 100644 src/librustc_target/spec/armv7a_gentoo_linux_musleabihf.rs
+ create mode 100644 src/librustc_target/spec/i686_gentoo_linux_musl.rs
+ create mode 100644 src/librustc_target/spec/powerpc64_gentoo_linux_musl.rs
+ create mode 100644 src/librustc_target/spec/powerpc_gentoo_linux_musl.rs
+ create mode 100644 src/librustc_target/spec/x86_64_gentoo_linux_musl.rs
+
+diff --git a/src/librustc_target/spec/aarch64_gentoo_linux_musl.rs 
b/src/librustc_target/spec/aarch64_gentoo_linux_musl.rs
+new file mode 100644
+index 0000000000..420fe7cde7
+--- /dev/null
++++ b/src/librustc_target/spec/aarch64_gentoo_linux_musl.rs
+@@ -0,0 +1,11 @@
++use crate::spec::TargetResult;
++
++pub fn target() -> TargetResult {
++    let mut base = super::aarch64_unknown_linux_musl::target()?;
++
++    base.llvm_target = "aarch64-gentoo-linux-musl".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++
++    Ok(base)
++}
+diff --git a/src/librustc_target/spec/arm_gentoo_linux_musleabi.rs 
b/src/librustc_target/spec/arm_gentoo_linux_musleabi.rs
+new file mode 100644
+index 0000000000..d47ca84164
+--- /dev/null
++++ b/src/librustc_target/spec/arm_gentoo_linux_musleabi.rs
+@@ -0,0 +1,11 @@
++use crate::spec::TargetResult;
++
++pub fn target() -> TargetResult {
++    let mut base = super::arm_unknown_linux_musleabi::target()?;
++
++    base.llvm_target = "arm-gentoo-linux-musleabi".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++
++    Ok(base)
++}
+diff --git a/src/librustc_target/spec/armv7a_gentoo_linux_musleabihf.rs 
b/src/librustc_target/spec/armv7a_gentoo_linux_musleabihf.rs
+new file mode 100644
+index 0000000000..f5c85855c1
+--- /dev/null
++++ b/src/librustc_target/spec/armv7a_gentoo_linux_musleabihf.rs
+@@ -0,0 +1,11 @@
++use crate::spec::TargetResult;
++
++pub fn target() -> TargetResult {
++    let mut base = super::armv7_unknown_linux_musleabihf::target()?;
++
++    base.llvm_target = "armv7a-gentoo-linux-musleabihf".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++
++    Ok(base)
++}
+diff --git a/src/librustc_target/spec/i686_gentoo_linux_musl.rs 
b/src/librustc_target/spec/i686_gentoo_linux_musl.rs
+new file mode 100644
+index 0000000000..be4d7b8523
+--- /dev/null
++++ b/src/librustc_target/spec/i686_gentoo_linux_musl.rs
+@@ -0,0 +1,13 @@
++use crate::spec::{LinkerFlavor, TargetResult};
++
++pub fn target() -> TargetResult {
++    let mut base = super::i686_unknown_linux_musl::target()?;
++
++    base.llvm_target = "i686-gentoo-linux-musl".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++    base.options.post_link_args.insert(LinkerFlavor::Gcc,
++        vec!["-Wl,--as-needed".to_string(), "-lssp_nonshared".to_string()]);
++
++    Ok(base)
++}
+diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs
+index bef2afc7b6..42bd26ce0c 100644
+--- a/src/librustc_target/spec/mod.rs
++++ b/src/librustc_target/spec/mod.rs
+@@ -327,7 +327,17 @@ macro_rules! supported_targets {
+     )
+ }
+ 
++mod arm_unknown_linux_musleabi;
++
+ supported_targets! {
++    ("aarch64-gentoo-linux-musl", aarch64_gentoo_linux_musl),
++    ("arm-unknown-linux-musleabi", arm_gentoo_linux_musleabi),
++    ("armv7a-unknown-linux-musleabihf", armv7a_gentoo_linux_musleabihf),
++    ("i686-gentoo-linux-musl", i686_gentoo_linux_musl),
++    ("powerpc-gentoo-linux-musl", powerpc_gentoo_linux_musl),
++    ("powerpc64-gentoo-linux-musl", powerpc64_gentoo_linux_musl),
++    ("x86_64-gentoo-linux-musl", x86_64_gentoo_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),
+@@ -348,7 +358,6 @@ supported_targets! {
+     ("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
+     ("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
+     ("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
+-    ("arm-unknown-linux-musleabi", arm_unknown_linux_musleabi),
+     ("arm-unknown-linux-musleabihf", arm_unknown_linux_musleabihf),
+     ("armv4t-unknown-linux-gnueabi", armv4t_unknown_linux_gnueabi),
+     ("armv5te-unknown-linux-gnueabi", armv5te_unknown_linux_gnueabi),
+diff --git a/src/librustc_target/spec/powerpc64_gentoo_linux_musl.rs 
b/src/librustc_target/spec/powerpc64_gentoo_linux_musl.rs
+new file mode 100644
+index 0000000000..e840bb27bb
+--- /dev/null
++++ b/src/librustc_target/spec/powerpc64_gentoo_linux_musl.rs
+@@ -0,0 +1,11 @@
++use crate::spec::TargetResult;
++
++pub fn target() -> TargetResult {
++    let mut base = super::powerpc64_unknown_linux_musl::target()?;
++
++    base.llvm_target = "powerpc64-gentoo-linux-musl".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++
++    Ok(base)
++}
+diff --git a/src/librustc_target/spec/powerpc_gentoo_linux_musl.rs 
b/src/librustc_target/spec/powerpc_gentoo_linux_musl.rs
+new file mode 100644
+index 0000000000..905c5214d4
+--- /dev/null
++++ b/src/librustc_target/spec/powerpc_gentoo_linux_musl.rs
+@@ -0,0 +1,13 @@
++use crate::spec::{LinkerFlavor, TargetResult};
++
++pub fn target() -> TargetResult {
++    let mut base = super::powerpc_unknown_linux_musl::target()?;
++
++    base.llvm_target = "powerpc-gentoo-linux-musl".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++    base.options.post_link_args.insert(LinkerFlavor::Gcc,
++        vec!["-Wl,--as-needed".to_string(), "-lssp_nonshared".to_string()]);
++
++    Ok(base)
++}
+diff --git a/src/librustc_target/spec/x86_64_gentoo_linux_musl.rs 
b/src/librustc_target/spec/x86_64_gentoo_linux_musl.rs
+new file mode 100644
+index 0000000000..f33047358b
+--- /dev/null
++++ b/src/librustc_target/spec/x86_64_gentoo_linux_musl.rs
+@@ -0,0 +1,11 @@
++use crate::spec::TargetResult;
++
++pub fn target() -> TargetResult {
++    let mut base = super::x86_64_unknown_linux_musl::target()?;
++
++    base.llvm_target = "x86_64-gentoo-linux-musl".to_string();
++    base.target_vendor = "gentoo".to_string();
++    base.options.crt_static_default = false;
++
++    Ok(base)
++}
+-- 
+2.21.0
+

diff --git a/dev-lang/rust/files/0030-liblibc-linkage.patch 
b/dev-lang/rust/files/0030-liblibc-linkage.patch
new file mode 100644
index 0000000..6863209
--- /dev/null
+++ b/dev-lang/rust/files/0030-liblibc-linkage.patch
@@ -0,0 +1,33 @@
+--- rustc-1.34.2-src/vendor/libc/src/lib.rs
++++ rustc-1.34.2-src/vendor/libc/src/lib.rs
+@@ -153,6 +153,7 @@
+ #![cfg_attr(feature = "rustc-dep-of-std", feature(cfg_target_vendor))]
+ #![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, repr_packed))]
+ #![cfg_attr(feature = "rustc-dep-of-std", feature(no_core))]
++#![cfg_attr(feature = "rustc-dep-of-std", feature(static_nobundle))]
+ #![cfg_attr(feature = "rustc-dep-of-std", no_core)]
+ #![cfg_attr(feature = "rustc-dep-of-std", allow(warnings))]
+ #![cfg_attr(not(any(feature = "use_std", feature = "rustc-dep-of-std")), 
no_std)]
+--- rustc-1.34.2-src/vendor/libc/src/unix/mod.rs
++++ rustc-1.34.2-src/vendor/libc/src/unix/mod.rs
+@@ -287,11 +287,11 @@ cfg_if! {
+         // cargo build, don't pull in anything extra as the libstd dep
+         // already pulls in all libs.
+     } else if #[cfg(target_env = "musl")] {
++        #[link(name = "c")]
++        extern {}
+         #[cfg_attr(feature = "rustc-dep-of-std",
+-                   link(name = "c", kind = "static",
++                   link(name = "gcc", kind = "static-nobundle",
+                         cfg(target_feature = "crt-static")))]
+-        #[cfg_attr(feature = "rustc-dep-of-std",
+-                   link(name = "c", cfg(not(target_feature = "crt-static"))))]
+         extern {}
+     } else if #[cfg(target_os = "emscripten")] {
+         #[link(name = "c")]
+--- rustc-1.34.2-src/vendor/libc/.cargo-checksum.json
++++ rustc-1.34.2-src/vendor/libc/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"e1bbf88a55a1ba674f5192fe1585b57a51751ee6c5aa7edeb87df8027c3bb912","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"40ddea9181e5374cf535aae33ad4ace80bd9b1beea8f881ff8d2b777da9489b2","build.rs":"2d1cbe87e0478de12a15a230d7ef0997020ba845b5b7d221d74cd2ce3fe0e720","src/cloudabi/aarch64.rs":"b8550bf1fd7344972aa4db29441486f39f31482d0327534981dbb75959c29114","src/cloudabi/arm.rs":"c197e2781c2839808bd6fcef219a29705b27b992d3ef920e9cf6ac96e2022bbf","src/cloudabi/mod.rs":"640375751825b8d4adf4fb089a53c4d883f265f96b07daf06f2dcf3acf6639c9","src/cloudabi/x86.rs":"33eb97f272d2201f3838ae74d444583c7de8f67856852ca375293b20bbd05636","src/cloudabi/x86_64.rs":"400d85d4fe39e26cf2e6ece9ee31c75fe9e88c4bcf4d836ca9f765c05c9c5be3","src/dox.rs":"b4b96dcba47797a6160c07f29982dd15d48fd2813d7d1000484bd9adc4a89de1","src/fuchsia/aarch64.rs":"40dce617877e606e92353491e1
 
913711b1ecfa510bb983156f4a8460f490419e","src/fuchsia/mod.rs":"784dee21605f00a41d7cae1fc3d782646a84515a687a4952700eae51cc3840f0","src/fuchsia/x86_64.rs":"b4a3eff94dcf1ffe41e6500468ca2cff0e97ddbcc75fe079b6ac7adb1e493f56","src/lib.rs":"d456d34fc58c8d194f8f24201b4021860f61c5f125904bb8dcc954d1f813f6b7","src/macros.rs":"29d61c13523328c4742a7290dbb7d718ce198740824592e029199e9df5429b20","src/redox/mod.rs":"87cb35a988be84d45e79206f7cb5d098e8e7c5a1825cfcd0bd663453dedc3103","src/redox/net.rs":"f2e1922883f208cb46c00744da4a68feccfbec576c6981978ad404e46f818c8b","src/sgx.rs":"18d33a470d06c15b00be5a3bf45b6e51da6104ae7437f50c0eccbd3b79994389","src/switch.rs":"00365ed196519b260fc99a32f02d60b3fb1aaf0484654b19fec8c25bc1687420","src/unix/bsd/apple/b32.rs":"da60c99ee3d773f9c0767b93ccf18b67ad67576e2c58e2e86d05b23c23fd989a","src/unix/bsd/apple/b64.rs":"0cc15406c3a91abde65b28c7783ccab7801474ecc51c78dbd1d7332d4b834390","src/unix/bsd/apple/mod.rs":"b0e2d1f7fdb71d7a02bc5994c66a5ae660955227a0c0f808172a30b38fd40
 
299","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"6c69319675328d4d16939c9c2aba3fb8ca9381a8b390d18d766949307090304b","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/freebsd/mod.rs":"6bbb3c3cf0753f32a2e61ac0f011a6c5e870a0814a6ed4eb9bb9dcdc58a9dca3","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/mod.rs":"596def64669e2f27cffebca8e5c682ee7d576f84f8f99771c27e86ce8e818221","src/unix/bsd/mod.rs":"0c846b3a2c9390dfe090603f1ad643b107cc7e7605866c5399aa81dfea4e74bd","src/unix/bsd/netbsdlike/mod.rs":"9f55f35f8e4e26c7c63eaf67ddda0e40cc2abbabc2a68750809162e6f80144f1","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"f455848cd03cb80897776f2355dbd14bbb3aa88b1aa6aec22122ec47cdbd0f20","src/unix/bsd/netbsdlike/netbsd/arm.r
 
s":"4c9eac982c385165f475ef3a80770fd634c6dde8fb400b3cb7e08c9bb7498af6","src/unix/bsd/netbsdlike/netbsd/mod.rs":"88617ada3bc740c5262926b9c45d7f51120d358522f051f0afdf7465edd13c29","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"183818c62dff72db6ee1d329d90ad8727628775ed5cd823c8485c6769003c91e","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"4db043327fb2615af2fb0f999d162310bea2294e7d050806e19a46b083561f16","src/unix/bsd/netbsdlike/netbsd/x86.rs":"979c4cbacbde37b9053f2c9df4b8f87d37b255436ef4a383e1e5f40ee21180d6","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"741353a1c6451efb0c7c7c486fd2cb54e3d36fd1c3dd280f6432d8858b0a5356","src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs":"4d2ad2e885d83ad3134add61580f49a8e58cb03284ae328273a9e2e104a4d084","src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs":"6e6f15e81597d85d83ca0eeb154e4f8b8e7f9cbb6a9cfa176601f78642ef94f9","src/unix/bsd/netbsdl
 
ike/openbsdlike/mod.rs":"6320b7bc7283dbc2a07cfb8b5a793c0153535601d050f33c1ff5e4a5cc57c2be","src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs":"820092e397c7ec259cd2de8f2444083a8e57071c02d73d678701dfa7807726e9","src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs":"6adc0dcb1b358ef91bbeb5512e19ba6f40adc77b7d259cb11641a69426fc5ea2","src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs":"44b7ea81cf363777b29935da175e702cbf45ed78f7498ae57faf44aa32335085","src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs":"97956c3a53aa07a2edf8865252f980dade0d34e930adca0e870e7344d7e2b0bb","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"b00fa310b6d835cb613a02101c7b1a72c636faec316586587cb63aebdcb9de8f","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"248c0b0abaa7d56a7dc3293e
 
67a0ce70a4ef8c83638bda8aa222ad8bb0ef6801","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/mod.rs":"c5f3c6d74ac8e8ef83374b6115bab7c6e57297336a7635aa4c47462649b00dfb","src/unix/newlib/aarch64/mod.rs":"c408a990f22fb4292a824f38367e9b517e6e6f8623328397ee631cc88b3d1f7d","src/unix/newlib/arm/mod.rs":"2b6dba2e697ab9b4f4bc4dd5f28057249e9b596d1cb395a9322ec87605c4a5c4","src/unix/newlib/mod.rs":"eea5f1eb720184d9a00be966e4161fddb3733362fc349182e85b1599ba4e825f","src/unix/notbsd/android/b32/arm.rs":"3625a32c7e58cfe683a53486fbe3d42d4e28f00bea31e19cb46ed2bb0b6a140b","src/unix/notbsd/android/b32/mod.rs":"2fbe398c1fb5251dda6213741a193e50aae4622807cb255d1dd2e82b536f0c65","src/unix/notbsd/android/b32/x86.rs":"ae2b7f1d6278caddc007749bb1d09ca33f7593478a0fd7fe98b457dae86c7814","src/unix/notbsd/android/b64/aarch64.rs":"63d65629d79371814910f691672ef593d20244ee09be26f1ebe07ee6212d0163","src/unix/notbsd/android/b64/mod.rs":"90d4f6b063fd4de42fd302cbc9d99
 
02fd99ac1d71dc48cb8bc6ad7b4c902e481","src/unix/notbsd/android/b64/x86_64.rs":"5547aef8dcbaa5a932559f34606fd8d89f6c9c15173d2b1412c12d39b3c1045f","src/unix/notbsd/android/mod.rs":"19013f41ac8ccac034eb48777a4041d69342edb9ca25d4e0bb9c5938f62eef3e","src/unix/notbsd/emscripten.rs":"9ed47a0a5020c8f72d9496f87ef0da669c1ed2b85980013100c466f18cd8a4c5","src/unix/notbsd/linux/mips/mips32.rs":"a483ddfd10765b7d5090dc21686eee8842649cd21236828a42d634114885f5f9","src/unix/notbsd/linux/mips/mips64.rs":"9fff696e3943cf206b549d1ae13fa361828e9a8454e2d5730eeaa1c172ff370d","src/unix/notbsd/linux/mips/mod.rs":"d18a40011e9090a4a2a1f27e5bd96eb2503ac352f4809648e15841083d7f3a68","src/unix/notbsd/linux/mod.rs":"d84e95d36f9477fa1aa694bf18a919ba20e65aa71539c3f3dc06e8f92acee521","src/unix/notbsd/linux/musl/b32/arm.rs":"fdf170e03812072785ec531f1ae810d0c4feb9b29d0c316681b9f7affe1262c0","src/unix/notbsd/linux/musl/b32/mips.rs":"afa4981d93f29b3fb0083a73ce1323f7dce1392f90d5cf1966b1fae10d510033","src/unix/notbsd/linux/mus
 
l/b32/mod.rs":"540928f168f145c136f9dd729ffa12b9d1838d9fe664fc642365d17d7fae648f","src/unix/notbsd/linux/musl/b32/powerpc.rs":"16c615770a96f155540511f58b5a8070c9c7a43e12bdfed83996690e7558bcb5","src/unix/notbsd/linux/musl/b32/x86.rs":"3abf1610c68c37f407cdd0f93563c3542c024219e0e8c9888266a6ee014e0c87","src/unix/notbsd/linux/musl/b64/aarch64.rs":"d98643408c2837387988f78adc95c90ad21196a6f8f879e3d33d7e8ccf612640","src/unix/notbsd/linux/musl/b64/mod.rs":"d9285cd705e2e92552a08c9aa69b810e7e1bd0e9da6edf069c678af285579661","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"544d8a7f6d6d84143df8a4c3537c9a3a36bf3d338d7a1c15689b94492498d8d7","src/unix/notbsd/linux/musl/b64/x86_64.rs":"25340999290a63d564ec149532c905f59c312ec369f8806d6b15df66fa1b8857","src/unix/notbsd/linux/musl/mod.rs":"4e582af62a11e8a5235ccbeabe5b1003fc17705e606c1ed9b21b931a470681fc","src/unix/notbsd/linux/other/b32/arm.rs":"d9892f7350b2978335f734f1cd2d7fed60f0f2e66aa05bee3f69549c031f8b14","src/unix/notbsd/linux/other/b32/mod.rs":"2621
 
1878c6481861e11393625620edaa0700cac41f55f0118c0f0bd42c1b7520","src/unix/notbsd/linux/other/b32/powerpc.rs":"253fcd2f9978525285be1903cc08f3fec2dc3b12d1660a33e2995b4f6b810d1c","src/unix/notbsd/linux/other/b32/x86.rs":"49376e3ed0f3ff95c230ac20751911fe3c608dfe15c7c118b069fd7a954d8db9","src/unix/notbsd/linux/other/b64/aarch64.rs":"1124ab5e974718b94fa40ae0f1772fb1c537910ef3e018b7c6c94a38b83dd742","src/unix/notbsd/linux/other/b64/mod.rs":"63e1a3fdf5f4d1b9820934ab344c91aed5e458e7e05908535d2e942d51a08bf8","src/unix/notbsd/linux/other/b64/not_x32.rs":"fa8636fb93eab230ed53bdec0a06f5b81d6d982cc0800103563c8c1eefcdb2d9","src/unix/notbsd/linux/other/b64/powerpc64.rs":"a771d982ed8a9458e1f2f039f959b5075b22443159875ba5612eebba96661c24","src/unix/notbsd/linux/other/b64/sparc64.rs":"0caffe5924886f3aed187531dfe78189b3df40adb96782ec4b471647ff83e9b1","src/unix/notbsd/linux/other/b64/x32.rs":"06a26c5120ced30fc015c220799b67c4401be2f13fc6c7361bebd3d37ff4982d","src/unix/notbsd/linux/other/b64/x86_64.rs":"70d0
 
cec088630502128c1c28ffef9dcc0fd9c0644f6a71b1325961d075625226","src/unix/notbsd/linux/other/mod.rs":"fe76beac87fc549b076078a0fa3e2ecd4c13b0e6e4fcb34a89e16c6584f5259b","src/unix/notbsd/linux/s390x.rs":"9e990574dfc22b6eb91bcc7c6f8297f9ad42f9183efb366a818be88180a3fac3","src/unix/notbsd/mod.rs":"a0fdecac118b70fb670f0fcccaa7f826440873448a96dd557fb1fe52cf391e89","src/unix/solaris/mod.rs":"7950a26f3eb0b7bc8e71f524cc2e05832b759fe2ce12a58e0c1957e0ec1286dc","src/unix/uclibc/mips/mips32.rs":"9739c5fb47f389a0394ef08ee30da97a3de0a1300020731a8cc0a033616011b2","src/unix/uclibc/mips/mips64.rs":"230583280bbc7b3c7fcdb61244f51fa1af5944ca127c7cf83c598fe2313713d0","src/unix/uclibc/mips/mod.rs":"2d76e6cfeb2b7f7c59231a6e099f1aed811a45659e62153aaf00c220b9488a9d","src/unix/uclibc/mod.rs":"521818507cef958376edfd8401c35db7ee1c51ee3cf106ad962002104a184cf5","src/unix/uclibc/x86_64/l4re.rs":"68fd3a833fd1f7caf784a084224f384bdbdfb8b5a14ef94c4f5155409afb3439","src/unix/uclibc/x86_64/mod.rs":"419182836aedd426a5c9e6b8
 
667058adf86ac8f43af73ce8d00c503f8ff8f414","src/unix/uclibc/x86_64/other.rs":"f03b47842896f2f3ae6f8ebdcbcf0276454f880349d9cf00e3d304f8136893c5","src/windows/gnu.rs":"4d9033162cc6f7d245256c7b165c1ec18a741771fd9b99a55b421e8d14978599","src/windows/mod.rs":"7d74b12f71de86ee517a9cd93b1b38d0551646db0eaf526048abcbdd4bbeb250","src/windows/msvc.rs":"8f46cf66883c794175609a3b2bafaa094d0ba63eb6720ef1b84b175603f1074f"},"package":"023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd"}
+\ No newline at end of file
++{"files":{"Cargo.toml":"e1bbf88a55a1ba674f5192fe1585b57a51751ee6c5aa7edeb87df8027c3bb912","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"40ddea9181e5374cf535aae33ad4ace80bd9b1beea8f881ff8d2b777da9489b2","build.rs":"2d1cbe87e0478de12a15a230d7ef0997020ba845b5b7d221d74cd2ce3fe0e720","src/cloudabi/aarch64.rs":"b8550bf1fd7344972aa4db29441486f39f31482d0327534981dbb75959c29114","src/cloudabi/arm.rs":"c197e2781c2839808bd6fcef219a29705b27b992d3ef920e9cf6ac96e2022bbf","src/cloudabi/mod.rs":"640375751825b8d4adf4fb089a53c4d883f265f96b07daf06f2dcf3acf6639c9","src/cloudabi/x86.rs":"33eb97f272d2201f3838ae74d444583c7de8f67856852ca375293b20bbd05636","src/cloudabi/x86_64.rs":"400d85d4fe39e26cf2e6ece9ee31c75fe9e88c4bcf4d836ca9f765c05c9c5be3","src/dox.rs":"b4b96dcba47797a6160c07f29982dd15d48fd2813d7d1000484bd9adc4a89de1","src/fuchsia/aarch64.rs":"40dce617877e606e92353491e1
 
913711b1ecfa510bb983156f4a8460f490419e","src/fuchsia/mod.rs":"784dee21605f00a41d7cae1fc3d782646a84515a687a4952700eae51cc3840f0","src/fuchsia/x86_64.rs":"b4a3eff94dcf1ffe41e6500468ca2cff0e97ddbcc75fe079b6ac7adb1e493f56","src/lib.rs":"69850cc2630e101768e05f78b35a0ee29875c519eb4817d5bd2c1d542fae8c1d","src/macros.rs":"29d61c13523328c4742a7290dbb7d718ce198740824592e029199e9df5429b20","src/redox/mod.rs":"87cb35a988be84d45e79206f7cb5d098e8e7c5a1825cfcd0bd663453dedc3103","src/redox/net.rs":"f2e1922883f208cb46c00744da4a68feccfbec576c6981978ad404e46f818c8b","src/sgx.rs":"18d33a470d06c15b00be5a3bf45b6e51da6104ae7437f50c0eccbd3b79994389","src/switch.rs":"00365ed196519b260fc99a32f02d60b3fb1aaf0484654b19fec8c25bc1687420","src/unix/bsd/apple/b32.rs":"da60c99ee3d773f9c0767b93ccf18b67ad67576e2c58e2e86d05b23c23fd989a","src/unix/bsd/apple/b64.rs":"0cc15406c3a91abde65b28c7783ccab7801474ecc51c78dbd1d7332d4b834390","src/unix/bsd/apple/mod.rs":"b0e2d1f7fdb71d7a02bc5994c66a5ae660955227a0c0f808172a30b38fd40
 
299","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"6c69319675328d4d16939c9c2aba3fb8ca9381a8b390d18d766949307090304b","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/freebsd/mod.rs":"6bbb3c3cf0753f32a2e61ac0f011a6c5e870a0814a6ed4eb9bb9dcdc58a9dca3","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"97132e2097411034271b8c927ecc94a208a361564680972a6c82998bd30a9826","src/unix/bsd/freebsdlike/mod.rs":"596def64669e2f27cffebca8e5c682ee7d576f84f8f99771c27e86ce8e818221","src/unix/bsd/mod.rs":"0c846b3a2c9390dfe090603f1ad643b107cc7e7605866c5399aa81dfea4e74bd","src/unix/bsd/netbsdlike/mod.rs":"9f55f35f8e4e26c7c63eaf67ddda0e40cc2abbabc2a68750809162e6f80144f1","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"f455848cd03cb80897776f2355dbd14bbb3aa88b1aa6aec22122ec47cdbd0f20","src/unix/bsd/netbsdlike/netbsd/arm.r
 
s":"4c9eac982c385165f475ef3a80770fd634c6dde8fb400b3cb7e08c9bb7498af6","src/unix/bsd/netbsdlike/netbsd/mod.rs":"88617ada3bc740c5262926b9c45d7f51120d358522f051f0afdf7465edd13c29","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"183818c62dff72db6ee1d329d90ad8727628775ed5cd823c8485c6769003c91e","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"4db043327fb2615af2fb0f999d162310bea2294e7d050806e19a46b083561f16","src/unix/bsd/netbsdlike/netbsd/x86.rs":"979c4cbacbde37b9053f2c9df4b8f87d37b255436ef4a383e1e5f40ee21180d6","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"741353a1c6451efb0c7c7c486fd2cb54e3d36fd1c3dd280f6432d8858b0a5356","src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs":"4d2ad2e885d83ad3134add61580f49a8e58cb03284ae328273a9e2e104a4d084","src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs":"6e6f15e81597d85d83ca0eeb154e4f8b8e7f9cbb6a9cfa176601f78642ef94f9","src/unix/bsd/netbsdl
 
ike/openbsdlike/mod.rs":"6320b7bc7283dbc2a07cfb8b5a793c0153535601d050f33c1ff5e4a5cc57c2be","src/unix/bsd/netbsdlike/openbsdlike/openbsd/aarch64.rs":"820092e397c7ec259cd2de8f2444083a8e57071c02d73d678701dfa7807726e9","src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs":"6adc0dcb1b358ef91bbeb5512e19ba6f40adc77b7d259cb11641a69426fc5ea2","src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86.rs":"44b7ea81cf363777b29935da175e702cbf45ed78f7498ae57faf44aa32335085","src/unix/bsd/netbsdlike/openbsdlike/openbsd/x86_64.rs":"97956c3a53aa07a2edf8865252f980dade0d34e930adca0e870e7344d7e2b0bb","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"b00fa310b6d835cb613a02101c7b1a72c636faec316586587cb63aebdcb9de8f","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"248c0b0abaa7d56a7dc3293e
 
67a0ce70a4ef8c83638bda8aa222ad8bb0ef6801","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/mod.rs":"3c5aad2e7ac5e8781158cd140ed07afb1e0ad5eb7fc4b7b0a7bf7f5d8d2ebe32","src/unix/newlib/aarch64/mod.rs":"c408a990f22fb4292a824f38367e9b517e6e6f8623328397ee631cc88b3d1f7d","src/unix/newlib/arm/mod.rs":"2b6dba2e697ab9b4f4bc4dd5f28057249e9b596d1cb395a9322ec87605c4a5c4","src/unix/newlib/mod.rs":"eea5f1eb720184d9a00be966e4161fddb3733362fc349182e85b1599ba4e825f","src/unix/notbsd/android/b32/arm.rs":"3625a32c7e58cfe683a53486fbe3d42d4e28f00bea31e19cb46ed2bb0b6a140b","src/unix/notbsd/android/b32/mod.rs":"2fbe398c1fb5251dda6213741a193e50aae4622807cb255d1dd2e82b536f0c65","src/unix/notbsd/android/b32/x86.rs":"ae2b7f1d6278caddc007749bb1d09ca33f7593478a0fd7fe98b457dae86c7814","src/unix/notbsd/android/b64/aarch64.rs":"63d65629d79371814910f691672ef593d20244ee09be26f1ebe07ee6212d0163","src/unix/notbsd/android/b64/mod.rs":"90d4f6b063fd4de42fd302cbc9d99
 
02fd99ac1d71dc48cb8bc6ad7b4c902e481","src/unix/notbsd/android/b64/x86_64.rs":"5547aef8dcbaa5a932559f34606fd8d89f6c9c15173d2b1412c12d39b3c1045f","src/unix/notbsd/android/mod.rs":"19013f41ac8ccac034eb48777a4041d69342edb9ca25d4e0bb9c5938f62eef3e","src/unix/notbsd/emscripten.rs":"9ed47a0a5020c8f72d9496f87ef0da669c1ed2b85980013100c466f18cd8a4c5","src/unix/notbsd/linux/mips/mips32.rs":"a483ddfd10765b7d5090dc21686eee8842649cd21236828a42d634114885f5f9","src/unix/notbsd/linux/mips/mips64.rs":"9fff696e3943cf206b549d1ae13fa361828e9a8454e2d5730eeaa1c172ff370d","src/unix/notbsd/linux/mips/mod.rs":"d18a40011e9090a4a2a1f27e5bd96eb2503ac352f4809648e15841083d7f3a68","src/unix/notbsd/linux/mod.rs":"d84e95d36f9477fa1aa694bf18a919ba20e65aa71539c3f3dc06e8f92acee521","src/unix/notbsd/linux/musl/b32/arm.rs":"fdf170e03812072785ec531f1ae810d0c4feb9b29d0c316681b9f7affe1262c0","src/unix/notbsd/linux/musl/b32/mips.rs":"afa4981d93f29b3fb0083a73ce1323f7dce1392f90d5cf1966b1fae10d510033","src/unix/notbsd/linux/mus
 
l/b32/mod.rs":"540928f168f145c136f9dd729ffa12b9d1838d9fe664fc642365d17d7fae648f","src/unix/notbsd/linux/musl/b32/powerpc.rs":"16c615770a96f155540511f58b5a8070c9c7a43e12bdfed83996690e7558bcb5","src/unix/notbsd/linux/musl/b32/x86.rs":"3abf1610c68c37f407cdd0f93563c3542c024219e0e8c9888266a6ee014e0c87","src/unix/notbsd/linux/musl/b64/aarch64.rs":"d98643408c2837387988f78adc95c90ad21196a6f8f879e3d33d7e8ccf612640","src/unix/notbsd/linux/musl/b64/mod.rs":"d9285cd705e2e92552a08c9aa69b810e7e1bd0e9da6edf069c678af285579661","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"544d8a7f6d6d84143df8a4c3537c9a3a36bf3d338d7a1c15689b94492498d8d7","src/unix/notbsd/linux/musl/b64/x86_64.rs":"25340999290a63d564ec149532c905f59c312ec369f8806d6b15df66fa1b8857","src/unix/notbsd/linux/musl/mod.rs":"4e582af62a11e8a5235ccbeabe5b1003fc17705e606c1ed9b21b931a470681fc","src/unix/notbsd/linux/other/b32/arm.rs":"d9892f7350b2978335f734f1cd2d7fed60f0f2e66aa05bee3f69549c031f8b14","src/unix/notbsd/linux/other/b32/mod.rs":"2621
 
1878c6481861e11393625620edaa0700cac41f55f0118c0f0bd42c1b7520","src/unix/notbsd/linux/other/b32/powerpc.rs":"253fcd2f9978525285be1903cc08f3fec2dc3b12d1660a33e2995b4f6b810d1c","src/unix/notbsd/linux/other/b32/x86.rs":"49376e3ed0f3ff95c230ac20751911fe3c608dfe15c7c118b069fd7a954d8db9","src/unix/notbsd/linux/other/b64/aarch64.rs":"1124ab5e974718b94fa40ae0f1772fb1c537910ef3e018b7c6c94a38b83dd742","src/unix/notbsd/linux/other/b64/mod.rs":"63e1a3fdf5f4d1b9820934ab344c91aed5e458e7e05908535d2e942d51a08bf8","src/unix/notbsd/linux/other/b64/not_x32.rs":"fa8636fb93eab230ed53bdec0a06f5b81d6d982cc0800103563c8c1eefcdb2d9","src/unix/notbsd/linux/other/b64/powerpc64.rs":"a771d982ed8a9458e1f2f039f959b5075b22443159875ba5612eebba96661c24","src/unix/notbsd/linux/other/b64/sparc64.rs":"0caffe5924886f3aed187531dfe78189b3df40adb96782ec4b471647ff83e9b1","src/unix/notbsd/linux/other/b64/x32.rs":"06a26c5120ced30fc015c220799b67c4401be2f13fc6c7361bebd3d37ff4982d","src/unix/notbsd/linux/other/b64/x86_64.rs":"70d0
 
cec088630502128c1c28ffef9dcc0fd9c0644f6a71b1325961d075625226","src/unix/notbsd/linux/other/mod.rs":"fe76beac87fc549b076078a0fa3e2ecd4c13b0e6e4fcb34a89e16c6584f5259b","src/unix/notbsd/linux/s390x.rs":"9e990574dfc22b6eb91bcc7c6f8297f9ad42f9183efb366a818be88180a3fac3","src/unix/notbsd/mod.rs":"a0fdecac118b70fb670f0fcccaa7f826440873448a96dd557fb1fe52cf391e89","src/unix/solaris/mod.rs":"7950a26f3eb0b7bc8e71f524cc2e05832b759fe2ce12a58e0c1957e0ec1286dc","src/unix/uclibc/mips/mips32.rs":"9739c5fb47f389a0394ef08ee30da97a3de0a1300020731a8cc0a033616011b2","src/unix/uclibc/mips/mips64.rs":"230583280bbc7b3c7fcdb61244f51fa1af5944ca127c7cf83c598fe2313713d0","src/unix/uclibc/mips/mod.rs":"2d76e6cfeb2b7f7c59231a6e099f1aed811a45659e62153aaf00c220b9488a9d","src/unix/uclibc/mod.rs":"521818507cef958376edfd8401c35db7ee1c51ee3cf106ad962002104a184cf5","src/unix/uclibc/x86_64/l4re.rs":"68fd3a833fd1f7caf784a084224f384bdbdfb8b5a14ef94c4f5155409afb3439","src/unix/uclibc/x86_64/mod.rs":"419182836aedd426a5c9e6b8
 
667058adf86ac8f43af73ce8d00c503f8ff8f414","src/unix/uclibc/x86_64/other.rs":"f03b47842896f2f3ae6f8ebdcbcf0276454f880349d9cf00e3d304f8136893c5","src/windows/gnu.rs":"4d9033162cc6f7d245256c7b165c1ec18a741771fd9b99a55b421e8d14978599","src/windows/mod.rs":"7d74b12f71de86ee517a9cd93b1b38d0551646db0eaf526048abcbdd4bbeb250","src/windows/msvc.rs":"8f46cf66883c794175609a3b2bafaa094d0ba63eb6720ef1b84b175603f1074f"},"package":"023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd"}

diff --git a/dev-lang/rust/files/0040-rls-atomics.patch 
b/dev-lang/rust/files/0040-rls-atomics.patch
new file mode 100644
index 0000000..8e44100
--- /dev/null
+++ b/dev-lang/rust/files/0040-rls-atomics.patch
@@ -0,0 +1,58 @@
+--- a/src/tools/rls/rls/src/cmd.rs
++++ b/src/tools/rls/rls/src/cmd.rs
+@@ -17,7 +17,7 @@ use crate::config::Config;
+ use crate::server::{self, LsService, Notification, Request, RequestId};
+ use rls_analysis::{AnalysisHost, Target};
+ use rls_vfs::Vfs;
+-use std::sync::atomic::{AtomicU64, Ordering};
++use std::sync::atomic::{AtomicU32, Ordering};
+ 
+ use lsp_types::{
+     ClientCapabilities, CodeActionContext, CodeActionParams, CompletionItem,
+@@ -323,8 +323,8 @@ fn url(file_name: &str) -> Url {
+ }
+ 
+ fn next_id() -> RequestId {
+-    static ID: AtomicU64 = AtomicU64::new(1);
+-    RequestId::Num(ID.fetch_add(1, Ordering::SeqCst))
++    static ID: AtomicU32 = AtomicU32::new(1);
++    RequestId::Num(ID.fetch_add(1, Ordering::SeqCst).into())
+ }
+ 
+ // Custom reader and output for the RLS server.
+--- a/src/tools/rls/rls/src/server/io.rs
++++ b/src/tools/rls/rls/src/server/io.rs
+@@ -17,7 +17,7 @@ use crate::lsp_data::{LSPNotification, LSPRequest};
+ 
+ use std::fmt;
+ use std::io::{self, BufRead, Write};
+-use std::sync::atomic::{AtomicU64, Ordering};
++use std::sync::atomic::{AtomicU32, Ordering};
+ use std::sync::Arc;
+ 
+ use jsonrpc_core::{self as jsonrpc, response, version, Id};
+@@ -182,13 +182,13 @@ pub trait Output: Sync + Send + Clone + 'static {
+ /// An output that sends notifications and responses on `stdout`.
+ #[derive(Clone)]
+ pub(super) struct StdioOutput {
+-    next_id: Arc<AtomicU64>,
++    next_id: Arc<AtomicU32>,
+ }
+ 
+ impl StdioOutput {
+     /// Construct a new `stdout` output.
+     pub(crate) fn new() -> StdioOutput {
+-        StdioOutput { next_id: Arc::new(AtomicU64::new(1)) }
++        StdioOutput { next_id: Arc::new(AtomicU32::new(1).into()) }
+     }
+ }
+ 
+@@ -205,7 +205,7 @@ impl Output for StdioOutput {
+     }
+ 
+     fn provide_id(&self) -> RequestId {
+-        RequestId::Num(self.next_id.fetch_add(1, Ordering::SeqCst))
++        RequestId::Num(self.next_id.fetch_add(1, Ordering::SeqCst).into())
+     }
+ }
+ 

diff --git a/dev-lang/rust/files/0050-llvm.patch 
b/dev-lang/rust/files/0050-llvm.patch
new file mode 100644
index 0000000..16f1f28
--- /dev/null
+++ b/dev-lang/rust/files/0050-llvm.patch
@@ -0,0 +1,20 @@
+diff --git a/src/llvm-project/llvm/include/llvm/Analysis/TargetLibraryInfo.def 
b/src/llvm-project/llvm/include/llvm/Analysis/TargetLibraryInfo.def
+index 579d23004d1..6cd9d2722fb 100644
+--- a/src/llvm-project/llvm/include/llvm/Analysis/TargetLibraryInfo.def
++++ b/src/llvm-project/llvm/include/llvm/Analysis/TargetLibraryInfo.def
+@@ -27,6 +27,15 @@
+ #define TLI_DEFINE_STRING_INTERNAL(string_repr) string_repr,
+ #endif
+ 
++// avoid name conflicts with musl-libc
++#undef fopen64
++#undef fseeko64
++#undef ftello64
++#undef fstat64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ /// void *new(unsigned int);
+ TLI_DEFINE_ENUM_INTERNAL(msvc_new_int)
+ TLI_DEFINE_STRING_INTERNAL("??2@YAPAXI@Z")

diff --git a/dev-lang/rust/files/0051-llvm-D45520.patch 
b/dev-lang/rust/files/0051-llvm-D45520.patch
new file mode 100644
index 0000000..275f03b
--- /dev/null
+++ b/dev-lang/rust/files/0051-llvm-D45520.patch
@@ -0,0 +1,101 @@
+Index: 
rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
+===================================================================
+--- 
rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
++++ 
rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
+@@ -442,13 +442,22 @@
+   // On PPC64, VariantKind is VK_None, but on PPC32, it's VK_PLT, and it must
+   // come at the _end_ of the expression.
+   const MCOperand &Op = MI->getOperand(OpNo);
+-  const MCSymbolRefExpr &refExp = cast<MCSymbolRefExpr>(*Op.getExpr());
+-  O << refExp.getSymbol().getName();
++  const MCSymbolRefExpr *RefExp = nullptr;
++  const MCConstantExpr *ConstExp = nullptr;
++  if (const MCBinaryExpr *BinExpr = dyn_cast<MCBinaryExpr>(Op.getExpr())) {
++    RefExp = cast<MCSymbolRefExpr>(BinExpr->getLHS());
++    ConstExp = cast<MCConstantExpr>(BinExpr->getRHS());
++  } else
++    RefExp = cast<MCSymbolRefExpr>(Op.getExpr());
++
++  O << RefExp->getSymbol().getName();
+   O << '(';
+   printOperand(MI, OpNo+1, O);
+   O << ')';
+-  if (refExp.getKind() != MCSymbolRefExpr::VK_None)
+-    O << '@' << MCSymbolRefExpr::getVariantKindName(refExp.getKind());
++  if (RefExp->getKind() != MCSymbolRefExpr::VK_None)
++    O << '@' << MCSymbolRefExpr::getVariantKindName(RefExp->getKind());
++  if (ConstExp != nullptr)
++    O << '+' << ConstExp->getValue();
+ }
+ 
+ /// showRegistersWithPercentPrefix - Check if this register name should be
+Index: rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+===================================================================
+--- rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -487,8 +487,14 @@
+   if (!Subtarget->isPPC64() && !Subtarget->isDarwin() &&
+       isPositionIndependent())
+     Kind = MCSymbolRefExpr::VK_PLT;
+-  const MCSymbolRefExpr *TlsRef =
++  const MCExpr *TlsRef =
+     MCSymbolRefExpr::create(TlsGetAddr, Kind, OutContext);
++
++  // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
++  if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt())
++    TlsRef = MCBinaryExpr::createAdd(TlsRef,
++                                     MCConstantExpr::create(32768, 
OutContext),
++                                     OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+   const GlobalValue *GValue = MO.getGlobal();
+   MCSymbol *MOSymbol = getSymbol(GValue);
+Index: rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+===================================================================
+--- rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
++++ rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+@@ -4054,7 +4054,20 @@
+     if (trySETCC(N))
+       return;
+     break;
+-
++  // These nodes will be transformed into GETtlsADDR32 node, which
++  // later becomes BL_TLS __tls_get_addr(sym at tlsgd)@PLT
++  case PPCISD::ADDI_TLSLD_L_ADDR:
++  case PPCISD::ADDI_TLSGD_L_ADDR: {
++    const Module *Mod = MF->getFunction().getParent();
++    if (PPCLowering->getPointerTy(CurDAG->getDataLayout()) != MVT::i32 ||
++        !PPCSubTarget->isSecurePlt() || !PPCSubTarget->isTargetELF() ||
++        Mod->getPICLevel() == PICLevel::SmallPIC)
++      break;
++      // Attach global base pointer on GETtlsADDR32 node in order to
++      // generate secure plt code for TLS symbols.
++      getGlobalBaseReg();
++  }
++    break;
+   case PPCISD::CALL: {
+     const Module *M = MF->getFunction().getParent();
+ 
+Index: 
rustc-src/src/llvm-project/llvm/test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll
+===================================================================
+--- 
rustc-src/src/llvm-project/llvm/test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll
++++ 
rustc-src/src/llvm-project/llvm/test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll
+@@ -0,0 +1,18 @@
++; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt 
-relocation-model=pic | FileCheck -check-prefix=SECURE-PLT-TLS %s
++
++@a = thread_local local_unnamed_addr global i32 6, align 4
++define i32 @main() local_unnamed_addr #0 {
++entry:
++  %0 = load i32, i32* @a, align 4
++  ret i32 %0
++}
++
++
++!llvm.module.flags = !{!0}
++!0 = !{i32 7, !"PIC Level", i32 2}
++
++; SECURE-PLT-TLS:       mflr 30
++; SECURE-PLT-TLS-NEXT:  addis 30, 30, .LTOC-.L0$pb@ha
++; SECURE-PLT-TLS-NEXT:  addi 30, 30, .LTOC-.L0$pb@l
++; SECURE-PLT-TLS-NEXT:  bl .L{{.*}}
++; SECURE-PLT-TLS:       bl __tls_get_addr(a@tlsgd)@PLT+32768
+\ No newline at end of file

diff --git a/dev-lang/rust/files/0052-llvm-D52013.patch 
b/dev-lang/rust/files/0052-llvm-D52013.patch
new file mode 100644
index 0000000..05ccae6
--- /dev/null
+++ b/dev-lang/rust/files/0052-llvm-D52013.patch
@@ -0,0 +1,15 @@
+Index: rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+===================================================================
+--- rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ rustc-src/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -199,6 +199,10 @@
+   case Triple::ppc64le:
+     return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
++    // musl uses ELFv2 ABI on both endians.
++    if (TT.getEnvironment() == Triple::Musl)
++      return PPCTargetMachine::PPC_ABI_ELFv2;
++
+     return PPCTargetMachine::PPC_ABI_ELFv1;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;

diff --git a/dev-lang/rust/files/0053-llvm-secureplt.patch 
b/dev-lang/rust/files/0053-llvm-secureplt.patch
new file mode 100644
index 0000000..ddf8877
--- /dev/null
+++ b/dev-lang/rust/files/0053-llvm-secureplt.patch
@@ -0,0 +1,28 @@
+diff --git a/src/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp 
b/src/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+--- a/src/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/src/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -138,6 +138,10 @@
+   if (isDarwin())
+     HasLazyResolverStubs = true;
+ 
++  // Set up musl-specific properties.
++  if (TargetTriple.getEnvironment() == Triple::Musl)
++    SecurePlt = true;
++
+   if (HasSPE && IsPPC64)
+     report_fatal_error( "SPE is only supported for 32-bit targets.\n", false);
+   if (HasSPE && (HasAltivec || HasQPX || HasVSX || HasFPU))
+diff --git a/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp 
b/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+--- a/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,6 +222,10 @@ static Reloc::Model getEffectiveRelocModel(const Triple 
&TT,
+   if (TT.getArch() == Triple::ppc64)
+     return Reloc::PIC_;
+ 
++  // musl needs SecurePlt, which depends on PIC.
++  if (TT.getEnvironment() == Triple::Musl)
++    return Reloc::PIC_;
++
+   // Rest are static by default.
+   return Reloc::Static;
+ }

diff --git a/dev-lang/rust/files/0060-fix-build-with-libressl-2.9.1.patch 
b/dev-lang/rust/files/0060-fix-build-with-libressl-2.9.1.patch
new file mode 100644
index 0000000..d5375a0
--- /dev/null
+++ b/dev-lang/rust/files/0060-fix-build-with-libressl-2.9.1.patch
@@ -0,0 +1,35 @@
+From a04a24be49e14fe77dfcef647afbbe5ae5e181d1 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anar...@gentoo.org>
+Date: Wed, 24 Apr 2019 01:57:40 -0500
+Subject: [PATCH] fix build with libressl-2.9.1
+
+Signed-off-by: Jory Pratt <anar...@gentoo.org>
+---
+ vendor/openssl-sys/.cargo-checksum.json | 2 +-
+ vendor/openssl-sys/build/main.rs        | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/vendor/openssl-sys/.cargo-checksum.json 
b/vendor/openssl-sys/.cargo-checksum.json
+index b5c539431..49a2227bf 100644
+--- a/vendor/openssl-sys/.cargo-checksum.json
++++ b/vendor/openssl-sys/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"b09af0445220130b1b1c45791a316435f7400cf2fab3abe9c419f4f8028cfb9c","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"fae5176c2b149d190c9611b58c5882312b5c0e483d1a404cfdf850473314a58f","build/main.rs":"c8bc352b94d05afeaeb96300341a695c70c3b62c46793a5c035aaf42e22b69d1","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"4f12d2f4c2a493888db669d1ecfd55df40861a78cae65957f801ed91dc2cae30","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"29aa053b67b47515fd15812aa0a90ff35dd9fa347da2beeba96d6deafeb9d945","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"520
 
b282b92fa372a75bc16696dc3ee7a9a5752e517a18862182a3e9f5a976d28","src/dsa.rs":"3c294c5c45235497396ac803b723b3a0cb5bd3609f5dec18338b5b014c2adeb9","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"b22d27b01a70652384866b3d0d01d2f7a0421b2ba2db9268ed379fef4b1ac034","src/err.rs":"81230711e081277e0b6dae4ff21266052d075688c758c2b0720001849ef9192d","src/evp.rs":"13a8a71154545d7c478e156edb21beb219824937aba6b29c6bc6ef895c735a3d","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"17b5a1faa0fe3ab777c8cb0039a3dffd8922b211bf1330c2cd0c3e02f624353c","src/macros.rs":"a7c95174fd4cfeb42f730c7c0744194009520249888dbf43968571219fd6dfa1","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"619177f939328597e4bcf9
 
c41fdf4d0aa9207d779c6e0dafddbe2eab9b1a6a98","src/pem.rs":"3ae1c53dbc126a04c188575294111cc04c215c2f3e031192d5cc05952f011ddf","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"a0bf64f1f8ff9f6e5dbed6c38d8fa2d3d1c5dfcfe6dd3ff79f7737b072ce4681","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"e69d3b9b8f2f8ae1ed3905a4dbe064ad1b7c1eaf21d7eabb86ecdb5b41e2120a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"fd85a1683064def0a9e07d803b90102229adc1d58f
 
a19cf4e56976f0dd7425b9","src/x509.rs":"839be2feb74755ab7df66a024ad27dfa70ce4f7889229d9152ba999f3a54b914","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"66fd646ea4caf5ce81e3c881e88d85462519c4e97a7f82e82ca8ac52ea830ad2"},"package":"1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6"}
+\ No newline at end of file
++{"files":{"Cargo.toml":"b09af0445220130b1b1c45791a316435f7400cf2fab3abe9c419f4f8028cfb9c","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"fae5176c2b149d190c9611b58c5882312b5c0e483d1a404cfdf850473314a58f","build/main.rs":"4c1c4b208af314ee7217108c5cb22fd51dac1fdb2bbdf901a63454a99741ca2d","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"4f12d2f4c2a493888db669d1ecfd55df40861a78cae65957f801ed91dc2cae30","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"29aa053b67b47515fd15812aa0a90ff35dd9fa347da2beeba96d6deafeb9d945","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"520
 
b282b92fa372a75bc16696dc3ee7a9a5752e517a18862182a3e9f5a976d28","src/dsa.rs":"3c294c5c45235497396ac803b723b3a0cb5bd3609f5dec18338b5b014c2adeb9","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"b22d27b01a70652384866b3d0d01d2f7a0421b2ba2db9268ed379fef4b1ac034","src/err.rs":"81230711e081277e0b6dae4ff21266052d075688c758c2b0720001849ef9192d","src/evp.rs":"13a8a71154545d7c478e156edb21beb219824937aba6b29c6bc6ef895c735a3d","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"17b5a1faa0fe3ab777c8cb0039a3dffd8922b211bf1330c2cd0c3e02f624353c","src/macros.rs":"a7c95174fd4cfeb42f730c7c0744194009520249888dbf43968571219fd6dfa1","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"619177f939328597e4bcf9
 
c41fdf4d0aa9207d779c6e0dafddbe2eab9b1a6a98","src/pem.rs":"3ae1c53dbc126a04c188575294111cc04c215c2f3e031192d5cc05952f011ddf","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"a0bf64f1f8ff9f6e5dbed6c38d8fa2d3d1c5dfcfe6dd3ff79f7737b072ce4681","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"e69d3b9b8f2f8ae1ed3905a4dbe064ad1b7c1eaf21d7eabb86ecdb5b41e2120a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"fd85a1683064def0a9e07d803b90102229adc1d58f
 
a19cf4e56976f0dd7425b9","src/x509.rs":"839be2feb74755ab7df66a024ad27dfa70ce4f7889229d9152ba999f3a54b914","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"66fd646ea4caf5ce81e3c881e88d85462519c4e97a7f82e82ca8ac52ea830ad2"},"package":"1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6"}
+\ No newline at end of file
+diff --git a/vendor/openssl-sys/build/main.rs 
b/vendor/openssl-sys/build/main.rs
+index 69def400e..6f08c872d 100644
+--- a/vendor/openssl-sys/build/main.rs
++++ b/vendor/openssl-sys/build/main.rs
+@@ -505,6 +505,7 @@ See rust-openssl README for more information:
+             (8, 1) => ('8', '1'),
+             (8, _) => ('8', 'x'),
+             (9, 0) => ('9', '0'),
++            (9, _) => ('9', 'x'),
+             _ => version_error(),
+         };
+ 
+-- 
+2.21.0
+

diff --git a/dev-lang/rust/metadata.xml b/dev-lang/rust/metadata.xml
new file mode 100644
index 0000000..cd11337
--- /dev/null
+++ b/dev-lang/rust/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="project">
+    <email>r...@gentoo.org</email>
+    <name>Rust Project</name>
+  </maintainer>
+  <use>
+    <flag name="cargo">Install cargo component</flag>
+    <flag name="clippy">Install clippy component</flag>
+    <flag name="system-llvm">Use the system LLVM install</flag>
+    <flag name="rls">Install rls component</flag>
+    <flag name="rustfmt">Install rustfmt component</flag>
+    <flag name="wasm">Build support for the wasm32-unknown-unknown
+    target</flag>
+  </use>
+</pkgmetadata>

diff --git a/dev-lang/rust/rust-1.34.2.ebuild b/dev-lang/rust/rust-1.34.2.ebuild
new file mode 100644
index 0000000..84d697e
--- /dev/null
+++ b/dev-lang/rust/rust-1.34.2.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
+
+inherit check-reqs eapi7-ver flag-o-matic llvm multiprocessing python-any-r1 
toolchain-funcs
+
+ABI_VER="$(ver_cut 1-2)"
+SLOT="stable/${ABI_VER}"
+MY_P="rustc-${PV}"
+SRC="${MY_P}-src.tar.xz"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).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? ( 
https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-x86_64-gentoo-linux-musl.tar.xz
 )
+       arm? ( 
https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-armv7a-unknown-linux-musleabihf.tar.xz
 )
+       arm64? ( 
https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-aarch64-gentoo-linux-musl.tar.xz
 )
+       ppc? ( 
https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-powerpc-gentoo-linux-musl.tar.xz
 )
+       ppc64? ( 
https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-powerpc64-gentoo-linux-musl.tar.xz
 )
+       x86? ( 
https://portage.smaeul.xyz/distfiles/rust-${RUST_STAGE0_VERSION}-i686-gentoo-linux-musl.tar.xz
 )
+"
+
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+       NVPTX PowerPC Sparc SystemZ WebAssembly 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="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm 
${ALL_LLVM_TARGETS[*]}"
+
+# Please keep the LLVM dependency block separate. Since LLVM is slotted,
+# we need to *really* make sure we're not pulling one than more slot
+# simultaneously.
+
+# How to use it:
+# 1. List all the working slots (with min versions) in ||, newest first.
+# 2. Update the := to specify *max* version, e.g. < 9.
+# 3. Specify LLVM_MAX_SLOT, e.g. 8.
+LLVM_DEPEND="
+       || (
+               >=sys-devel/llvm-8:=[${LLVM_TARGET_USEDEPS// /,}]
+       )
+       <sys-devel/llvm-9:=
+"
+LLVM_MAX_SLOT=8
+
+COMMON_DEPEND="
+       !libressl? ( dev-libs/openssl:0= )
+       libressl? ( dev-libs/libressl:0= )
+       net-libs/http-parser:=
+       net-libs/libssh2:=
+       net-misc/curl:=[ssl]
+       sys-libs/zlib:=
+       system-llvm? (
+               ${LLVM_DEPEND}
+       )
+"
+DEPEND="${COMMON_DEPEND}
+       ${PYTHON_DEPS}
+       || (
+               >=sys-devel/gcc-4.7
+               >=sys-devel/clang-3.5
+       )
+       !system-llvm? (
+               dev-util/cmake
+               dev-util/ninja
+       )
+"
+RDEPEND="${COMMON_DEPEND}
+       >=app-eselect/eselect-rust-20190311
+       !dev-util/cargo
+       rustfmt? ( !dev-util/rustfmt )"
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
+       x86? ( cpu_flags_x86_sse2 )
+"
+
+PATCHES=(
+       "${FILESDIR}/0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch"
+       "${FILESDIR}/0002-Fix-LLVM-build.patch"
+       
"${FILESDIR}/0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch"
+       
"${FILESDIR}/0004-Require-static-native-libraries-when-linking-static-.patch"
+       "${FILESDIR}/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch"
+       "${FILESDIR}/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch"
+       "${FILESDIR}/0007-runtest-Fix-proc-macro-tests-on-musl-hosts.patch"
+       "${FILESDIR}/0008-Correct-minimum-system-LLVM-version-in-tests.patch"
+       
"${FILESDIR}/0009-test-use-extern-for-plugins-Don-t-assume-multilib.patch"
+       
"${FILESDIR}/0010-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch"
+       "${FILESDIR}/0011-Ignore-broken-and-non-applicable-tests.patch"
+       "${FILESDIR}/0012-Link-stage-2-tools-dynamically-to-libstd.patch"
+       "${FILESDIR}/0013-Move-debugger-scripts-to-usr-share-rust.patch"
+       "${FILESDIR}/0014-Add-gentoo-target-specs.patch"
+       "${FILESDIR}/0030-liblibc-linkage.patch"
+       "${FILESDIR}/0040-rls-atomics.patch"
+       "${FILESDIR}/0050-llvm.patch"
+       "${FILESDIR}/0051-llvm-D45520.patch"
+       "${FILESDIR}/0052-llvm-D52013.patch"
+       "${FILESDIR}/0053-llvm-secureplt.patch"
+       "${FILESDIR}/0060-fix-build-with-libressl-2.9.1.patch"
+)
+
+S="${WORKDIR}/${MY_P}-src"
+
+toml_usex() {
+       usex "$1" true false
+}
+
+pre_build_checks() {
+       CHECKREQS_DISK_BUILD="7G"
+       eshopts_push -s extglob
+       if is-flagq '-g?(gdb)?([1-9])'; then
+               CHECKREQS_DISK_BUILD="10G"
+       fi
+       eshopts_pop
+       check-reqs_pkg_setup
+}
+
+pkg_pretend() {
+       pre_build_checks
+}
+
+pkg_setup() {
+       export RUST_BACKTRACE=1
+       pre_build_checks
+       python-any-r1_pkg_setup
+       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 -Lnative=$("$llvm_config" 
--libdir)"
+       fi
+}
+
+src_prepare() {
+       default
+
+       "${WORKDIR}/rust-${RUST_STAGE0_VERSION}-${CHOST}/install.sh" \
+               --destdir="${WORKDIR}/stage0" \
+               --prefix=/ \
+               --components=rust-std-$CHOST,rustc,cargo \
+               --disable-ldconfig \
+               || die
+}
+
+src_configure() {
+       local tools='"cargo"'
+
+       for tool in clippy rls rustfmt; do
+               if use $tool; then
+                       tools+=", \"$tool\""
+               fi
+       done
+
+       cat <<- EOF > "${S}"/config.toml
+               [llvm]
+               ninja = true
+               optimize = $(toml_usex !debug)
+               release-debuginfo = $(toml_usex debug)
+               assertions = $(toml_usex debug)
+               targets = "${LLVM_TARGETS// /;}"
+               experimental-targets = ""
+               link-shared = $(toml_usex system-llvm)
+               [build]
+               build = "${CHOST}"
+               host = ["${CHOST}"]
+               target = ["${CHOST}"]
+               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 = 0
+               sanitizers = false
+               profiler = false
+               extended = true
+               tools = [${tools}]
+               [install]
+               prefix = "${EPREFIX}/usr"
+               libdir = "lib"
+               docdir = "share/doc/${P}"
+               mandir = "share/${P}/man"
+               [rust]
+               optimize = $(toml_usex !debug)
+               debuginfo = $(toml_usex debug)
+               debug-assertions = $(toml_usex debug)
+               default-linker = "$(tc-getCC)"
+               channel = "stable"
+               rpath = false
+               optimize-tests = $(toml_usex !debug)
+               dist-src = false
+               jemalloc = false
+               [dist]
+               src-tarball = false
+               [target.${CHOST}]
+               cc = "$(tc-getCC)"
+               cxx = "$(tc-getCXX)"
+               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
+}
+
+src_compile() {
+       "${EPYTHON}" x.py build --config="${S}"/config.toml -j$(makeopts_jobs) 
--exclude src/tools/miri || die
+}
+
+src_test() {
+       "${EPYTHON}" x.py test -j$(makeopts_jobs) --no-doc --no-fail-fast \
+               src/test/codegen \
+               src/test/codegen-units \
+               src/test/compile-fail \
+               src/test/incremental \
+               src/test/mir-opt \
+               src/test/pretty \
+               src/test/run-fail \
+               src/test/run-fail/pretty \
+               src/test/run-make \
+               src/test/run-make-fulldeps \
+               src/test/run-pass \
+               src/test/run-pass/pretty \
+               src/test/run-pass-fulldeps \
+               src/test/run-pass-fulldeps/pretty \
+               src/test/ui \
+               src/test/ui-fulldeps || die
+}
+
+src_install() {
+       env DESTDIR="${D}" "${EPYTHON}" x.py install || die
+
+       mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die
+       mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die
+       mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die
+       mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die
+       mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die
+       mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die
+
+       rm "${ED}/usr/lib"/*.so || die
+       rm "${ED}/usr/lib/rustlib/components" || die
+       rm "${ED}/usr/lib/rustlib/install.log" || die
+       rm "${ED}/usr/lib/rustlib"/manifest-* || die
+       rm "${ED}/usr/lib/rustlib/rust-installer-version" || die
+       rm "${ED}/usr/lib/rustlib/uninstall.sh" || die
+
+       if use clippy; then
+               mv "${ED}/usr/bin/cargo-clippy" 
"${ED}/usr/bin/cargo-clippy-${PV}" || die
+               mv "${ED}/usr/bin/clippy-driver" 
"${ED}/usr/bin/clippy-driver-${PV}" || die
+       fi
+       if use rls; then
+               mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die
+       fi
+       if use rustfmt; then
+               mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || 
die
+               mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die
+       fi
+
+       if use doc; then
+               dodir "/usr/share/doc/${P}"
+               mv "${ED}/usr/share/doc/rust"/* "${ED}/usr/share/doc/${P}" || 
die
+               rmdir "${ED}/usr/share/doc/rust" || die
+       fi
+
+       dodoc COPYRIGHT
+       rm "${ED}/usr/share/doc/${P}"/*.old || die
+       rm "${ED}/usr/share/doc/${P}/LICENSE-APACHE" || die
+       rm "${ED}/usr/share/doc/${P}/LICENSE-MIT" || die
+
+       docompress "/usr/share/${P}/man"
+
+       cat <<-EOF > "${T}"/50${P}
+               LDPATH="${EPREFIX}/usr/lib/rustlib/${CHOST}/lib"
+               MANPATH="${EPREFIX}/usr/share/${P}/man"
+       EOF
+       doenvd "${T}"/50${P}
+
+       # note: eselect-rust adds EROOT to all paths below
+       cat <<-EOF > "${T}/provider-${P}"
+               /usr/bin/cargo
+               /usr/bin/rustdoc
+               /usr/bin/rust-gdb
+               /usr/bin/rust-gdbgui
+               /usr/bin/rust-lldb
+       EOF
+       if use clippy; then
+               echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
+               echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
+       fi
+       if use rls; then
+               echo /usr/bin/rls >> "${T}/provider-${P}"
+       fi
+       if use rustfmt; then
+               echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
+               echo /usr/bin/rustfmt >> "${T}/provider-${P}"
+       fi
+       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}."
+
+       ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of 
dev-util/cargo."
+       ewarn "This might have resulted in a dangling symlink for 
/usr/bin/cargo on some"
+       ewarn "systems. This can be resolved by calling 'sudo eselect rust set 
${P}'."
+
+       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
+}

Reply via email to