diff --git a/dev-lang/rust/files/1.39.0-pr65474.patch b/dev-lang/rust/files/1.39.0-pr65474.patch new file mode 100644 index 0000000000..34cbb4d99b --- /dev/null +++ b/dev-lang/rust/files/1.39.0-pr65474.patch @@ -0,0 +1,512 @@ +From 3a05616cb6b6df75fc54094de7f3d4b161ed8521 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 26 Sep 2019 14:44:08 -0700 +Subject: [PATCH 1/3] minimize the rust-std component + +This splits out a rustc-dev component with the compiler crates, and +keeps the status quo of default installed files on nightly. The default +changing to not install compiler libraries by default is left for a +future pull request. + +However, on stable and beta, this does remove the compiler libraries +from the set of libraries installed by default, as they are never needed +there (per our stability story, they "cannot" be used). +--- + src/bootstrap/builder.rs | 1 + + src/bootstrap/dist.rs | 129 ++++++++++++++++++++------- + src/tools/build-manifest/src/main.rs | 15 ++++ + 3 files changed, 112 insertions(+), 33 deletions(-) + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 0caf2d9b6db5..7e3ae7f2cc90 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -443,6 +443,7 @@ impl<'a> Builder<'a> { + dist::Rustc, + dist::DebuggerScripts, + dist::Std, ++ dist::RustcDev, + dist::Analysis, + dist::Src, + dist::PlainSourceTarball, +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index d9dff77a30e6..e5a43dcb29f6 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -637,6 +637,28 @@ impl Step for DebuggerScripts { + } + } + ++fn skip_host_target_lib(builder: &Builder<'_>, compiler: Compiler) -> bool { ++ // The only true set of target libraries came from the build triple, so ++ // let's reduce redundant work by only producing archives from that host. ++ if compiler.host != builder.config.build { ++ builder.info("\tskipping, not a build host"); ++ true ++ } else { ++ false ++ } ++} ++ ++/// Copy stamped files into an image's `target/lib` directory. ++fn copy_target_libs(builder: &Builder<'_>, target: &str, image: &Path, stamp: &Path) { ++ let dst = image.join("lib/rustlib").join(target).join("lib"); ++ t!(fs::create_dir_all(&dst)); ++ for (path, host) in builder.read_stamp_file(stamp) { ++ if !host || builder.config.build == target { ++ builder.copy(&path, &dst.join(path.file_name().unwrap())); ++ } ++ } ++} ++ + #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] + pub struct Std { + pub compiler: Compiler, +@@ -667,44 +689,19 @@ impl Step for Std { + let target = self.target; + + let name = pkgname(builder, "rust-std"); +- +- // The only true set of target libraries came from the build triple, so +- // let's reduce redundant work by only producing archives from that host. +- if compiler.host != builder.config.build { +- builder.info("\tskipping, not a build host"); +- return distdir(builder).join(format!("{}-{}.tar.gz", name, target)); ++ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target)); ++ if skip_host_target_lib(builder, compiler) { ++ return archive; + } + +- // We want to package up as many target libraries as possible +- // for the `rust-std` package, so if this is a host target we +- // depend on librustc and otherwise we just depend on libtest. +- if builder.hosts.iter().any(|t| t == target) { +- builder.ensure(compile::Rustc { compiler, target }); +- } else { +- builder.ensure(compile::Std { compiler, target }); +- } ++ builder.ensure(compile::Std { compiler, target }); + + let image = tmpdir(builder).join(format!("{}-{}-image", name, target)); + let _ = fs::remove_dir_all(&image); + +- let dst = image.join("lib/rustlib").join(target); +- t!(fs::create_dir_all(&dst)); +- let mut src = builder.sysroot_libdir(compiler, target).to_path_buf(); +- src.pop(); // Remove the trailing /lib folder from the sysroot_libdir +- builder.cp_filtered(&src, &dst, &|path| { +- if let Some(name) = path.file_name().and_then(|s| s.to_str()) { +- if name == builder.config.rust_codegen_backends_dir.as_str() { +- return false +- } +- if name == "bin" { +- return false +- } +- if name.contains("LLVM") { +- return false +- } +- } +- true +- }); ++ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); ++ let stamp = compile::libstd_stamp(builder, compiler_to_use, target); ++ copy_target_libs(builder, &target, &image, &stamp); + + let mut cmd = rust_installer(builder); + cmd.arg("generate") +@@ -723,7 +720,73 @@ impl Step for Std { + let _time = timeit(builder); + builder.run(&mut cmd); + builder.remove_dir(&image); +- distdir(builder).join(format!("{}-{}.tar.gz", name, target)) ++ archive ++ } ++} ++ ++#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] ++pub struct RustcDev { ++ pub compiler: Compiler, ++ pub target: Interned, ++} ++ ++impl Step for RustcDev { ++ type Output = PathBuf; ++ const DEFAULT: bool = true; ++ const ONLY_HOSTS: bool = true; ++ ++ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { ++ run.path("rustc-dev") ++ } ++ ++ fn make_run(run: RunConfig<'_>) { ++ run.builder.ensure(RustcDev { ++ compiler: run.builder.compiler_for( ++ run.builder.top_stage, ++ run.builder.config.build, ++ run.target, ++ ), ++ target: run.target, ++ }); ++ } ++ ++ fn run(self, builder: &Builder<'_>) -> PathBuf { ++ let compiler = self.compiler; ++ let target = self.target; ++ ++ let name = pkgname(builder, "rustc-dev"); ++ let archive = distdir(builder).join(format!("{}-{}.tar.gz", name, target)); ++ if skip_host_target_lib(builder, compiler) { ++ return archive; ++ } ++ ++ builder.ensure(compile::Rustc { compiler, target }); ++ ++ let image = tmpdir(builder).join(format!("{}-{}-image", name, target)); ++ let _ = fs::remove_dir_all(&image); ++ ++ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); ++ let stamp = compile::librustc_stamp(builder, compiler_to_use, target); ++ copy_target_libs(builder, &target, &image, &stamp); ++ ++ let mut cmd = rust_installer(builder); ++ cmd.arg("generate") ++ .arg("--product-name=Rust") ++ .arg("--rel-manifest-dir=rustlib") ++ .arg("--success-message=Rust-is-ready-to-develop.") ++ .arg("--image-dir").arg(&image) ++ .arg("--work-dir").arg(&tmpdir(builder)) ++ .arg("--output-dir").arg(&distdir(builder)) ++ .arg(format!("--package-name={}-{}", name, target)) ++ .arg(format!("--component-name=rustc-dev-{}", target)) ++ .arg("--legacy-manifest-dirs=rustlib,cargo"); ++ ++ builder.info(&format!("Dist rustc-dev stage{} ({} -> {})", ++ compiler.stage, &compiler.host, target)); ++ let _time = timeit(builder); ++ builder.run(&mut cmd); ++ builder.remove_dir(&image); ++ archive + } + } + +diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs +index f41e7dd17ede..97e758f9b823 100644 +--- a/src/tools/build-manifest/src/main.rs ++++ b/src/tools/build-manifest/src/main.rs +@@ -399,6 +399,7 @@ impl Builder { + fn add_packages_to(&mut self, manifest: &mut Manifest) { + let mut package = |name, targets| self.package(name, &mut manifest.pkg, targets); + package("rustc", HOSTS); ++ package("rustc-dev", HOSTS); + package("cargo", HOSTS); + package("rust-mingw", MINGW); + package("rust-std", TARGETS); +@@ -481,6 +482,15 @@ impl Builder { + components.push(host_component("rust-mingw")); + } + ++ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently ++ // split out of `rust-std`. We'll include it by default as a transition for nightly users, ++ // but ship it as an optional component on the beta and stable channels. ++ if self.rust_release == "nightly" { ++ components.push(host_component("rustc-dev")); ++ } else { ++ extensions.push(host_component("rustc-dev")); ++ } ++ + // Tools are always present in the manifest, + // but might be marked as unavailable if they weren't built. + extensions.extend(vec![ +@@ -498,6 +508,11 @@ impl Builder { + .filter(|&&target| target != host) + .map(|target| Component::from_str("rust-std", target)) + ); ++ extensions.extend( ++ HOSTS.iter() ++ .filter(|&&target| target != host) ++ .map(|target| Component::from_str("rustc-dev", target)) ++ ); + extensions.push(Component::from_str("rust-src", "*")); + + // If the components/extensions don't actually exist for this + +From 4c906dc84ec78fad35405d5c0f2b2d58f9f26288 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 7 Oct 2019 15:49:51 -0700 +Subject: [PATCH 2/3] Add rustc-dev to nightly default and complete profiles + +--- + src/tools/build-manifest/src/main.rs | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs +index 97e758f9b823..c0d2deab2f8b 100644 +--- a/src/tools/build-manifest/src/main.rs ++++ b/src/tools/build-manifest/src/main.rs +@@ -427,6 +427,13 @@ impl Builder { + "rls-preview", "rust-src", "llvm-tools-preview", + "lldb-preview", "rust-analysis", "miri-preview" + ]); ++ ++ // The compiler libraries are not stable for end users, but `rustc-dev` was only recently ++ // split out of `rust-std`. We'll include it by default as a transition for nightly users. ++ if self.rust_release == "nightly" { ++ self.extend_profile("default", &mut manifest.profiles, &["rustc-dev"]); ++ self.extend_profile("complete", &mut manifest.profiles, &["rustc-dev"]); ++ } + } + + fn add_renames_to(&self, manifest: &mut Manifest) { +@@ -549,6 +556,14 @@ impl Builder { + dst.insert(profile_name.to_owned(), pkgs.iter().map(|s| (*s).to_owned()).collect()); + } + ++ fn extend_profile(&mut self, ++ profile_name: &str, ++ dst: &mut BTreeMap>, ++ pkgs: &[&str]) { ++ dst.get_mut(profile_name).expect("existing profile") ++ .extend(pkgs.iter().map(|s| (*s).to_owned())); ++ } ++ + fn package(&mut self, + pkgname: &str, + dst: &mut BTreeMap, + +From 7ccf492ae616b4d06eab283ab604938fd234415a Mon Sep 17 00:00:00 2001 +From: Jethro Beekman +Date: Sat, 12 Oct 2019 16:01:59 +0200 +Subject: [PATCH 3/3] Package non-rust objects + +--- + src/bootstrap/check.rs | 4 +++ + src/bootstrap/compile.rs | 63 ++++++++++++++++++++++++++-------------- + src/bootstrap/lib.rs | 1 + + 3 files changed, 46 insertions(+), 22 deletions(-) + +diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs +index cadb9a7e441f..df1c72575846 100644 +--- a/src/bootstrap/check.rs ++++ b/src/bootstrap/check.rs +@@ -55,6 +55,7 @@ impl Step for Std { + cargo, + args(builder.kind), + &libstd_stamp(builder, compiler, target), ++ vec![], + true); + + let libdir = builder.sysroot_libdir(compiler, target); +@@ -103,6 +104,7 @@ impl Step for Rustc { + cargo, + args(builder.kind), + &librustc_stamp(builder, compiler, target), ++ vec![], + true); + + let libdir = builder.sysroot_libdir(compiler, target); +@@ -155,6 +157,7 @@ impl Step for CodegenBackend { + cargo, + args(builder.kind), + &codegen_backend_stamp(builder, compiler, target, backend), ++ vec![], + true); + } + } +@@ -199,6 +202,7 @@ impl Step for Rustdoc { + cargo, + args(builder.kind), + &rustdoc_stamp(builder, compiler, target), ++ vec![], + true); + + let libdir = builder.sysroot_libdir(compiler, target); +diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs +index 6ea32edfb208..d48927f9bf78 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -69,7 +69,7 @@ impl Step for Std { + return; + } + +- builder.ensure(StartupObjects { compiler, target }); ++ let mut target_deps = builder.ensure(StartupObjects { compiler, target }); + + let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); + if compiler_to_use != compiler { +@@ -91,7 +91,7 @@ impl Step for Std { + return; + } + +- copy_third_party_objects(builder, &compiler, target); ++ target_deps.extend(copy_third_party_objects(builder, &compiler, target).into_iter()); + + let mut cargo = builder.cargo(compiler, Mode::Std, target, "build"); + std_cargo(builder, &compiler, target, &mut cargo); +@@ -102,6 +102,7 @@ impl Step for Std { + cargo, + vec![], + &libstd_stamp(builder, compiler, target), ++ target_deps, + false); + + builder.ensure(StdLink { +@@ -113,9 +114,22 @@ impl Step for Std { + } + + /// Copies third pary objects needed by various targets. +-fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned) { ++fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned) ++ -> Vec ++{ + let libdir = builder.sysroot_libdir(*compiler, target); + ++ let mut target_deps = vec![]; ++ ++ let mut copy_and_stamp = |sourcedir: &Path, name: &str| { ++ let target = libdir.join(name); ++ builder.copy( ++ &sourcedir.join(name), ++ &target, ++ ); ++ target_deps.push(target); ++ }; ++ + // Copies the crt(1,i,n).o startup objects + // + // Since musl supports fully static linking, we can cross link for it even +@@ -123,19 +137,13 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: + // 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") { ++ let srcdir = builder.musl_root(target).unwrap().join("lib"); + for &obj in &["crt1.o", "crti.o", "crtn.o"] { +- builder.copy( +- &builder.musl_root(target).unwrap().join("lib").join(obj), +- &libdir.join(obj), +- ); ++ copy_and_stamp(&srcdir, obj); + } + } else if target.ends_with("-wasi") { +- for &obj in &["crt1.o"] { +- builder.copy( +- &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj), +- &libdir.join(obj), +- ); +- } ++ let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi"); ++ copy_and_stamp(&srcdir, "crt1.o"); + } + + // Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx. +@@ -145,11 +153,11 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: + // which is provided by std for this target. + if target == "x86_64-fortanix-unknown-sgx" { + let src_path_env = "X86_FORTANIX_SGX_LIBS"; +- let obj = "libunwind.a"; + let src = env::var(src_path_env).expect(&format!("{} not found in env", src_path_env)); +- let src = Path::new(&src).join(obj); +- builder.copy(&src, &libdir.join(obj)); ++ copy_and_stamp(Path::new(&src), "libunwind.a"); + } ++ ++ target_deps + } + + /// Configure cargo to compile the standard library, adding appropriate env vars +@@ -307,7 +315,7 @@ pub struct StartupObjects { + } + + impl Step for StartupObjects { +- type Output = (); ++ type Output = Vec; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/rtstartup") +@@ -326,13 +334,15 @@ impl Step for StartupObjects { + /// They don't require any library support as they're just plain old object + /// files, so we just use the nightly snapshot compiler to always build them (as + /// no other compilers are guaranteed to be available). +- fn run(self, builder: &Builder<'_>) { ++ fn run(self, builder: &Builder<'_>) -> Vec { + let for_compiler = self.compiler; + let target = self.target; + if !target.contains("windows-gnu") { +- return ++ return vec![] + } + ++ let mut target_deps = vec![]; ++ + let src_dir = &builder.src.join("src/rtstartup"); + let dst_dir = &builder.native_dir(target).join("rtstartup"); + let sysroot_dir = &builder.sysroot_libdir(for_compiler, target); +@@ -351,7 +361,9 @@ impl Step for StartupObjects { + .arg(src_file)); + } + +- builder.copy(dst_file, &sysroot_dir.join(file.to_string() + ".o")); ++ let target = sysroot_dir.join(file.to_string() + ".o"); ++ builder.copy(dst_file, &target); ++ target_deps.push(target); + } + + for obj in ["crt2.o", "dllcrt2.o"].iter() { +@@ -359,8 +371,12 @@ impl Step for StartupObjects { + builder.cc(target), + target, + obj); +- builder.copy(&src, &sysroot_dir.join(obj)); ++ let target = sysroot_dir.join(obj); ++ builder.copy(&src, &target); ++ target_deps.push(target); + } ++ ++ target_deps + } + } + +@@ -438,6 +454,7 @@ impl Step for Rustc { + cargo, + vec![], + &librustc_stamp(builder, compiler, target), ++ vec![], + false); + + builder.ensure(RustcLink { +@@ -586,7 +603,7 @@ impl Step for CodegenBackend { + + let tmp_stamp = out_dir.join(".tmp.stamp"); + +- let files = run_cargo(builder, cargo, vec![], &tmp_stamp, false); ++ let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false); + if builder.config.dry_run { + return; + } +@@ -954,6 +971,7 @@ pub fn run_cargo(builder: &Builder<'_>, + cargo: Cargo, + tail_args: Vec, + stamp: &Path, ++ additional_target_deps: Vec, + is_check: bool) + -> Vec + { +@@ -1070,6 +1088,7 @@ pub fn run_cargo(builder: &Builder<'_>, + deps.push((path_to_add.into(), false)); + } + ++ deps.extend(additional_target_deps.into_iter().map(|d| (d, false))); + deps.sort(); + let mut new_contents = Vec::new(); + for (dep, proc_macro) in deps.iter() { +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 9203a558f646..ad0bdd0f425f 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -1144,6 +1144,7 @@ impl Build { + pub fn copy(&self, src: &Path, dst: &Path) { + if self.config.dry_run { return; } + self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst)); ++ if src == dst { return; } + let _ = fs::remove_file(&dst); + let metadata = t!(src.symlink_metadata()); + if metadata.file_type().is_symlink() { diff --git a/dev-lang/rust/files/rust-1.39.0/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch b/dev-lang/rust/files/rust-1.39.0/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch index 9d4ad72de0..cf886afcf2 100644 --- a/dev-lang/rust/files/rust-1.39.0/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch +++ b/dev-lang/rust/files/rust-1.39.0/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch @@ -20,7 +20,7 @@ Subject: [PATCH 05/19] Remove -nostdlib and musl_root from musl targets 13 files changed, 5 insertions(+), 147 deletions(-) diff --git a/config.toml.example b/config.toml.example -index 848147c2974..2aea23d48d7 100644 +index 848147c..2aea23d 100644 --- a/config.toml.example +++ b/config.toml.example @@ -469,12 +469,6 @@ @@ -37,7 +37,7 @@ index 848147c2974..2aea23d48d7 100644 #wasi-root = "..." diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs -index a4cb81d3d1b..500d8d03b90 100644 +index a4cb81d..500d8d0 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs @@ -41,8 +41,6 @@ fn cc2ar(cc: &Path, target: &str) -> Option { @@ -105,12 +105,12 @@ index a4cb81d3d1b..500d8d03b90 100644 } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 6ea32edfb20..afdf6fcf481 100644 +index d48927f..19d5424 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -116,20 +116,7 @@ impl Step for Std { - fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned) { - let libdir = builder.sysroot_libdir(*compiler, target); +@@ -130,18 +130,7 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: + target_deps.push(target); + }; - // Copies the crt(1,i,n).o startup objects - // @@ -119,18 +119,16 @@ index 6ea32edfb20..afdf6fcf481 100644 - // 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") { +- let srcdir = builder.musl_root(target).unwrap().join("lib"); - for &obj in &["crt1.o", "crti.o", "crtn.o"] { -- builder.copy( -- &builder.musl_root(target).unwrap().join("lib").join(obj), -- &libdir.join(obj), -- ); +- copy_and_stamp(&srcdir, obj); - } - } else if target.ends_with("-wasi") { + if target.ends_with("-wasi") { - for &obj in &["crt1.o"] { - builder.copy( - &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj), -@@ -220,15 +207,6 @@ pub fn std_cargo(builder: &Builder<'_>, + let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi"); + copy_and_stamp(&srcdir, "crt1.o"); + } +@@ -228,15 +217,6 @@ pub fn std_cargo(builder: &Builder<'_>, .arg("--manifest-path") .arg(builder.src.join("src/libtest/Cargo.toml")); @@ -147,7 +145,7 @@ index 6ea32edfb20..afdf6fcf481 100644 if let Some(p) = builder.wasi_root(target) { let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap()); diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index 52b5cd888df..cc191271e94 100644 +index 52b5cd8..cc19127 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -131,8 +131,6 @@ pub struct Config { @@ -200,7 +198,7 @@ index 52b5cd888df..cc191271e94 100644 target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from); diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py -index 346f0cb2039..80409781ede 100755 +index 346f0cb..8040978 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -110,30 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", @@ -235,7 +233,7 @@ index 346f0cb2039..80409781ede 100755 "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 d292609f57c..ff5f7e16fc1 100644 +index d3e5bff..eb0a6a9 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -835,14 +835,6 @@ impl Build { @@ -254,7 +252,7 @@ index d292609f57c..ff5f7e16fc1 100644 fn wasi_root(&self, target: Interned) -> Option<&Path> { self.config.target_config.get(&target) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs -index bffe748f37c..3b109548056 100644 +index bffe748..3b10954 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -187,30 +187,6 @@ pub fn check(build: &mut Build) { @@ -289,7 +287,7 @@ index bffe748f37c..3b109548056 100644 // 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 61c363fbfd6..f3305fdd3be 100644 +index 61c363f..f3305fd 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/ @@ -302,7 +300,7 @@ index 61c363fbfd6..f3305fdd3be 100644 # Newer binutils broke things on some vms/distros (i.e., linking against diff --git a/src/ci/docker/dist-various-1/Dockerfile b/src/ci/docker/dist-various-1/Dockerfile -index 10579119462..06ce4cfa75e 100644 +index 1057911..06ce4cf 100644 --- a/src/ci/docker/dist-various-1/Dockerfile +++ b/src/ci/docker/dist-various-1/Dockerfile @@ -132,13 +132,6 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \ @@ -320,7 +318,7 @@ index 10579119462..06ce4cfa75e 100644 --disable-docs diff --git a/src/ci/docker/dist-various-2/Dockerfile b/src/ci/docker/dist-various-2/Dockerfile -index 2ae6c58941e..56a7a5ff0c6 100644 +index 2ae6c58..56a7a5f 100644 --- a/src/ci/docker/dist-various-2/Dockerfile +++ b/src/ci/docker/dist-various-2/Dockerfile @@ -107,7 +107,6 @@ ENV X86_FORTANIX_SGX_LIBS="/x86_64-fortanix-unknown-sgx/lib/" @@ -333,7 +331,7 @@ index 2ae6c58941e..56a7a5ff0c6 100644 ENV SCRIPT python2.7 ../x.py dist --target $TARGETS diff --git a/src/ci/docker/dist-x86_64-musl/Dockerfile b/src/ci/docker/dist-x86_64-musl/Dockerfile -index 385eefde846..81d4f7737e8 100644 +index 385eefd..81d4f77 100644 --- a/src/ci/docker/dist-x86_64-musl/Dockerfile +++ b/src/ci/docker/dist-x86_64-musl/Dockerfile @@ -31,7 +31,6 @@ RUN sh /scripts/sccache.sh @@ -345,7 +343,7 @@ index 385eefde846..81d4f7737e8 100644 --disable-docs \ --set target.x86_64-unknown-linux-musl.crt-static=false \ diff --git a/src/ci/docker/test-various/Dockerfile b/src/ci/docker/test-various/Dockerfile -index 6a2600d8756..53a99ae1353 100644 +index 6a2600d..53a99ae 100644 --- a/src/ci/docker/test-various/Dockerfile +++ b/src/ci/docker/test-various/Dockerfile @@ -29,7 +29,6 @@ COPY scripts/sccache.sh /scripts/ @@ -357,7 +355,7 @@ index 6a2600d8756..53a99ae1353 100644 --set rust.lld diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs -index e294e63982d..58ae91a96aa 100644 +index e294e63..58ae91a 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}; @@ -389,6 +387,3 @@ index e294e63982d..58ae91a96aa 100644 // 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.23.0 - diff --git a/dev-lang/rust/rust-1.39.0.ebuild b/dev-lang/rust/rust-1.39.0.ebuild index e52c43dd0e..06164144d1 100644 --- a/dev-lang/rust/rust-1.39.0.ebuild +++ b/dev-lang/rust/rust-1.39.0.ebuild @@ -91,33 +91,34 @@ REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) " PATCHES=( - "${FILESDIR}/1.39.0/0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch" - "${FILESDIR}/1.39.0/0002-Fix-LLVM-build.patch" - "${FILESDIR}/1.39.0/0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch" - "${FILESDIR}/1.39.0/0004-Require-static-native-libraries-when-linking-static-.patch" - "${FILESDIR}/1.39.0/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch" - "${FILESDIR}/1.39.0/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch" - "${FILESDIR}/1.39.0/0007-Add-target-thumbv7neon-unknown-linux-musleabihf.patch" - "${FILESDIR}/1.39.0/0008-Configure-LLVM-module-PIC-level.patch" - "${FILESDIR}/1.39.0/0009-Fix-C-aggregate-passing-ABI-on-powerpc.patch" - "${FILESDIR}/1.39.0/0010-Fix-zero-sized-aggregate-ABI-on-powerpc.patch" - "${FILESDIR}/1.39.0/0011-Link-libssp_nonshared.a-on-all-musl-targets.patch" - "${FILESDIR}/1.39.0/0012-Use-rustc-workspace-hack-for-rustbook.patch" - "${FILESDIR}/1.39.0/0013-test-failed-doctest-output-Fix-normalization.patch" - "${FILESDIR}/1.39.0/0014-test-use-extern-for-plugins-Don-t-assume-multilib.patch" - "${FILESDIR}/1.39.0/0015-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch" - "${FILESDIR}/1.39.0/0016-Ignore-broken-and-non-applicable-tests.patch" - "${FILESDIR}/1.39.0/0017-Link-stage-2-tools-dynamically-to-libstd.patch" - "${FILESDIR}/1.39.0/0018-Move-debugger-scripts-to-usr-share-rust.patch" - "${FILESDIR}/1.39.0/0019-Add-gentoo-target-specs.patch" - "${FILESDIR}/1.39.0/0030-libc-linkage.patch" - "${FILESDIR}/1.39.0/0031-typenum-pmmx.patch" - "${FILESDIR}/1.39.0/0032-libgit2-sys-abi.patch" - "${FILESDIR}/1.39.0/0040-rls-atomics.patch" - "${FILESDIR}/1.39.0/0050-llvm.patch" - "${FILESDIR}/1.39.0/0051-llvm-powerpc-plt.patch" - "${FILESDIR}/1.39.0/0052-llvm-powerpc-elfv2.patch" - "${FILESDIR}/1.39.0/0060-Update-libressl-support-3.x.patch" + "${FILESDIR}/1.39.0-pr65474.patch" + "${FILESDIR}/rust-1.39.0/0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch" + "${FILESDIR}/rust-1.39.0/0002-Fix-LLVM-build.patch" + "${FILESDIR}/rust-1.39.0/0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch" + "${FILESDIR}/rust-1.39.0/0004-Require-static-native-libraries-when-linking-static-.patch" + "${FILESDIR}/rust-1.39.0/0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch" + "${FILESDIR}/rust-1.39.0/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch" + "${FILESDIR}/rust-1.39.0/0007-Add-target-thumbv7neon-unknown-linux-musleabihf.patch" + "${FILESDIR}/rust-1.39.0/0008-Configure-LLVM-module-PIC-level.patch" + "${FILESDIR}/rust-1.39.0/0009-Fix-C-aggregate-passing-ABI-on-powerpc.patch" + "${FILESDIR}/rust-1.39.0/0010-Fix-zero-sized-aggregate-ABI-on-powerpc.patch" + "${FILESDIR}/rust-1.39.0/0011-Link-libssp_nonshared.a-on-all-musl-targets.patch" + "${FILESDIR}/rust-1.39.0/0012-Use-rustc-workspace-hack-for-rustbook.patch" + "${FILESDIR}/rust-1.39.0/0013-test-failed-doctest-output-Fix-normalization.patch" + "${FILESDIR}/rust-1.39.0/0014-test-use-extern-for-plugins-Don-t-assume-multilib.patch" + "${FILESDIR}/rust-1.39.0/0015-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch" + "${FILESDIR}/rust-1.39.0/0016-Ignore-broken-and-non-applicable-tests.patch" + "${FILESDIR}/rust-1.39.0/0017-Link-stage-2-tools-dynamically-to-libstd.patch" + "${FILESDIR}/rust-1.39.0/0018-Move-debugger-scripts-to-usr-share-rust.patch" + "${FILESDIR}/rust-1.39.0/0019-Add-gentoo-target-specs.patch" + "${FILESDIR}/rust-1.39.0/0030-libc-linkage.patch" + "${FILESDIR}/rust-1.39.0/0031-typenum-pmmx.patch" + "${FILESDIR}/rust-1.39.0/0032-libgit2-sys-abi.patch" + "${FILESDIR}/rust-1.39.0/0040-rls-atomics.patch" + "${FILESDIR}/rust-1.39.0/0050-llvm.patch" + "${FILESDIR}/rust-1.39.0/0051-llvm-powerpc-plt.patch" + "${FILESDIR}/rust-1.39.0/0052-llvm-powerpc-elfv2.patch" + "${FILESDIR}/rust-1.39.0/0060-Update-libressl-support-3.x.patch" ) S="${WORKDIR}/${MY_P}-src"