diff --git a/.gitignore b/.gitignore index 5669d3f..3b56dc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rustc-1.41.1-src.tar.xz +SOURCES/rustc-1.43.1-src.tar.xz diff --git a/.rust.metadata b/.rust.metadata index c47f774..b1bb850 100644 --- a/.rust.metadata +++ b/.rust.metadata @@ -1 +1 @@ -301d66a2853e8d36e2db79cbaeb446be9435241f SOURCES/rustc-1.41.1-src.tar.xz +24243dbbeb70be8370fddc4a83e68a1ad228c4ed SOURCES/rustc-1.43.1-src.tar.xz diff --git a/SOURCES/0001-Fix-compiletest-fallout-from-stage0-bump.patch b/SOURCES/0001-Fix-compiletest-fallout-from-stage0-bump.patch deleted file mode 100644 index dfffce9..0000000 --- a/SOURCES/0001-Fix-compiletest-fallout-from-stage0-bump.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 241d2e765dc7401e642812e43b75dbc3950f2c98 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Wed, 18 Dec 2019 13:28:14 -0500 -Subject: [PATCH] Fix compiletest fallout from stage0 bump - ---- - src/tools/compiletest/src/main.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs -index 15f8abd75d59..32965bbb292d 100644 ---- a/src/tools/compiletest/src/main.rs -+++ b/src/tools/compiletest/src/main.rs -@@ -569,6 +569,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { - list: false, - options: test::Options::new(), - time_options: None, -+ force_run_in_process: false, - } - } - --- -2.24.1 - diff --git a/SOURCES/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch b/SOURCES/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch deleted file mode 100644 index 82d928d..0000000 --- a/SOURCES/0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch +++ /dev/null @@ -1,52 +0,0 @@ -From b6fd4598c5367e78b5841fd99412484f0e86fc21 Mon Sep 17 00:00:00 2001 -From: Amanieu d'Antras -Date: Wed, 1 Jan 2020 17:11:45 +0100 -Subject: [PATCH] Update the barrier cache during ARM EHABI unwinding - ---- - src/libpanic_unwind/gcc.rs | 8 +++++++- - src/libunwind/libunwind.rs | 2 ++ - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs -index 4f572fe21b30..328d0d4ce7be 100644 ---- a/src/libpanic_unwind/gcc.rs -+++ b/src/libpanic_unwind/gcc.rs -@@ -187,7 +187,13 @@ cfg_if::cfg_if! { - match eh_action { - EHAction::None | - EHAction::Cleanup(_) => return continue_unwind(exception_object, context), -- EHAction::Catch(_) => return uw::_URC_HANDLER_FOUND, -+ EHAction::Catch(_) => { -+ // EHABI requires the personality routine to update the -+ // SP value in the barrier cache of the exception object. -+ (*exception_object).private[5] = -+ uw::_Unwind_GetGR(context, uw::UNWIND_SP_REG); -+ return uw::_URC_HANDLER_FOUND; -+ } - EHAction::Terminate => return uw::_URC_FAILURE, - } - } else { -diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs -index 0b39503c0d03..30658ce328d8 100644 ---- a/src/libunwind/libunwind.rs -+++ b/src/libunwind/libunwind.rs -@@ -23,6 +23,7 @@ pub type _Unwind_Word = uintptr_t; - pub type _Unwind_Ptr = uintptr_t; - pub type _Unwind_Trace_Fn = extern "C" fn(ctx: *mut _Unwind_Context, arg: *mut c_void) - -> _Unwind_Reason_Code; -+ - #[cfg(target_arch = "x86")] - pub const unwinder_private_data_size: usize = 5; - -@@ -151,6 +152,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm - use _Unwind_VRS_DataRepresentation::*; - - pub const UNWIND_POINTER_REG: c_int = 12; -+ pub const UNWIND_SP_REG: c_int = 13; - pub const UNWIND_IP_REG: c_int = 15; - - #[cfg_attr(all(feature = "llvm-libunwind", --- -2.24.1 - diff --git a/SOURCES/rust-pr68019-in-tree-compiletest.patch b/SOURCES/rust-pr68019-in-tree-compiletest.patch deleted file mode 100644 index a0b28bf..0000000 --- a/SOURCES/rust-pr68019-in-tree-compiletest.patch +++ /dev/null @@ -1,97 +0,0 @@ -From ed8e55fe8d732d8a87343441db3bfbb974f043df Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 8 Jan 2020 09:44:45 -0800 -Subject: [PATCH 1/2] Remove obsolete llvm_tools flag - ---- - src/bootstrap/tool.rs | 12 +----------- - 1 file changed, 1 insertion(+), 11 deletions(-) - -diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs -index 815498047fd5..f785a0989a36 100644 ---- a/src/bootstrap/tool.rs -+++ b/src/bootstrap/tool.rs -@@ -293,7 +293,6 @@ fn rustbook_features() -> Vec { - macro_rules! bootstrap_tool { - ($( - $name:ident, $path:expr, $tool_name:expr -- $(,llvm_tools = $llvm:expr)* - $(,is_external_tool = $external:expr)* - $(,features = $features:expr)* - ; -@@ -305,15 +304,6 @@ macro_rules! bootstrap_tool { - )+ - } - -- impl Tool { -- /// Whether this tool requires LLVM to run -- pub fn uses_llvm_tools(&self) -> bool { -- match self { -- $(Tool::$name => false $(|| $llvm)*,)+ -- } -- } -- } -- - impl<'a> Builder<'a> { - pub fn tool_exe(&self, tool: Tool) -> PathBuf { - match tool { -@@ -381,7 +371,7 @@ bootstrap_tool!( - Tidy, "src/tools/tidy", "tidy"; - Linkchecker, "src/tools/linkchecker", "linkchecker"; - CargoTest, "src/tools/cargotest", "cargotest"; -- Compiletest, "src/tools/compiletest", "compiletest", llvm_tools = true; -+ Compiletest, "src/tools/compiletest", "compiletest"; - BuildManifest, "src/tools/build-manifest", "build-manifest"; - RemoteTestClient, "src/tools/remote-test-client", "remote-test-client"; - RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true; --- -2.24.1 - - -From cc4688d66d75e149a0136f701045cbf7ee672725 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 8 Jan 2020 10:04:18 -0800 -Subject: [PATCH 2/2] Build compiletest with in-tree libtest - ---- - src/bootstrap/tool.rs | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs -index f785a0989a36..73a4dda74e88 100644 ---- a/src/bootstrap/tool.rs -+++ b/src/bootstrap/tool.rs -@@ -294,6 +294,7 @@ macro_rules! bootstrap_tool { - ($( - $name:ident, $path:expr, $tool_name:expr - $(,is_external_tool = $external:expr)* -+ $(,is_unstable_tool = $unstable:expr)* - $(,features = $features:expr)* - ; - )+) => { -@@ -344,7 +345,12 @@ macro_rules! bootstrap_tool { - compiler: self.compiler, - target: self.target, - tool: $tool_name, -- mode: Mode::ToolBootstrap, -+ mode: if false $(|| $unstable)* { -+ // use in-tree libraries for unstable features -+ Mode::ToolStd -+ } else { -+ Mode::ToolBootstrap -+ }, - path: $path, - is_optional_tool: false, - source_type: if false $(|| $external)* { -@@ -371,7 +377,7 @@ bootstrap_tool!( - Tidy, "src/tools/tidy", "tidy"; - Linkchecker, "src/tools/linkchecker", "linkchecker"; - CargoTest, "src/tools/cargotest", "cargotest"; -- Compiletest, "src/tools/compiletest", "compiletest"; -+ Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true; - BuildManifest, "src/tools/build-manifest", "build-manifest"; - RemoteTestClient, "src/tools/remote-test-client", "remote-test-client"; - RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true; --- -2.24.1 - diff --git a/SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch b/SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch new file mode 100644 index 0000000..d076d35 --- /dev/null +++ b/SOURCES/rust-pr70123-ensure-llvm-is-in-the-link-path.patch @@ -0,0 +1,210 @@ +commit 9423c4f0dda638ec2a925140850b85e8d3e6d455 (from bee074f032970fd1b59650c04a70e75eeee9c63b) +Merge: bee074f03297 3a2a4429a288 +Author: Mazdak Farrokhzad +Date: Mon Mar 23 10:29:13 2020 +0100 + + Rollup merge of #70123 - cuviper:library-path, r=Mark-Simulacrum + + Ensure LLVM is in the link path for rustc tools + + The build script for `rustc_llvm` outputs LLVM information in `cargo:rustc-link-lib` and `cargo:rustc-link-search` so the compiler can be linked correctly. However, while the lib is carried along in metadata, the search paths are not. So when cargo is invoked again later for rustc _tools_, they'll also try to link with LLVM, but the necessary paths may be left out. + + Rustbuild can use the environment to set the LLVM link path for tools -- `LIB` for MSVC toolchains and `LIBRARY_PATH` for everyone else. + + Fixes #68714. + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 602e4511ea58..dd519506d42a 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; + use std::process::Command; + use std::time::{Duration, Instant}; + +-use build_helper::t; ++use build_helper::{output, t}; + + use crate::cache::{Cache, Interned, INTERNER}; + use crate::check; +@@ -23,7 +23,7 @@ use crate::install; + use crate::native; + use crate::test; + use crate::tool; +-use crate::util::{self, add_lib_path, exe, libdir}; ++use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir}; + use crate::{Build, DocTests, GitRepo, Mode}; + + pub use crate::Compiler; +@@ -660,7 +660,7 @@ impl<'a> Builder<'a> { + return; + } + +- add_lib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); ++ add_dylib_path(vec![self.rustc_libdir(compiler)], &mut cmd.command); + } + + /// Gets a path to the compiler specified. +@@ -698,6 +698,20 @@ impl<'a> Builder<'a> { + cmd + } + ++ /// Return the path to `llvm-config` for the target, if it exists. ++ /// ++ /// Note that this returns `None` if LLVM is disabled, or if we're in a ++ /// check build or dry-run, where there's no need to build all of LLVM. ++ fn llvm_config(&self, target: Interned) -> Option { ++ if self.config.llvm_enabled() && self.kind != Kind::Check && !self.config.dry_run { ++ let llvm_config = self.ensure(native::Llvm { target }); ++ if llvm_config.is_file() { ++ return Some(llvm_config); ++ } ++ } ++ None ++ } ++ + /// Prepares an invocation of `cargo` to be run. + /// + /// This will create a `Command` that represents a pending execution of +@@ -1034,6 +1048,17 @@ impl<'a> Builder<'a> { + .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler)); + } + ++ // Tools that use compiler libraries may inherit the `-lLLVM` link ++ // requirement, but the `-L` library path is not propagated across ++ // separate Cargo projects. We can add LLVM's library path to the ++ // platform-specific environment variable as a workaround. ++ if mode == Mode::ToolRustc { ++ if let Some(llvm_config) = self.llvm_config(target) { ++ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); ++ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cargo); ++ } ++ } ++ + if self.config.incremental { + cargo.env("CARGO_INCREMENTAL", "1"); + } else { +diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs +index 65a00db33949..ad494b88b3af 100644 +--- a/src/bootstrap/compile.rs ++++ b/src/bootstrap/compile.rs +@@ -451,44 +451,6 @@ impl Step for Rustc { + false, + ); + +- // We used to build librustc_codegen_llvm as a separate step, +- // which produced a dylib that the compiler would dlopen() at runtime. +- // This meant that we only needed to make sure that libLLVM.so was +- // installed by the time we went to run a tool using it - since +- // librustc_codegen_llvm was effectively a standalone artifact, +- // other crates were completely oblivious to its dependency +- // on `libLLVM.so` during build time. +- // +- // However, librustc_codegen_llvm is now built as an ordinary +- // crate during the same step as the rest of the compiler crates. +- // This means that any crates depending on it will see the fact +- // that it uses `libLLVM.so` as a native library, and will +- // cause us to pass `-llibLLVM.so` to the linker when we link +- // a binary. +- // +- // For `rustc` itself, this works out fine. +- // During the `Assemble` step, we call `dist::maybe_install_llvm_dylib` +- // to copy libLLVM.so into the `stage` directory. We then link +- // the compiler binary, which will find `libLLVM.so` in the correct place. +- // +- // However, this is insufficient for tools that are build against stage0 +- // (e.g. stage1 rustdoc). Since `Assemble` for stage0 doesn't actually do anything, +- // we won't have `libLLVM.so` in the stage0 sysroot. In the past, this wasn't +- // a problem - we would copy the tool binary into its correct stage directory +- // (e.g. stage1 for a stage1 rustdoc built against a stage0 compiler). +- // Since libLLVM.so wasn't resolved until runtime, it was fine for it to +- // not exist while we were building it. +- // +- // To ensure that we can still build stage1 tools against a stage0 compiler, +- // we explicitly copy libLLVM.so into the stage0 sysroot when building +- // the stage0 compiler. This ensures that tools built against stage0 +- // will see libLLVM.so at build time, making the linker happy. +- if compiler.stage == 0 { +- builder.info(&format!("Installing libLLVM.so to stage 0 ({})", compiler.host)); +- let sysroot = builder.sysroot(compiler); +- dist::maybe_install_llvm_dylib(builder, compiler.host, &sysroot); +- } +- + builder.ensure(RustcLink { + compiler: builder.compiler(compiler.stage, builder.config.build), + target_compiler: compiler, +diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs +index 67e0ed5c5802..c8ccba467e50 100644 +--- a/src/bootstrap/tool.rs ++++ b/src/bootstrap/tool.rs +@@ -12,7 +12,7 @@ use crate::channel; + use crate::channel::GitInfo; + use crate::compile; + use crate::toolstate::ToolState; +-use crate::util::{add_lib_path, exe, CiEnv}; ++use crate::util::{add_dylib_path, exe, CiEnv}; + use crate::Compiler; + use crate::Mode; + +@@ -388,7 +388,7 @@ pub struct ErrorIndex { + impl ErrorIndex { + pub fn command(builder: &Builder<'_>, compiler: Compiler) -> Command { + let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); +- add_lib_path( ++ add_dylib_path( + vec![PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host))], + &mut cmd, + ); +@@ -689,7 +689,7 @@ impl<'a> Builder<'a> { + } + } + +- add_lib_path(lib_paths, &mut cmd); ++ add_dylib_path(lib_paths, &mut cmd); + cmd + } + } +diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs +index eac790fe504b..2bc6f1939d97 100644 +--- a/src/bootstrap/util.rs ++++ b/src/bootstrap/util.rs +@@ -40,7 +40,7 @@ pub fn libdir(target: &str) -> &'static str { + } + + /// Adds a list of lookup paths to `cmd`'s dynamic library lookup path. +-pub fn add_lib_path(path: Vec, cmd: &mut Command) { ++pub fn add_dylib_path(path: Vec, cmd: &mut Command) { + let mut list = dylib_path(); + for path in path { + list.insert(0, path); +@@ -72,6 +72,31 @@ pub fn dylib_path() -> Vec { + env::split_paths(&var).collect() + } + ++/// Adds a list of lookup paths to `cmd`'s link library lookup path. ++pub fn add_link_lib_path(path: Vec, cmd: &mut Command) { ++ let mut list = link_lib_path(); ++ for path in path { ++ list.insert(0, path); ++ } ++ cmd.env(link_lib_path_var(), t!(env::join_paths(list))); ++} ++ ++/// Returns the environment variable which the link library lookup path ++/// resides in for this platform. ++fn link_lib_path_var() -> &'static str { ++ if cfg!(target_env = "msvc") { "LIB" } else { "LIBRARY_PATH" } ++} ++ ++/// Parses the `link_lib_path_var()` environment variable, returning a list of ++/// paths that are members of this lookup path. ++fn link_lib_path() -> Vec { ++ let var = match env::var_os(link_lib_path_var()) { ++ Some(v) => v, ++ None => return vec![], ++ }; ++ env::split_paths(&var).collect() ++} ++ + /// `push` all components to `buf`. On windows, append `.exe` to the last component. + pub fn push_exe_path(mut buf: PathBuf, components: &[&str]) -> PathBuf { + let (&file, components) = components.split_last().expect("at least one component required"); diff --git a/SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch b/SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch new file mode 100644 index 0000000..765c2e9 --- /dev/null +++ b/SOURCES/rust-pr70163-prepare-for-llvm-10-upgrade.patch @@ -0,0 +1,175 @@ +commit 374ab25585f0a817fe7bd6986737f12347b12d0b (from 1add455ec6f81045e7651c6225902823f5d4fbfa) +Merge: 1add455ec6f8 497f879b1e24 +Author: bors +Date: Tue Mar 24 12:42:54 2020 +0000 + + Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper + + Prepare for LLVM 10 upgrade + + This is #67759 minus the submodule update. + + * Fix two compatibility issues in the rustllvm wrapper. + * Update data layout strings in tests. + * Fix LLVM version comparison (this become a problem because the major version has two digits now). + + r? @cuviper + +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index aa1d1b7c4241..b52fbe4666eb 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -1141,6 +1141,8 @@ impl Step for Compiletest { + let llvm_config = builder.ensure(native::Llvm { target: builder.config.build }); + if !builder.config.dry_run { + let llvm_version = output(Command::new(&llvm_config).arg("--version")); ++ // Remove trailing newline from llvm-config output. ++ let llvm_version = llvm_version.trim_end(); + cmd.arg("--llvm-version").arg(llvm_version); + } + if !builder.is_rust_llvm(target) { +diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp +index 90d24d20737d..9e8614e3b6d3 100644 +--- a/src/rustllvm/PassWrapper.cpp ++++ b/src/rustllvm/PassWrapper.cpp +@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() { + } + + extern "C" void LLVMTimeTraceProfilerInitialize() { +-#if LLVM_VERSION_GE(9, 0) ++#if LLVM_VERSION_GE(10, 0) ++ timeTraceProfilerInitialize( ++ /* TimeTraceGranularity */ 0, ++ /* ProcName */ "rustc"); ++#elif LLVM_VERSION_GE(9, 0) + timeTraceProfilerInitialize(); + #endif + } +diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp +index 25cfee3373dc..799adb418822 100644 +--- a/src/rustllvm/RustWrapper.cpp ++++ b/src/rustllvm/RustWrapper.cpp +@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B, + LLVMValueRef Dst, unsigned DstAlign, + LLVMValueRef Val, + LLVMValueRef Size, bool IsVolatile) { ++#if LLVM_VERSION_GE(10, 0) ++ return wrap(unwrap(B)->CreateMemSet( ++ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile)); ++#else + return wrap(unwrap(B)->CreateMemSet( + unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile)); ++#endif + } + + extern "C" LLVMValueRef +diff --git a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json +index 8d028280a8da..00de3de05f07 100644 +--- a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json ++++ b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json +@@ -1,5 +1,5 @@ + { +- "data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", ++ "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128", + "linker-flavor": "gcc", + "llvm-target": "i686-unknown-linux-gnu", + "target-endian": "little", +diff --git a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json +index 48040ae3da0e..6d5e964ed4fe 100644 +--- a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json ++++ b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json +@@ -1,6 +1,6 @@ + { + "pre-link-args": {"gcc": ["-m64"]}, +- "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", ++ "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", + "linker-flavor": "gcc", + "llvm-target": "x86_64-unknown-linux-gnu", + "target-endian": "little", +diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs +index 2a24a8c3c948..cb648db8830e 100644 +--- a/src/tools/compiletest/src/header.rs ++++ b/src/tools/compiletest/src/header.rs +@@ -191,6 +191,7 @@ impl EarlyProps { + return true; + } + if let Some(ref actual_version) = config.llvm_version { ++ let actual_version = version_to_int(actual_version); + if line.starts_with("min-llvm-version") { + let min_version = line + .trim_end() +@@ -199,7 +200,7 @@ impl EarlyProps { + .expect("Malformed llvm version directive"); + // Ignore if actual version is smaller the minimum required + // version +- &actual_version[..] < min_version ++ actual_version < version_to_int(min_version) + } else if line.starts_with("min-system-llvm-version") { + let min_version = line + .trim_end() +@@ -208,7 +209,7 @@ impl EarlyProps { + .expect("Malformed llvm version directive"); + // Ignore if using system LLVM and actual version + // is smaller the minimum required version +- config.system_llvm && &actual_version[..] < min_version ++ config.system_llvm && actual_version < version_to_int(min_version) + } else if line.starts_with("ignore-llvm-version") { + // Syntax is: "ignore-llvm-version [- ]" + let range_components = line +@@ -219,15 +220,15 @@ impl EarlyProps { + .take(3) // 3 or more = invalid, so take at most 3. + .collect::>(); + match range_components.len() { +- 1 => &actual_version[..] == range_components[0], ++ 1 => actual_version == version_to_int(range_components[0]), + 2 => { +- let v_min = range_components[0]; +- let v_max = range_components[1]; ++ let v_min = version_to_int(range_components[0]); ++ let v_max = version_to_int(range_components[1]); + if v_max < v_min { + panic!("Malformed LLVM version range: max < min") + } + // Ignore if version lies inside of range. +- &actual_version[..] >= v_min && &actual_version[..] <= v_max ++ actual_version >= v_min && actual_version <= v_max + } + _ => panic!("Malformed LLVM version directive"), + } +@@ -238,6 +239,20 @@ impl EarlyProps { + false + } + } ++ ++ fn version_to_int(version: &str) -> u32 { ++ let version_without_suffix = version.split('-').next().unwrap(); ++ let components: Vec = version_without_suffix ++ .split('.') ++ .map(|s| s.parse().expect("Malformed version component")) ++ .collect(); ++ match components.len() { ++ 1 => components[0] * 10000, ++ 2 => components[0] * 10000 + components[1] * 100, ++ 3 => components[0] * 10000 + components[1] * 100 + components[2], ++ _ => panic!("Malformed version"), ++ } ++ } + } + } + +diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs +index 6c478f7e29da..31d991e0c2f8 100644 +--- a/src/tools/compiletest/src/header/tests.rs ++++ b/src/tools/compiletest/src/header/tests.rs +@@ -122,9 +122,8 @@ fn llvm_version() { + config.llvm_version = Some("9.3.1-rust-1.43.0-dev".to_owned()); + assert!(!parse_rs(&config, "// min-llvm-version 9.2").ignore); + +- // FIXME. +- // config.llvm_version = Some("10.0.0-rust".to_owned()); +- // assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); ++ config.llvm_version = Some("10.0.0-rust".to_owned()); ++ assert!(!parse_rs(&config, "// min-llvm-version 9.0").ignore); + } + + #[test] diff --git a/SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch b/SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch new file mode 100644 index 0000000..9f5722b --- /dev/null +++ b/SOURCES/rust-pr70591-ensure-llvm-is-in-the-link-path.patch @@ -0,0 +1,40 @@ +commit 6067315d58ff3d49b305ae3c99810656856c8e21 +Author: Josh Stone +Date: Mon Mar 30 14:03:39 2020 -0700 + + Ensure LLVM is in the link path for "fulldeps" tests + + This is a follow-up to #70123, which added `llvm-config --libdir` to the + `LIBRARY_PATH` for rustc tools. We need the same for "run-make-fulldeps" + and "ui-fulldeps" tests which depend on compiler libraries, implicitly + needing to link to `-lLLVM` as well. + +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index 5b946b05735d..2499856235f1 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -21,7 +21,7 @@ use crate::flags::Subcommand; + use crate::native; + use crate::tool::{self, SourceType, Tool}; + use crate::toolstate::ToolState; +-use crate::util::{self, dylib_path, dylib_path_var}; ++use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var}; + use crate::Crate as CargoCrate; + use crate::{envify, DocTests, GitRepo, Mode}; + +@@ -1178,6 +1178,15 @@ impl Step for Compiletest { + cmd.arg("--system-llvm"); + } + ++ // Tests that use compiler libraries may inherit the `-lLLVM` link ++ // requirement, but the `-L` library path is not propagated across ++ // separate compilations. We can add LLVM's library path to the ++ // platform-specific environment variable as a workaround. ++ if !builder.config.dry_run && suite.ends_with("fulldeps") { ++ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); ++ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd); ++ } ++ + // Only pass correct values for these flags for the `run-make` suite as it + // requires that a C++ compiler was configured which isn't always the case. + if !builder.config.dry_run && suite == "run-make-fulldeps" { diff --git a/SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch b/SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch new file mode 100644 index 0000000..df02449 --- /dev/null +++ b/SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch @@ -0,0 +1,56 @@ +From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 1 May 2020 16:50:10 -0700 +Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null + +--- + src/test/ui/non-ice-error-on-worker-io-fail.rs | 10 +++++++--- + src/test/ui/non-ice-error-on-worker-io-fail.stderr | 2 +- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.rs b/src/test/ui/non-ice-error-on-worker-io-fail.rs +index 8af17742850d..30779fc65c0f 100644 +--- a/src/test/ui/non-ice-error-on-worker-io-fail.rs ++++ b/src/test/ui/non-ice-error-on-worker-io-fail.rs +@@ -4,8 +4,12 @@ + // + // An attempt to `-o` into a directory we cannot write into should indeed + // be an error; but not an ICE. ++// ++// However, some folks run tests as root, which can write `/dev/` and end ++// up clobbering `/dev/null`. Instead we'll use a non-existent path, which ++// also used to ICE, but even root can't magically write there. + +-// compile-flags: -o /dev/null ++// compile-flags: -o /does-not-exist/output + + // The error-pattern check occurs *before* normalization, and the error patterns + // are wildly different between build environments. So this is a cop-out (and we +@@ -15,10 +19,10 @@ + // error-pattern: error + + // On Mac OS X, we get an error like the below +-// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/" ++// normalize-stderr-test "failed to write bytecode to /does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying /does-not-exist/" + + // On Linux, we get an error like the below +-// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/" ++// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /does-not-exist/" + + // ignore-tidy-linelength + // ignore-windows - this is a unix-specific test +diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.stderr b/src/test/ui/non-ice-error-on-worker-io-fail.stderr +index f732abc52b71..edadecf273a7 100644 +--- a/src/test/ui/non-ice-error-on-worker-io-fail.stderr ++++ b/src/test/ui/non-ice-error-on-worker-io-fail.stderr +@@ -1,6 +1,6 @@ + warning: ignoring --out-dir flag due to -o flag + +-error: io error modifying /dev/ ++error: io error modifying /does-not-exist/ + + error: aborting due to previous error + +-- +2.26.2 + diff --git a/SOURCES/rustc-1.39.0-disable-libssh2.patch b/SOURCES/rustc-1.39.0-disable-libssh2.patch deleted file mode 100644 index fdcdcc3..0000000 --- a/SOURCES/rustc-1.39.0-disable-libssh2.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- rustc-1.39.0-src/Cargo.lock.orig 2019-11-04 07:45:21.000000000 -0800 -+++ rustc-1.39.0-src/Cargo.lock 2019-11-08 13:25:37.743377197 -0800 -@@ -1697,7 +1697,6 @@ - dependencies = [ - "cc", - "libc", -- "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -@@ -1714,20 +1713,6 @@ - ] - - [[package]] --name = "libssh2-sys" --version = "0.2.11" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d" --dependencies = [ -- "cc", -- "libc", -- "libz-sys", -- "openssl-sys", -- "pkg-config", -- "vcpkg", --] -- --[[package]] - name = "libz-sys" - version = "1.0.25" - source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.39.0-src/vendor/git2/Cargo.toml.orig 2019-11-04 09:34:41.000000000 -0800 -+++ rustc-1.39.0-src/vendor/git2/Cargo.toml 2019-11-08 13:25:13.174904479 -0800 -@@ -55,7 +55,7 @@ - version = "0.1.39" - - [features] --default = ["ssh", "https", "ssh_key_from_memory"] -+default = ["https"] - https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] - ssh = ["libgit2-sys/ssh"] - ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/SOURCES/rustc-1.42.0-disable-libssh2.patch b/SOURCES/rustc-1.42.0-disable-libssh2.patch new file mode 100644 index 0000000..770ad34 --- /dev/null +++ b/SOURCES/rustc-1.42.0-disable-libssh2.patch @@ -0,0 +1,42 @@ +--- rustc-1.42.0-src/Cargo.lock.orig 2020-03-09 15:11:17.000000000 -0700 ++++ rustc-1.42.0-src/Cargo.lock 2020-04-02 16:39:22.268896227 -0700 +@@ -1796,7 +1796,6 @@ + dependencies = [ + "cc", + "libc", +- "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +@@ -1813,20 +1812,6 @@ + ] + + [[package]] +-name = "libssh2-sys" +-version = "0.2.14" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10" +-dependencies = [ +- "cc", +- "libc", +- "libz-sys", +- "openssl-sys", +- "pkg-config", +- "vcpkg", +-] +- +-[[package]] + name = "libz-sys" + version = "1.0.25" + source = "registry+https://github.com/rust-lang/crates.io-index" +--- rustc-1.42.0-src/vendor/git2/Cargo.toml.orig 2020-03-09 17:00:19.000000000 -0700 ++++ rustc-1.42.0-src/vendor/git2/Cargo.toml 2020-04-02 16:38:46.163664007 -0700 +@@ -55,7 +55,7 @@ + version = "0.1.39" + + [features] +-default = ["ssh", "https", "ssh_key_from_memory"] ++default = ["https"] + https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] + ssh = ["libgit2-sys/ssh"] + ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] diff --git a/SPECS/rust.spec b/SPECS/rust.spec index 76adf3a..b195df6 100644 --- a/SPECS/rust.spec +++ b/SPECS/rust.spec @@ -10,10 +10,10 @@ # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD # Note that cargo matches the program version here, not its crate version. -%global bootstrap_rust 1.40.0 -%global bootstrap_cargo 1.40.0 -%global bootstrap_channel 1.40.0 -%global bootstrap_date 2019-12-19 +%global bootstrap_rust 1.42.0 +%global bootstrap_cargo 1.42.0 +%global bootstrap_channel 1.42.0 +%global bootstrap_date 2020-03-12 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -49,7 +49,7 @@ %endif Name: rust -Version: 1.41.1 +Version: 1.43.1 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -68,18 +68,21 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # We do have the necessary fix in our LLVM 7. Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# Fix compiletest with newer (local-rebuild) libtest -# https://github.com/rust-lang/rust/commit/241d2e765dc7401e642812e43b75dbc3950f2c98 -Patch2: 0001-Fix-compiletest-fallout-from-stage0-bump.patch -# https://github.com/rust-lang/rust/pull/68019 -Patch3: rust-pr68019-in-tree-compiletest.patch +# Ensure LLVM is in the link path for rustc tools and "fulldeps" tests +# https://github.com/rust-lang/rust/pull/70123 +# https://github.com/rust-lang/rust/pull/70591 +Patch2: rust-pr70123-ensure-llvm-is-in-the-link-path.patch +Patch3: rust-pr70591-ensure-llvm-is-in-the-link-path.patch -# Fix ARM unwinding for foreign-exceptions -# https://github.com/rust-lang/rust/pull/67779 -Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch +# Prepare for LLVM 10 upgrade +# https://github.com/rust-lang/rust/pull/70163 +Patch4: rust-pr70163-prepare-for-llvm-10-upgrade.patch + +# https://github.com/rust-lang/rust/pull/71782 +Patch5: rust-pr71782-Use-a-non-existent-test-path.patch # Disable cargo->libgit2->libssh2, as it's not approved for FIPS (rhbz1732949) -Patch10: rustc-1.39.0-disable-libssh2.patch +Patch10: rustc-1.42.0-disable-libssh2.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -171,9 +174,6 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} %global llvm llvm7.0 %endif -%if 0%{?fedora} >= 32 -%global llvm llvm9.0 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -195,7 +195,6 @@ BuildRequires: gdb # TODO: work on unbundling these! Provides: bundled(libbacktrace) = 8.1.0 -Provides: bundled(miniz) = 2.0.7 # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} @@ -235,10 +234,6 @@ Requires: /usr/bin/cc %if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} %global llvm_has_filecheck 1 %endif -%if "%{llvm_root}" != "%{_prefix}" -# https://github.com/rust-lang/rust/issues/68714 -%global library_path $(%{llvm_root}/bin/llvm-config --libdir) -%endif %endif %description @@ -310,10 +305,10 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.28.2 +Provides: bundled(libgit2) = 0.99.0 %endif %if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.8.1~dev +Provides: bundled(libssh2) = 1.9.0~dev %endif # For tests: BuildRequires: git @@ -356,10 +351,10 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.28.2 +Provides: bundled(libgit2) = 0.99.0 %endif %if %with bundled_libssh2 -Provides: bundled(libssh2) = 1.8.1~dev +Provides: bundled(libssh2) = 1.9.0~dev %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs @@ -425,6 +420,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %if %with disabled_libssh2 %patch10 -p1 @@ -499,7 +495,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %endif %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # We're going to override --libdir when configuring to get rustlib into a @@ -550,7 +545,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %install %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} %{python} ./x.py install @@ -621,7 +615,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %check %{?cmake_path:export PATH=%{cmake_path}:$PATH} -%{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} # The results are not stable on koji, so mask errors and just log it. @@ -740,6 +733,15 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu May 07 2020 Josh Stone - 1.43.1-1 +- Update to 1.43.1. + +* Thu Apr 23 2020 Josh Stone - 1.43.0-1 +- Update to 1.43.0. + +* Thu Mar 12 2020 Josh Stone - 1.42.0-1 +- Update to 1.42.0. + * Thu Feb 27 2020 Josh Stone - 1.41.1-1 - Update to 1.41.1.