From 8158182b959553c75253e95ef416ff17c2baee3e Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Oct 09 2019 19:00:13 +0000 Subject: re-patch for 1.34.2 --- diff --git a/.gitignore b/.gitignore index 6624f94..502c77e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ SOURCES/rustc-1.31.1-src.tar.xz SOURCES/rustc-1.32.0-src.tar.xz SOURCES/rustc-1.33.0-src.tar.xz +SOURCES/rustc-1.34.0-src.tar.xz +SOURCES/rustc-1.34.2-src.tar.xz diff --git a/.rust.metadata b/.rust.metadata index bde5747..e762a9f 100644 --- a/.rust.metadata +++ b/.rust.metadata @@ -1 +1 @@ -9ec4301042b52b05a649d4bb47494fe2ad294fdd SOURCES/rustc-1.33.0-src.tar.xz +8df2fc25e21e5e097020cc78c134616b4cc8101e SOURCES/rustc-1.34.2-src.tar.xz diff --git a/SOURCES/0001-Backport-deprecation-fixes-from-commit-b7f030e.patch b/SOURCES/0001-Backport-deprecation-fixes-from-commit-b7f030e.patch deleted file mode 100644 index 6e51ef3..0000000 --- a/SOURCES/0001-Backport-deprecation-fixes-from-commit-b7f030e.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 55030c7543d8e877ec7a6b577a51422c38f01259 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 1 Mar 2019 09:27:45 -0800 -Subject: [PATCH] Backport deprecation fixes from commit b7f030e - ---- - src/tools/linkchecker/main.rs | 6 +++--- - src/tools/tidy/src/features.rs | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs -index 59662be349dc..2cf0fcfd34cd 100644 ---- a/src/tools/linkchecker/main.rs -+++ b/src/tools/linkchecker/main.rs -@@ -78,7 +78,7 @@ impl FileEntry { - fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) { - if self.ids.is_empty() { - with_attrs_in_source(contents, " id", |fragment, i, _| { -- let frag = fragment.trim_left_matches("#").to_owned(); -+ let frag = fragment.trim_start_matches("#").to_owned(); - let encoded = small_url_encode(&frag); - if !self.ids.insert(frag) { - *errors = true; -@@ -343,7 +343,7 @@ fn with_attrs_in_source(contents: &str, attr: &str, - Some(i) => i, - None => continue, - }; -- if rest[..pos_equals].trim_left_matches(" ") != "" { -+ if rest[..pos_equals].trim_start_matches(" ") != "" { - continue; - } - -@@ -355,7 +355,7 @@ fn with_attrs_in_source(contents: &str, attr: &str, - }; - let quote_delim = rest.as_bytes()[pos_quote] as char; - -- if rest[..pos_quote].trim_left_matches(" ") != "" { -+ if rest[..pos_quote].trim_start_matches(" ") != "" { - continue; - } - let rest = &rest[pos_quote + 1..]; -diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs -index 2435a0cfd4e3..bf2cfbf32fc7 100644 ---- a/src/tools/tidy/src/features.rs -+++ b/src/tools/tidy/src/features.rs -@@ -188,7 +188,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features { - } - - let mut parts = line.split(','); -- let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) { -+ let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) { - Some("active") => Status::Unstable, - Some("removed") => Status::Removed, - Some("accepted") => Status::Stable, --- -2.20.1 - diff --git a/SOURCES/0001-Limit-internalization-in-LLVM-8-ThinLTO.patch b/SOURCES/0001-Limit-internalization-in-LLVM-8-ThinLTO.patch new file mode 100644 index 0000000..3c09947 --- /dev/null +++ b/SOURCES/0001-Limit-internalization-in-LLVM-8-ThinLTO.patch @@ -0,0 +1,29 @@ +From b4131e297e18fde119f6f461b3e622218166b009 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 26 Apr 2019 08:58:14 -0700 +Subject: [PATCH] Limit internalization in LLVM 8 ThinLTO + +--- + src/rustllvm/PassWrapper.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp +index 319c66a21f17..0ebef82d3768 100644 +--- a/src/rustllvm/PassWrapper.cpp ++++ b/src/rustllvm/PassWrapper.cpp +@@ -873,8 +873,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, + return PrevailingType::Unknown; + }; + #if LLVM_VERSION_GE(8, 0) ++ // We don't have a complete picture in our use of ThinLTO, just our immediate ++ // crate, so we need `ImportEnabled = false` to limit internalization. ++ // Otherwise, we sometimes lose `static` values -- see #60184. + computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols, +- deadIsPrevailing, /* ImportEnabled = */ true); ++ deadIsPrevailing, /* ImportEnabled = */ false); + #else + computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing); + #endif +-- +2.20.1 + diff --git a/SOURCES/0001-Try-to-get-the-target-triple-from-rustc-itself.patch b/SOURCES/0001-Try-to-get-the-target-triple-from-rustc-itself.patch deleted file mode 100644 index 90f3115..0000000 --- a/SOURCES/0001-Try-to-get-the-target-triple-from-rustc-itself.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 72cd8aedc2901d6a6b598eadc001cc39040ae487 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 12 Dec 2018 16:51:31 -0800 -Subject: [PATCH] Try to get the target triple from rustc itself - -The prior method was trying to pick the triple out of the sysroot path. -A FIXME comment already notes that this doesn't work with custom -toolchains in rustup. It also fails with distro-installed toolchains, -where the sysroot may simply be `/usr`. - -The output of `rustc -Vv` is a more reliable source, as it contains a -line like `host: x86_64-unknown-linux-gnu`. This should be enough to -identify the triple for any `rustc`, but just in case, the path-based -code is kept as a fallback. ---- - src/loader.rs | 41 ++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 38 insertions(+), 3 deletions(-) - -diff --git a/src/loader.rs b/src/loader.rs -index 645c95139164..fe92bef1c596 100644 ---- a/src/loader.rs -+++ b/src/loader.rs -@@ -108,9 +108,33 @@ impl AnalysisLoader for CargoAnalysisLoader { - } - } - -+fn extract_target_triple(sys_root_path: &Path) -> String { -+ // First try to get the triple from the rustc version output, -+ // otherwise fall back on the rustup-style toolchain path. -+ extract_rustc_host_triple() -+ .unwrap_or_else(|| extract_rustup_target_triple(sys_root_path)) -+} -+ -+fn extract_rustc_host_triple() -> Option { -+ let rustc = env::var("RUSTC").unwrap_or(String::from("rustc")); -+ let verbose_version = Command::new(rustc) -+ .arg("--verbose") -+ .arg("--version") -+ .output() -+ .ok() -+ .and_then(|out| String::from_utf8(out.stdout).ok())?; -+ -+ // Extracts the triple from a line like `host: x86_64-unknown-linux-gnu` -+ verbose_version -+ .lines() -+ .find(|line| line.starts_with("host: ")) -+ .and_then(|host| host.split_whitespace().nth(1)) -+ .map(String::from) -+} -+ - // FIXME: This can fail when using a custom toolchain in rustup (often linked to - // `/$rust_repo/build/$target/stage2`) --fn extract_target_triple(sys_root_path: &Path) -> String { -+fn extract_rustup_target_triple(sys_root_path: &Path) -> String { - // Extracts nightly-x86_64-pc-windows-msvc from - // $HOME/.rustup/toolchains/nightly-x86_64-pc-windows-msvc - let toolchain = sys_root_path -@@ -169,7 +193,7 @@ mod tests { - r#"C:\Users\user\.rustup\toolchains\nightly-x86_64-pc-windows-msvc"#, - ); - assert_eq!( -- extract_target_triple(path), -+ extract_rustup_target_triple(path), - String::from("x86_64-pc-windows-msvc") - ); - } -@@ -180,8 +204,19 @@ mod tests { - "/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu", - ); - assert_eq!( -- extract_target_triple(path), -+ extract_rustup_target_triple(path), - String::from("x86_64-unknown-linux-gnu") - ); - } -+ -+ #[test] -+ fn target_triple() { -+ let sys_root_path = sys_root_path(); -+ let target_triple = extract_target_triple(&sys_root_path); -+ let target_path = sys_root_path -+ .join("lib") -+ .join("rustlib") -+ .join(&target_triple); -+ assert!(target_path.is_dir(), "{:?} is not a directory!", target_path); -+ } - } --- -2.19.2 - diff --git a/SOURCES/0001-rust-gdb-relax-the-GDB-version-regex.patch b/SOURCES/0001-rust-gdb-relax-the-GDB-version-regex.patch deleted file mode 100644 index 6905230..0000000 --- a/SOURCES/0001-rust-gdb-relax-the-GDB-version-regex.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 9430423cab6909792fb1b3a850f1c3c8974a5111 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 15 Jan 2019 15:14:17 -0800 -Subject: [PATCH] [rust-gdb] relax the GDB version regex - -The pretty-printer script is checking `gdb.VERSION` to see if it's at -least 8.1 for some features. With `re.match`, it will only find the -version at the beginning of that string, but in Fedora the string is -something like "Fedora 8.2-5.fc29". Using `re.search` instead will find -the first location that matches anywhere, so it will find my 8.2. ---- - src/etc/gdb_rust_pretty_printing.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/etc/gdb_rust_pretty_printing.py b/src/etc/gdb_rust_pretty_printing.py -index 08ae289d6037..b9413563fd9f 100755 ---- a/src/etc/gdb_rust_pretty_printing.py -+++ b/src/etc/gdb_rust_pretty_printing.py -@@ -16,7 +16,7 @@ rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to - # This fix went in 8.1, so check for that. - # See https://github.com/rust-lang/rust/issues/56730 - gdb_81 = False --_match = re.match('([0-9]+)\\.([0-9]+)', gdb.VERSION) -+_match = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION) - if _match: - if int(_match.group(1)) > 8 or (int(_match.group(1)) == 8 and int(_match.group(2)) >= 1): - gdb_81 = True --- -2.20.1 - diff --git a/SPECS/rust.spec b/SPECS/rust.spec index cc2dca5..6078d8a 100644 --- a/SPECS/rust.spec +++ b/SPECS/rust.spec @@ -9,10 +9,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.32.0 -%global bootstrap_cargo 1.32.0 +%global bootstrap_rust 1.33.0 +%global bootstrap_cargo 1.33.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2019-01-17 +%global bootstrap_date 2019-02-28 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -53,8 +53,8 @@ %endif Name: rust -Version: 1.33.0 -Release: 2%{?dist} +Version: 1.34.2 +Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -68,18 +68,12 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-dev-tools/rls-analysis/pull/160 -Patch1: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch - -# https://github.com/rust-lang/rust/pull/57647 -Patch2: 0001-rust-gdb-relax-the-GDB-version-regex.patch - # Revert https://github.com/rust-lang/rust/pull/57840 # We do have the necessary fix in our LLVM 7. -Patch3: rust-pr57840-llvm7-debuginfo-variants.patch +Patch1: rust-pr57840-llvm7-debuginfo-variants.patch -# https://github.com/rust-lang/rust/issues/58845 -Patch4: 0001-Backport-deprecation-fixes-from-commit-b7f030e.patch +# https://github.com/rust-lang/rust/pull/60313 +Patch2: 0001-Limit-internalization-in-LLVM-8-ThinLTO.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -168,8 +162,7 @@ BuildRequires: cmake3 >= 3.4.3 Provides: bundled(llvm) = 8.0.0~svn %else BuildRequires: cmake >= 2.8.11 -%if 0%{?epel} || 0%{?fedora} >= 30 -# TODO: for f30+, we'll be ready for LLVM8 in Rust 1.34 +%if 0%{?epel} %global llvm llvm7.0 %endif %if %defined llvm @@ -278,7 +271,7 @@ Summary: LLDB pretty printers for Rust #BuildArch: noarch Requires: lldb -Requires: python3-lldb +Requires: python2-lldb Requires: %{name}-debugger-common = %{version}-%{release} %description lldb @@ -409,29 +402,20 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -pushd vendor/rls-analysis -%patch1 -p1 -popd +%patch1 -p1 -R %patch2 -p1 -%patch3 -p1 -R -%patch4 -p1 %if "%{python}" != "python2" sed -i.try-py3 -e '/try python2.7/i try %{python} "$@"' ./configure %endif %if %without bundled_llvm -rm -rf src/llvm/ +rm -rf src/llvm-project/ %endif # We never enable emscripten. rm -rf src/llvm-emscripten/ -# We never enable other LLVM tools. -rm -rf src/tools/clang -rm -rf src/tools/lld -rm -rf src/tools/lldb - # rename bundled license for packaging cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} @@ -501,6 +485,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 --enable-extended \ --enable-vendor \ --enable-verbose-tests \ + --set rust.codegen-units-std=1 \ --release-channel=%{channel} %{python} ./x.py build @@ -623,6 +608,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files gdb %{_bindir}/rust-gdb %{rustlibdir}/etc/gdb_*.py* +%exclude %{_bindir}/rust-gdbgui %if %with lldb @@ -639,7 +625,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{_docdir}/%{name}/html/*/ %{_docdir}/%{name}/html/*.html %{_docdir}/%{name}/html/*.css +%{_docdir}/%{name}/html/*.ico %{_docdir}/%{name}/html/*.js +%{_docdir}/%{name}/html/*.png %{_docdir}/%{name}/html/*.svg %{_docdir}/%{name}/html/*.woff %license %{_docdir}/%{name}/html/*.txt @@ -692,8 +680,24 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Wed Oct 09 2019 bstinson@centosproject.org - 1.33.0-2 -- Build for intermediate deps in CentOS 8 +* Wed Oct 09 2019 bstinson@centosproject.org - 1.34.2-1 +- Rebuild for intermediate deps in CentOS 8 + +* Tue May 14 2019 Josh Stone - 1.34.2-1 +- Update to 1.34.2 -- fixes CVE-2019-12083. + +* Tue Apr 30 2019 Josh Stone - 1.34.1-3 +- Set rust.codegen-units-std=1 + +* Fri Apr 26 2019 Josh Stone - 1.34.1-2 +- Remove the ThinLTO workaround. + +* Thu Apr 25 2019 Josh Stone - 1.34.1-1 +- Update to 1.34.1. +- Add a ThinLTO fix for rhbz1701339. + +* Thu Apr 11 2019 Josh Stone - 1.34.0-1 +- Update to 1.34.0. * Fri Mar 01 2019 Josh Stone - 1.33.0-2 - Fix deprecations for self-rebuild