From d59c1edc2b3ea6f2fdb3bf7413288d1542bd9456 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 17 Nov 2016 22:21:09 -0800 Subject: [PATCH 01/59] Test 1.14.0-beta.2 - Rewrite bootstrap logic to target specific arches. - Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!) --- .gitignore | 8 ++ rust-compiler-rt-pr26-arm-cc.patch | 48 ---------- rust-pr36933-less-neon-again.patch | 30 ------ rust.spec | 146 ++++++++++++++++------------- sources | 9 +- sources-bootstrap | 8 ++ 6 files changed, 102 insertions(+), 147 deletions(-) delete mode 100644 rust-compiler-rt-pr26-arm-cc.patch delete mode 100644 rust-pr36933-less-neon-again.patch create mode 100644 sources-bootstrap diff --git a/.gitignore b/.gitignore index dcb863b..7f334c8 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,11 @@ /rustc-1.12.1-armv7-unknown-linux-gnueabihf.tar.gz /rustc-1.12.1-i686-unknown-linux-gnu.tar.gz /rustc-1.12.1-x86_64-unknown-linux-gnu.tar.gz +/rustc-beta-src.tar.gz +/rustc-1.13.0-aarch64-unknown-linux-gnu.tar.gz +/rustc-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz +/rustc-1.13.0-i686-unknown-linux-gnu.tar.gz +/rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz +/rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz +/rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz +/rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz diff --git a/rust-compiler-rt-pr26-arm-cc.patch b/rust-compiler-rt-pr26-arm-cc.patch deleted file mode 100644 index c86096f..0000000 --- a/rust-compiler-rt-pr26-arm-cc.patch +++ /dev/null @@ -1,48 +0,0 @@ -commit 3bc0272cab9fdcfc2ef4df9625ec3c9d5909db79 (from ecd2b1f6d689d5afbf5debe8afb3739337323852) -Merge: ecd2b1f6d689 8250bd0ac50b -Author: Alex Crichton -Date: Thu Nov 10 11:22:53 2016 -0600 - - Merge pull request #26 from TimNN/arm-cc - - powi only: don't override arm calling convention - -diff --git a/lib/builtins/int_lib.h b/lib/builtins/int_lib.h -index 6cf17497d3a5..8dfe5672d131 100644 ---- a/lib/builtins/int_lib.h -+++ b/lib/builtins/int_lib.h -@@ -32,7 +32,7 @@ - #if __ARM_EABI__ - # define ARM_EABI_FNALIAS(aeabi_name, name) \ - void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); --# define COMPILER_RT_ABI -+# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) - #else - # define ARM_EABI_FNALIAS(aeabi_name, name) - # define COMPILER_RT_ABI -diff --git a/lib/builtins/powidf2.c b/lib/builtins/powidf2.c -index ac13b172b043..0200e1eab0b5 100644 ---- a/lib/builtins/powidf2.c -+++ b/lib/builtins/powidf2.c -@@ -16,7 +16,7 @@ - - /* Returns: a ^ b */ - --COMPILER_RT_ABI double -+double - __powidf2(double a, si_int b) - { - const int recip = b < 0; -diff --git a/lib/builtins/powisf2.c b/lib/builtins/powisf2.c -index 0c400ec6dd6a..c834b9696954 100644 ---- a/lib/builtins/powisf2.c -+++ b/lib/builtins/powisf2.c -@@ -16,7 +16,7 @@ - - /* Returns: a ^ b */ - --COMPILER_RT_ABI float -+float - __powisf2(float a, si_int b) - { - const int recip = b < 0; diff --git a/rust-pr36933-less-neon-again.patch b/rust-pr36933-less-neon-again.patch deleted file mode 100644 index 42b2b82..0000000 --- a/rust-pr36933-less-neon-again.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit 1a4192804518199623fb88bf43bde69d6b0203cb (from a5dac7a2af3ee444817eb7bfbba3539be8c06cf1) -Merge: a5dac7a2af3e 4625642211b9 -Author: bors -Date: Tue Oct 4 13:23:09 2016 -0700 - - Auto merge of #36933 - alexcrichton:less-neon-again, r=eddyb - - rustc: Try again to disable NEON on armv7 linux - - This is a follow-up to #35814 which apparently didn't disable it hard enough. It - looks like LLVM's default armv7 target enables NEON so we'd otherwise have to - pass `-neon`, but we're already enabling armv7 with `+v7` supposedly, so let's - try just telling LLVM that the armv7 target is arm and then enable features - selectively. - - Closes #36913 - -diff --git a/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs b/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs -index 1abf8b0b69a2..a6d73ddb1835 100644 ---- a/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs -+++ b/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs -@@ -24,7 +24,7 @@ pub fn target() -> TargetResult { - - options: TargetOptions { - // Info about features at https://wiki.debian.org/ArmHardFloatPort -- features: "+v7,+vfp3,+d16,+thumb2".to_string(), -+ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), - cpu: "generic".to_string(), - max_atomic_width: 64, - .. base diff --git a/rust.spec b/rust.spec index 7196596..70a7730 100644 --- a/rust.spec +++ b/rust.spec @@ -1,12 +1,19 @@ +# Only x86_64 and i686 are Tier 1 platforms at this time. +# https://forge.rust-lang.org/platform-support.html +%global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x + # The channel can be stable, beta, or nightly -%{!?channel: %global channel stable} +%{!?channel: %global channel beta} # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%bcond_with bootstrap -%global bootstrap_channel 1.12.1 -%global bootstrap_date 2016-10-20 +%global bootstrap_channel 1.13.0 +%global bootstrap_date 2016-11-08 + +# Only the specified arches will use bootstrap binaries. +#global bootstrap_arches %%{rust_arches} +%global bootstrap_arches ppc64 ppc64le s390x # We generally don't want llvm-static present at all, since llvm-config will # make us link statically. But we can opt in, e.g. to aid LLVM rebases. @@ -16,23 +23,14 @@ %bcond_with llvm_static -# Rust 1.12 metadata is now unallocated data (.rustc), and in theory it should -# be fine to strip this entirely, since we don't want to expose Rust's unstable -# ABI for linking. However, eu-strip was then clobbering .dynsym when it tried -# to remove the rust_metadata symbol referencing .rustc (rhbz1380961). -# So for unfixed elfutils, we'll leave .rustc alone and only strip debuginfo. -%if 0%{?fedora} < 25 -%global _find_debuginfo_opts -g -%undefine _include_minidebuginfo -%endif - Name: rust -Version: 1.13.0 -Release: 1%{?dist} +Version: 1.14.0 +Release: 0.1.beta.2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) URL: https://www.rust-lang.org +ExclusiveArch: %{rust_arches} %if "%{channel}" == "stable" %global rustc_package rustc-%{version} @@ -41,32 +39,54 @@ URL: https://www.rust-lang.org %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}-src.tar.gz -%if %with bootstrap -%global bootstrap_base https://static.rust-lang.org/dist/%{bootstrap_date}/rustc-%{bootstrap_channel} -Source1: %{bootstrap_base}-x86_64-unknown-linux-gnu.tar.gz -Source2: %{bootstrap_base}-i686-unknown-linux-gnu.tar.gz -Source3: %{bootstrap_base}-armv7-unknown-linux-gnueabihf.tar.gz -Source4: %{bootstrap_base}-aarch64-unknown-linux-gnu.tar.gz +# Get the Rust triple for any arch. +%{lua: function rust_triple(arch) + local abi = "gnu" + if arch == "armv7hl" then + arch = "armv7" + abi = "gnueabihf" + elseif arch == "ppc64" then + arch = "powerpc64" + elseif arch == "ppc64le" then + arch = "powerpc64le" + end + return arch.."-unknown-linux-"..abi +end} + +%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} + +%if %defined bootstrap_arches +# For each bootstrap arch, add an additional binary Source. +# Also define bootstrap_source just for the current target. +%{lua: do + local bootstrap_arches = {} + for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do + table.insert(bootstrap_arches, arch) + end + local base = string.format("https://static.rust-lang.org/dist/%s/rustc-%s", + rpm.expand("%{bootstrap_date}"), + rpm.expand("%{bootstrap_channel}")) + local target_arch = rpm.expand("%{_target_cpu}") + for i, arch in ipairs(bootstrap_arches) do + print(string.format("Source%d: %s-%s.tar.gz\n", + i, base, rust_triple(arch))) + if arch == target_arch then + rpm.define("bootstrap_source "..i) + end + end +end} %endif -# Only x86_64 and i686 are Tier 1 platforms at this time. -# https://doc.rust-lang.org/stable/book/getting-started.html#tier-1 -ExclusiveArch: x86_64 i686 armv7hl aarch64 -%ifarch armv7hl -%global rust_triple armv7-unknown-linux-gnueabihf +%ifarch %{bootstrap_arches} +%global bootstrap_root rustc-%{bootstrap_channel}-%{rust_triple} +%global local_rust_root %{_builddir}/%{bootstrap_root}/rustc +Provides: bundled(%{name}-bootstrap) = %{bootstrap_channel} %else -%global rust_triple %{_target_cpu}-unknown-linux-gnu +BuildRequires: %{name} <= %{version} +BuildRequires: %{name} >= %{bootstrap_channel} +%global local_rust_root %{_prefix} %endif -# We're going to override --libdir when configuring to get rustlib into a -# common path, but we'll properly relocate the shared libraries during install. -%global common_libdir %{_prefix}/lib -%global rustlibdir %{common_libdir}/rustlib - -# merged for 1.14.0 -Patch1: rust-pr36933-less-neon-again.patch -Patch2: rust-compiler-rt-pr26-arm-cc.patch - BuildRequires: make BuildRequires: cmake BuildRequires: gcc @@ -85,16 +105,6 @@ BuildRequires: libffi-devel BuildConflicts: llvm-static %endif - -%if %without bootstrap -BuildRequires: %{name} <= %{version} -BuildRequires: %{name} >= %{bootstrap_channel} -%global local_rust_root %{_prefix} -%else -%global bootstrap_root rustc-%{bootstrap_channel}-%{rust_triple} -%global local_rust_root %{_builddir}/%{rustc_package}/%{bootstrap_root}/rustc -%endif - # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs BuildRequires: procps-ng @@ -121,6 +131,16 @@ Requires: gcc %global __provides_exclude ^(%{_privatelibs})$ %global __requires_exclude ^(%{_privatelibs})$ +# Rust 1.12 metadata is now unallocated data (.rustc), and in theory it should +# be fine to strip this entirely, since we don't want to expose Rust's unstable +# ABI for linking. However, eu-strip was then clobbering .dynsym when it tried +# to remove the rust_metadata symbol referencing .rustc (rhbz1380961). +# So for unfixed elfutils, we'll leave .rustc alone and only strip debuginfo. +%if 0%{?fedora} < 25 +%global _find_debuginfo_opts -g +%undefine _include_minidebuginfo +%endif + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -159,15 +179,13 @@ its standard library. %prep -%setup -q -n %{rustc_package} -%if %with bootstrap -find %{sources} -name '%{bootstrap_root}.tar.gz' -exec tar -xvzf '{}' ';' +%ifarch %{bootstrap_arches} +%setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} test -f '%{local_rust_root}/bin/rustc' %endif -%patch1 -p1 -b .less-neon -%patch2 -p1 -d src/compiler-rt -b .arm-cc +%setup -q -n %{rustc_package} # unbundle rm -rf src/jemalloc/ @@ -179,19 +197,12 @@ sed -e '/*\//q' src/libbacktrace/backtrace.h \ >src/libbacktrace/LICENSE-libbacktrace # These tests assume that alloc_jemalloc is present +# https://github.com/rust-lang/rust/issues/35017 sed -i.jemalloc -e '1i // ignore-test jemalloc is disabled' \ src/test/compile-fail/allocator-dylib-is-system.rs \ src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs \ src/test/run-pass/allocator-default.rs -%if %without bootstrap -# The hardcoded stage0 "lib" is inappropriate when using Fedora's own rustc -# ... Or it was, but now we're transitioning to a common /usr/lib/rustlib/ -if [ '%{_lib}' != lib -a -d '%{_libdir}/rustlib/%{rust_triple}' ]; then - sed -i.libdir -e '/^HLIB_RELATIVE/s/lib$/%{_lib}/' mk/main.mk -fi -%endif - %if %with llvm_static # Static linking to distro LLVM needs to add -lffi # https://github.com/rust-lang/rust/issues/34486 @@ -203,7 +214,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %build %ifarch aarch64 %{mips} %{power64} -%if %with bootstrap +%ifarch %{bootstrap_arches} # Upstream binaries have a 4k-paged jemalloc, which breaks with Fedora 64k pages. # See https://github.com/rust-lang/rust/issues/36994 # Fixed by https://github.com/rust-lang/rust/issues/37392 @@ -213,10 +224,12 @@ export MALLOC_CONF=lg_dirty_mult:-1 %endif # Use hardening ldflags. -export RUSTFLAGS="-Clink-args=-Wl,-z,relro,-z,now" +export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now" -# Note, libdir is overridden so we'll have a common rustlib path, -# but shared libs will be fixed during install. +# We're going to override --libdir when configuring to get rustlib into a +# common path, but we'll properly relocate the shared libraries during install. +%global common_libdir %{_prefix}/lib +%global rustlibdir %{common_libdir}/rustlib %configure --disable-option-checking \ --libdir=%{common_libdir} \ @@ -319,6 +332,11 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || : %changelog +* Thu Nov 17 2016 Josh Stone - 1.14.0-0.1.beta.2 +- Test 1.14.0-beta.2 +- Rewrite bootstrap logic to target specific arches. +- Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!) + * Thu Nov 10 2016 Josh Stone - 1.13.0-1 - Update to 1.13.0. - Use hardening flags for linking. diff --git a/sources b/sources index 9e7b98f..f9a4c10 100644 --- a/sources +++ b/sources @@ -1,5 +1,4 @@ -23290b9d78356223a29cf37913c3a1c6 rustc-1.13.0-src.tar.gz -199eb41add634e002fbc2b20a2b33e27 rustc-1.12.1-aarch64-unknown-linux-gnu.tar.gz -60a4a099b166481fe96c165b39441995 rustc-1.12.1-armv7-unknown-linux-gnueabihf.tar.gz -f1c1b3c6cd6195e4fbc386a7ab49e64d rustc-1.12.1-i686-unknown-linux-gnu.tar.gz -a03bdb0111e3b68a3626237d2ec7cb95 rustc-1.12.1-x86_64-unknown-linux-gnu.tar.gz +41a8ea5a71155ac0cadc60b23ebd65b0 rustc-beta-src.tar.gz +66d82b3e76e73622abae8330d330aa17 rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz +8af97776d60efc4d88f959d010d45c3d rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz +4a9b1c356d6d3a3d41c5dea42692c0f8 rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz diff --git a/sources-bootstrap b/sources-bootstrap new file mode 100644 index 0000000..c5965c1 --- /dev/null +++ b/sources-bootstrap @@ -0,0 +1,8 @@ +41a8ea5a71155ac0cadc60b23ebd65b0 rustc-beta-src.tar.gz +450896dd2f830209a9d713cc315a3f7a rustc-1.13.0-aarch64-unknown-linux-gnu.tar.gz +8aac8fdae529ac6cb59ca1aa9bdaba18 rustc-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz +86bde292c0e579c145ce8d197997af43 rustc-1.13.0-i686-unknown-linux-gnu.tar.gz +66d82b3e76e73622abae8330d330aa17 rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz +8af97776d60efc4d88f959d010d45c3d rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz +4a9b1c356d6d3a3d41c5dea42692c0f8 rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz +1400262e1529f94a12d2f5c77cc67782 rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz From ccef3d28bed6d73dc0a3429af2c3b669bd6d000c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 17 Nov 2016 23:48:29 -0800 Subject: [PATCH 02/59] simplify the bootstrap base slightly --- rust.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust.spec b/rust.spec index 70a7730..22cc10b 100644 --- a/rust.spec +++ b/rust.spec @@ -63,9 +63,8 @@ end} for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do table.insert(bootstrap_arches, arch) end - local base = string.format("https://static.rust-lang.org/dist/%s/rustc-%s", - rpm.expand("%{bootstrap_date}"), - rpm.expand("%{bootstrap_channel}")) + local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}" + .."/rustc-%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do print(string.format("Source%d: %s-%s.tar.gz\n", From 71ab56b39b29ca327a65585333287f94ae234366 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 13 Dec 2016 22:18:27 -0800 Subject: [PATCH 03/59] Test 1.14.0-beta.3 --- rust.spec | 5 ++++- sources | 8 ++++---- sources-bootstrap | 16 ++++++++-------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/rust.spec b/rust.spec index 22cc10b..53232a0 100644 --- a/rust.spec +++ b/rust.spec @@ -25,7 +25,7 @@ Name: rust Version: 1.14.0 -Release: 0.1.beta.2%{?dist} +Release: 0.1.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -331,6 +331,9 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || : %changelog +* Tue Dec 13 2016 Josh Stone - 1.14.0-0.1.beta.3 +- Test 1.14.0-beta.3 + * Thu Nov 17 2016 Josh Stone - 1.14.0-0.1.beta.2 - Test 1.14.0-beta.2 - Rewrite bootstrap logic to target specific arches. diff --git a/sources b/sources index f9a4c10..b840c04 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -41a8ea5a71155ac0cadc60b23ebd65b0 rustc-beta-src.tar.gz -66d82b3e76e73622abae8330d330aa17 rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz -8af97776d60efc4d88f959d010d45c3d rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz -4a9b1c356d6d3a3d41c5dea42692c0f8 rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz +SHA512 (rustc-beta-src.tar.gz) = 847d59c81c977dd9b1b9938add39d368898b2e4e0f72efda0d66813c758340ce620f05acab77cd6093bf678b76a34da0408a0b00f52de702edabe79df41b453c +SHA512 (rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz) = 8f0da5280c15404153ad94fde5a56b3e5a46726901d808a4115d5b1cec1010c19b788df7ba3af991958cb75174cb2628ae4c5e2d0c17011e250c373445f22cf1 +SHA512 (rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz) = 7ce759eaf889478f441c84f78ccb00766ac1b202eb498dcb87fcedb71f7fda3c6605135ad271aa3f6edc86d9b9508fa597a2dbcd9d086288acb7bbc023c1fd62 +SHA512 (rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz) = 0d5b1523a51cae36f0da906505f3b930839006297b91edfb9b27d2bc85474cc68d0fcb92b99776e4ea3ad1f4445e331b46f4a2fc01b54dc72910dd6c2a77ba99 diff --git a/sources-bootstrap b/sources-bootstrap index c5965c1..1ca47a3 100644 --- a/sources-bootstrap +++ b/sources-bootstrap @@ -1,8 +1,8 @@ -41a8ea5a71155ac0cadc60b23ebd65b0 rustc-beta-src.tar.gz -450896dd2f830209a9d713cc315a3f7a rustc-1.13.0-aarch64-unknown-linux-gnu.tar.gz -8aac8fdae529ac6cb59ca1aa9bdaba18 rustc-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz -86bde292c0e579c145ce8d197997af43 rustc-1.13.0-i686-unknown-linux-gnu.tar.gz -66d82b3e76e73622abae8330d330aa17 rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz -8af97776d60efc4d88f959d010d45c3d rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz -4a9b1c356d6d3a3d41c5dea42692c0f8 rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz -1400262e1529f94a12d2f5c77cc67782 rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz +SHA512 (rustc-beta-src.tar.gz) = 847d59c81c977dd9b1b9938add39d368898b2e4e0f72efda0d66813c758340ce620f05acab77cd6093bf678b76a34da0408a0b00f52de702edabe79df41b453c +SHA512 (rustc-1.13.0-aarch64-unknown-linux-gnu.tar.gz) = 3e62fb91b9dc532223fcc389a148a0af1c09f53bb2f8a1a55989b828b3e2c6de6c2b756c42db88392df3971057470449b3c0ad0c36589a57c71433b45f124498 +SHA512 (rustc-1.13.0-armv7-unknown-linux-gnueabihf.tar.gz) = 4ca414a59091be4bafbe04c7a4857b07a833f9d4e9c76a6d41b3aad2234a4997326dc7df7ba4992c1399cae49b419bf4b5296e76a595e681a2ffbc8adbb8899c +SHA512 (rustc-1.13.0-i686-unknown-linux-gnu.tar.gz) = d9a85e114c174a8fb2ae3e55ed17fa882323875512bab380ac3d0f5b251702dd6d4aa90119fcc4b22cbfef1a221e2fcbedd4e33eb1ab31289a18562ab73da159 +SHA512 (rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz) = 8f0da5280c15404153ad94fde5a56b3e5a46726901d808a4115d5b1cec1010c19b788df7ba3af991958cb75174cb2628ae4c5e2d0c17011e250c373445f22cf1 +SHA512 (rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz) = 7ce759eaf889478f441c84f78ccb00766ac1b202eb498dcb87fcedb71f7fda3c6605135ad271aa3f6edc86d9b9508fa597a2dbcd9d086288acb7bbc023c1fd62 +SHA512 (rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz) = 0d5b1523a51cae36f0da906505f3b930839006297b91edfb9b27d2bc85474cc68d0fcb92b99776e4ea3ad1f4445e331b46f4a2fc01b54dc72910dd6c2a77ba99 +SHA512 (rustc-1.13.0-x86_64-unknown-linux-gnu.tar.gz) = c7d3177ed25ba80cdaaafa7c3d238bd24e548e2f0f6e00d1ef1dbaf7afa4809def6bd893cc4a607c0e1973fc68e82dc9342fc6a84f77bd8e47d1c547bd0adcfb From 6f33322c7a6509615e882b90e33c352b290ea328 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 18 Jan 2017 11:21:44 -0800 Subject: [PATCH 04/59] Beta test --- rust.spec | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/rust.spec b/rust.spec index 7e70b4a..49732b5 100644 --- a/rust.spec +++ b/rust.spec @@ -3,13 +3,13 @@ %global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x # The channel can be stable, beta, or nightly -%{!?channel: %global channel stable} +%{!?channel: %global channel beta} # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_channel 1.13.0 -%global bootstrap_date 2016-11-08 +%global bootstrap_channel 1.14.0 +%global bootstrap_date 2016-12-18 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -23,8 +23,8 @@ Name: rust -Version: 1.14.0 -Release: 2%{?dist} +Version: 1.15.0 +Release: 0.1.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -32,11 +32,11 @@ URL: https://www.rust-lang.org ExclusiveArch: %{rust_arches} %if "%{channel}" == "stable" -%global rustc_package rustc-%{version} +%global rustc_package rustc-%{version}-src %else -%global rustc_package rustc-%{channel} +%global rustc_package rustc-%{channel}-src %endif -Source0: https://static.rust-lang.org/dist/%{rustc_package}-src.tar.gz +Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -237,6 +237,7 @@ export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now" --disable-jemalloc \ --disable-rpath \ --enable-debuginfo \ + --disable-rustbuild \ --release-channel=%{channel} %make_build VERBOSE=1 @@ -330,6 +331,9 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || : %changelog +* Wed Jan 18 2017 Josh Stone - 1.15.0-0.1.beta.3 +- Beta test + * Fri Dec 23 2016 Josh Stone - 1.14.0-2 - Rebuild without bootstrap binaries. From 834370220bca9e442087b3a0cfd99fd5df90bbb3 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 1 Mar 2017 10:42:04 -0800 Subject: [PATCH 05/59] WIP 1.16-beta, rustbuild --- rust.spec | 29 +++++++++++++++++------------ sources | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/rust.spec b/rust.spec index c223f14..b5c2b8d 100644 --- a/rust.spec +++ b/rust.spec @@ -3,16 +3,17 @@ %global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x # The channel can be stable, beta, or nightly -%{!?channel: %global channel stable} +%{!?channel: %global channel beta} # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_channel 1.14.0 -%global bootstrap_date 2016-12-18 +%global bootstrap_channel 1.15.1 +%global bootstrap_date 2017-02-09 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} +%global bootstrap_arches x86_64 # We generally don't want llvm-static present at all, since llvm-config will # make us link statically. But we can opt in, e.g. to aid LLVM rebases. @@ -32,8 +33,8 @@ Name: rust -Version: 1.15.1 -Release: 1%{?dist} +Version: 1.16.0 +Release: 0.1.beta.2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -72,7 +73,7 @@ end} table.insert(bootstrap_arches, arch) end local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}" - .."/rustc-%{bootstrap_channel}") + .."/rust-%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do print(string.format("Source%d: %s-%s.tar.gz\n", @@ -85,10 +86,11 @@ end} %endif %ifarch %{bootstrap_arches} -%global bootstrap_root rustc-%{bootstrap_channel}-%{rust_triple} -%global local_rust_root %{_builddir}/%{bootstrap_root}/rustc +%global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple} +%global local_rust_root %{_builddir}/%{bootstrap_root}%{_prefix} Provides: bundled(%{name}-bootstrap) = %{bootstrap_channel} %else +BuildRequires: cargo BuildRequires: %{name} >= %{bootstrap_channel} BuildConflicts: %{name} > %{version} %global local_rust_root %{_prefix} @@ -203,6 +205,9 @@ its standard library. %ifarch %{bootstrap_arches} %setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} +./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \ + --prefix=./%{_prefix} --disable-ldconfig +test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif @@ -241,7 +246,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %build # Use hardening ldflags. -export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now" +# FIXME export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now" # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. @@ -257,10 +262,10 @@ export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now" --disable-jemalloc \ --disable-rpath \ --enable-debuginfo \ - --disable-rustbuild \ + --enable-vendor \ --release-channel=%{channel} -%make_build VERBOSE=1 +%make_build VERBOSE=1 %{!?rhel:-Onone} %install @@ -298,7 +303,7 @@ find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' # Note, many of the tests execute in parallel threads, # so it's better not to use a parallel make here. # The results are not stable on koji, so mask errors and just log it. -make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || : +make check VERBOSE=1 || python2 src/etc/check-summary.py tmp/*.log || : %post -p /sbin/ldconfig diff --git a/sources b/sources index 519fbb6..8b13789 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rustc-1.15.1-src.tar.gz) = 10d533b17cf7f92b9dff14b399b5dd0ac8b68284eea072c85ede78a4e4c2c4fce8c781777124c64798057aceb6444535e02e067fd67ba3633c3e828fb4d2d339 + From 91ea22b35213b6befc5fe9c75f1395100ff363f8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 1 Mar 2017 17:06:46 -0800 Subject: [PATCH 06/59] beta test --- rust-1.16.0-configure-no-override.patch | 26 +++++++++++ rust.spec | 61 ++++++++++++++++++++++--- 2 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 rust-1.16.0-configure-no-override.patch diff --git a/rust-1.16.0-configure-no-override.patch b/rust-1.16.0-configure-no-override.patch new file mode 100644 index 0000000..424093e --- /dev/null +++ b/rust-1.16.0-configure-no-override.patch @@ -0,0 +1,26 @@ +diff --git a/configure b/configure +index 505767cede55..4074a1e2f765 100755 +--- a/configure ++++ b/configure +@@ -753,8 +753,8 @@ case "$CFG_RELEASE_CHANNEL" in + *-pc-windows-gnu) + ;; + *) +- CFG_ENABLE_DEBUGINFO_LINES=1 +- CFG_ENABLE_DEBUGINFO_ONLY_STD=1 ++ # CFG_ENABLE_DEBUGINFO_LINES=1 ++ # CFG_ENABLE_DEBUGINFO_ONLY_STD=1 + ;; + esac + +@@ -765,8 +765,8 @@ case "$CFG_RELEASE_CHANNEL" in + *-pc-windows-gnu) + ;; + *) +- CFG_ENABLE_DEBUGINFO_LINES=1 +- CFG_ENABLE_DEBUGINFO_ONLY_STD=1 ++ # CFG_ENABLE_DEBUGINFO_LINES=1 ++ # CFG_ENABLE_DEBUGINFO_ONLY_STD=1 + ;; + esac + ;; diff --git a/rust.spec b/rust.spec index b5c2b8d..5c1946e 100644 --- a/rust.spec +++ b/rust.spec @@ -13,7 +13,6 @@ # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} -%global bootstrap_arches x86_64 # We generally don't want llvm-static present at all, since llvm-config will # make us link statically. But we can opt in, e.g. to aid LLVM rebases. @@ -31,6 +30,14 @@ %bcond_with bundled_llvm %endif +# LLDB isn't available everywhere... +%if 0%{?rhel} +%bcond_with lldb +%else +%bcond_without lldb +%endif + + Name: rust Version: 1.16.0 @@ -48,6 +55,8 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz +Patch1: rust-1.16.0-configure-no-override.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -189,6 +198,20 @@ This package includes the rust-gdb script, which allows easier debugging of Rust programs. +%if %with lldb + +%package lldb +Summary: LLDB pretty printers for Rust +BuildArch: noarch +Requires: lldb + +%description lldb +This package includes the rust-lldb script, which allows easier debugging of Rust +programs. + +%endif + + %package doc Summary: Documentation for Rust # NOT BuildArch: noarch @@ -242,11 +265,14 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ src/librustc_llvm/lib.rs %endif +%patch1 -p1 -b .no-override + %build # Use hardening ldflags. -# FIXME export RUSTFLAGS="-Clink-arg=-Wl,-z,relro,-z,now" +%global rustflags -Clink-arg=-Wl,-z,relro,-z,now +export RUSTFLAGS="%{rustflags}" # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. @@ -265,11 +291,13 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ --enable-vendor \ --release-channel=%{channel} -%make_build VERBOSE=1 %{!?rhel:-Onone} +%make_build %{!?rhel:-Onone} %install -%make_install VERBOSE=1 +export RUSTFLAGS="%{rustflags}" + +%make_install # The libdir libraries are identical to those under rustlib/, and we need # the latter in place to support dynamic linking for compiler plugins, so we'll @@ -298,12 +326,19 @@ rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT find %{buildroot}%{_docdir}/%{name}/html -empty -delete find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' +%if %without lldb +rm -f %{buildroot}%{_bindir}/rust-lldb +rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* +%endif + %check +export RUSTFLAGS="%{rustflags}" + # Note, many of the tests execute in parallel threads, # so it's better not to use a parallel make here. # The results are not stable on koji, so mask errors and just log it. -make check VERBOSE=1 || python2 src/etc/check-summary.py tmp/*.log || : +make check || python2 src/etc/check-summary.py tmp/*.log || : %post -p /sbin/ldconfig @@ -337,7 +372,18 @@ make check VERBOSE=1 || python2 src/etc/check-summary.py tmp/*.log || : %{_bindir}/rust-gdb %dir %{rustlibdir} %dir %{rustlibdir}/etc -%{rustlibdir}/etc/*.py* +%{rustlibdir}/etc/debugger_*.py* +%{rustlibdir}/etc/gdb_*.py* + + +%if %with lldb +%files lldb +%{_bindir}/rust-lldb +%dir %{rustlibdir} +%dir %{rustlibdir}/etc +%{rustlibdir}/etc/debugger_*.py* +%{rustlibdir}/etc/lldb_*.py* +%endif %files doc @@ -352,6 +398,9 @@ make check VERBOSE=1 || python2 src/etc/check-summary.py tmp/*.log || : %changelog +* Wed Mar 01 2017 Josh Stone - 1.16.0-0.1.beta.2 +- beta test + * Thu Feb 09 2017 Josh Stone - 1.15.1-1 - Update to 1.15.1. - Require rust-rpm-macros for new crate packaging. From 1dfccb7e3f2d91bc18a8cb397c2c682422c38a11 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 2 Mar 2017 17:00:21 -0800 Subject: [PATCH 07/59] beta: cargo version, add gdb, fix cmake3 --- rust.spec | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/rust.spec b/rust.spec index 5c1946e..378346f 100644 --- a/rust.spec +++ b/rust.spec @@ -8,7 +8,9 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_channel 1.15.1 +%global bootstrap_rust 1.15.1 +%global bootstrap_cargo 0.16.0 +%global bootstrap_channel %{bootstrap_rust} %global bootstrap_date 2017-02-09 # Only the specified arches will use bootstrap binaries. @@ -97,10 +99,10 @@ end} %ifarch %{bootstrap_arches} %global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple} %global local_rust_root %{_builddir}/%{bootstrap_root}%{_prefix} -Provides: bundled(%{name}-bootstrap) = %{bootstrap_channel} +Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else -BuildRequires: cargo -BuildRequires: %{name} >= %{bootstrap_channel} +BuildRequires: cargo >= %{bootstrap_cargo} +BuildRequires: %{name} >= %{bootstrap_rust} BuildConflicts: %{name} > %{version} %global local_rust_root %{_prefix} %endif @@ -135,6 +137,9 @@ BuildConflicts: llvm-static # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs BuildRequires: procps-ng +# debuginfo-gdb tests need gdb +BuildRequires: gdb + # TODO: work on unbundling these! Provides: bundled(hoedown) = 3.0.5 Provides: bundled(jquery) = 2.1.4 @@ -162,7 +167,7 @@ Requires: rust-rpm-macros %endif # ALL Rust libraries are private, because they don't keep an ABI. -%global _privatelibs lib.*-[[:xdigit:]]{8}[.]so.* +%global _privatelibs lib.*-[[:xdigit:]]*[.]so.* %global __provides_exclude ^(%{_privatelibs})$ %global __requires_exclude ^(%{_privatelibs})$ @@ -255,7 +260,9 @@ sed -i.jemalloc -e '1i // ignore-test jemalloc is disabled' \ src/test/run-pass/allocator-default.rs %if 0%{?epel} -sed -i.cmake -e 's/CFG_CMAKE cmake/&3/' configure +mkdir -p cmake-bin +ln -s /usr/bin/cmake3 cmake-bin/cmake +%global cmake_path $PWD/cmake-bin %endif %if %{without bundled_llvm} && %{with llvm_static} @@ -270,6 +277,8 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %build +%{?cmake_path:export PATH=%{cmake_path}:$PATH} + # Use hardening ldflags. %global rustflags -Clink-arg=-Wl,-z,relro,-z,now export RUSTFLAGS="%{rustflags}" @@ -295,6 +304,7 @@ export RUSTFLAGS="%{rustflags}" %install +%{?cmake_path:export PATH=%{cmake_path}:$PATH} export RUSTFLAGS="%{rustflags}" %make_install @@ -333,12 +343,13 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %check +%{?cmake_path:export PATH=%{cmake_path}:$PATH} export RUSTFLAGS="%{rustflags}" # Note, many of the tests execute in parallel threads, # so it's better not to use a parallel make here. # The results are not stable on koji, so mask errors and just log it. -make check || python2 src/etc/check-summary.py tmp/*.log || : +make check || : %post -p /sbin/ldconfig From ed2201a8a970c67aa5636cb1f01df58751ead0bf Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 3 Mar 2017 14:05:45 -0800 Subject: [PATCH 08/59] 1.16.0-beta.3 --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 378346f..dd872ce 100644 --- a/rust.spec +++ b/rust.spec @@ -43,7 +43,7 @@ Name: rust Version: 1.16.0 -Release: 0.1.beta.2%{?dist} +Release: 0.1.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -409,7 +409,7 @@ make check || : %changelog -* Wed Mar 01 2017 Josh Stone - 1.16.0-0.1.beta.2 +* Fri Mar 03 2017 Josh Stone - 1.16.0-0.1.beta.3 - beta test * Thu Feb 09 2017 Josh Stone - 1.15.1-1 From 4f37df872042414db0b4251aa787b7a2c69567d3 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 6 Mar 2017 17:27:42 -0800 Subject: [PATCH 09/59] beta test --- rust-gh40256.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ rust.spec | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 rust-gh40256.patch diff --git a/rust-gh40256.patch b/rust-gh40256.patch new file mode 100644 index 0000000..2f0eeb6 --- /dev/null +++ b/rust-gh40256.patch @@ -0,0 +1,42 @@ +From e8d90fbe7467575a798551ef031840b7b990f585 Mon Sep 17 00:00:00 2001 +From: Simonas Kazlauskas +Date: Sat, 4 Mar 2017 12:33:40 +0200 +Subject: [PATCH] Beta backport of #40254 + +--- + src/libcompiler_builtins/lib.rs | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/libcompiler_builtins/lib.rs b/src/libcompiler_builtins/lib.rs +index 662d742..69ec99b 100644 +--- a/src/libcompiler_builtins/lib.rs ++++ b/src/libcompiler_builtins/lib.rs +@@ -468,14 +468,15 @@ pub mod reimpls { + } + + trait AbsExt: Sized { +- fn uabs(self) -> u128_ { +- self.iabs() as u128_ +- } ++ fn uabs(self) -> u128_; + fn iabs(self) -> i128_; + } + + #[cfg(stage0)] + impl AbsExt for i128_ { ++ fn uabs(self) -> u128_ { ++ self.iabs() as u128_ ++ } + fn iabs(self) -> i128_ { + let s = self >> 63; + ((self ^ s).wrapping_sub(s)) +@@ -484,6 +485,9 @@ pub mod reimpls { + + #[cfg(not(stage0))] + impl AbsExt for i128_ { ++ fn uabs(self) -> u128_ { ++ self.iabs() as u128_ ++ } + fn iabs(self) -> i128_ { + let s = self >> 127; + ((self ^ s).wrapping_sub(s)) diff --git a/rust.spec b/rust.spec index dd872ce..3c49462 100644 --- a/rust.spec +++ b/rust.spec @@ -58,6 +58,7 @@ ExclusiveArch: %{rust_arches} Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz Patch1: rust-1.16.0-configure-no-override.patch +Patch2: rust-gh40256.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -273,6 +274,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %endif %patch1 -p1 -b .no-override +%patch2 -p1 %build From 17dc2f46123c325aef5d11da3e0c33b0a9803fff Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 8 Apr 2017 12:24:38 -0700 Subject: [PATCH 10/59] beta test --- rust.spec | 62 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/rust.spec b/rust.spec index a3ac93e..e7047f0 100644 --- a/rust.spec +++ b/rust.spec @@ -3,15 +3,15 @@ %global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x # The channel can be stable, beta, or nightly -%{!?channel: %global channel stable} +%{!?channel: %global channel beta} # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.15.1 -%global bootstrap_cargo 0.16.0 +%global bootstrap_rust 1.16.0 +%global bootstrap_cargo 0.17.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2017-02-09 +%global bootstrap_date 2017-03-11 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -26,7 +26,7 @@ # We can also choose to just use Rust's bundled LLVM, in case the system LLVM # is insufficient. Rust currently requires LLVM 3.7+. -%if 0%{?rhel} +%if 0%{?rhel} && !0%{?epel} %bcond_without bundled_llvm %else %bcond_with bundled_llvm @@ -47,8 +47,8 @@ Name: rust -Version: 1.16.0 -Release: 3%{?dist} +Version: 1.17.0 +Release: 0.1.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -128,7 +128,7 @@ BuildRequires: cmake %endif Provides: bundled(llvm) = 3.9 %else -%if 0%{?fedora} >= 27 +%if 0%{?fedora} >= 26 || 0%{?epel} %global llvm llvm3.9 %global llvm_root %{_libdir}/%{llvm} %else @@ -212,10 +212,19 @@ This package includes the standard libraries for building applications written in Rust. +%package debugger-common +Summary: Common debugger pretty printers for Rust +BuildArch: noarch + +%description debugger-common +This package includes the common functionality for %{name}-gdb and %{name}-lldb. + + %package gdb Summary: GDB pretty printers for Rust BuildArch: noarch Requires: gdb +Requires: %{name}-debugger-common = %{version}-%{release} %description gdb This package includes the rust-gdb script, which allows easier debugging of Rust @@ -232,6 +241,7 @@ Summary: LLDB pretty printers for Rust Requires: lldb Requires: python-lldb +Requires: %{name}-debugger-common = %{version}-%{release} %description lldb This package includes the rust-lldb script, which allows easier debugging of Rust @@ -320,14 +330,14 @@ export RUSTFLAGS="%{rustflags}" --enable-vendor \ --release-channel=%{channel} -%make_build %{!?rhel:-Onone} +./x.py dist %install %{?cmake_path:export PATH=%{cmake_path}:$PATH} export RUSTFLAGS="%{rustflags}" -%make_install +DESTDIR=%{buildroot} ./x.py dist --install # The libdir libraries are identical to those under rustlib/, and we need # the latter in place to support dynamic linking for compiler plugins, so we'll @@ -366,10 +376,8 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{?cmake_path:export PATH=%{cmake_path}:$PATH} export RUSTFLAGS="%{rustflags}" -# Note, many of the tests execute in parallel threads, -# so it's better not to use a parallel make here. # The results are not stable on koji, so mask errors and just log it. -make check || : +./x.py test || : %post -p /sbin/ldconfig @@ -399,36 +407,40 @@ make check || : %{rustlibdir}/%{rust_triple}/lib/*.rlib -%files gdb -%{_bindir}/rust-gdb +%files debugger-common %dir %{rustlibdir} %dir %{rustlibdir}/etc %{rustlibdir}/etc/debugger_*.py* + + +%files gdb +%{_bindir}/rust-gdb %{rustlibdir}/etc/gdb_*.py* %if %with lldb %files lldb %{_bindir}/rust-lldb -%dir %{rustlibdir} -%dir %{rustlibdir}/etc -%{rustlibdir}/etc/debugger_*.py* %{rustlibdir}/etc/lldb_*.py* %endif %files doc +%docdir %{_docdir}/%{name} %dir %{_docdir}/%{name} -%license %{_docdir}/%{name}/html/FiraSans-LICENSE.txt -%license %{_docdir}/%{name}/html/Heuristica-LICENSE.txt -%license %{_docdir}/%{name}/html/LICENSE-APACHE.txt -%license %{_docdir}/%{name}/html/LICENSE-MIT.txt -%license %{_docdir}/%{name}/html/SourceCodePro-LICENSE.txt -%license %{_docdir}/%{name}/html/SourceSerifPro-LICENSE.txt -%doc %{_docdir}/%{name}/html/ +%dir %{_docdir}/%{name}/html +%{_docdir}/%{name}/html/*/ +%{_docdir}/%{name}/html/*.html +%{_docdir}/%{name}/html/*.css +%{_docdir}/%{name}/html/*.js +%{_docdir}/%{name}/html/*.woff +%license %{_docdir}/%{name}/html/*.txt %changelog +* Wed Apr 05 2017 Josh Stone - 1.17.0-0.1.beta.3 +- beta test + * Mon Mar 20 2017 Josh Stone - 1.16.0-3 - Make rust-lldb arch-specific to deal with lldb deps From 95a5ba4a8e566418e6cc1bd4647b47fff5d0c782 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 26 May 2017 15:32:17 -0700 Subject: [PATCH 11/59] Minor macro cleanups --- rust.spec | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/rust.spec b/rust.spec index 2142049..9c67d9e 100644 --- a/rust.spec +++ b/rust.spec @@ -103,7 +103,7 @@ end} %ifarch %{bootstrap_arches} %global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple} -%global local_rust_root %{_builddir}/%{bootstrap_root}%{_prefix} +%global local_rust_root %{_builddir}/%{bootstrap_root}/usr Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else BuildRequires: cargo >= %{bootstrap_cargo} @@ -121,11 +121,7 @@ BuildRequires: python2 BuildRequires: curl %if %with bundled_llvm -%if 0%{?epel} BuildRequires: cmake3 -%else -BuildRequires: cmake -%endif Provides: bundled(llvm) = 3.9 %else %if 0%{?fedora} >= 26 || 0%{?epel} @@ -194,7 +190,7 @@ Requires: rust-rpm-macros %if %{without bundled_llvm} && "%{llvm_root}" != "%{_prefix}" # https://github.com/rust-lang/rust/issues/40717 -%global rustflags %{rustflags} -Clink-arg=-L%{llvm_root}/lib +%global rustflags %{?rustflags} -Clink-arg=-L%{llvm_root}/lib %endif %description @@ -267,7 +263,7 @@ its standard library. %ifarch %{bootstrap_arches} %setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} ./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \ - --prefix=./%{_prefix} --disable-ldconfig + --prefix=%{local_rust_root} --disable-ldconfig test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif @@ -311,7 +307,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %build %{?cmake_path:export PATH=%{cmake_path}:$PATH} -export RUSTFLAGS="%{rustflags}" +%{?rustflags:export RUSTFLAGS="%{rustflags}"} # We're going to override --libdir when configuring to get rustlib into a # common path, but we'll fix the shared libraries during install. @@ -335,7 +331,7 @@ export RUSTFLAGS="%{rustflags}" %install %{?cmake_path:export PATH=%{cmake_path}:$PATH} -export RUSTFLAGS="%{rustflags}" +%{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} ./x.py dist --install @@ -382,7 +378,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %check %{?cmake_path:export PATH=%{cmake_path}:$PATH} -export RUSTFLAGS="%{rustflags}" +%{?rustflags:export RUSTFLAGS="%{rustflags}"} # The results are not stable on koji, so mask errors and just log it. ./x.py test || : From d40ed5c13c3b859db34e3009e414d8b651c0bb44 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 1 Jun 2017 18:06:54 -0700 Subject: [PATCH 12/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 9c67d9e..76ddca6 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ Name: rust Version: 1.18.0 -Release: 0.1.beta.3%{?dist} +Release: 0.1.beta.4%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -442,7 +442,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Fri May 26 2017 Josh Stone - 1.18.0-0.1.beta.3 +* Tue May 30 2017 Josh Stone - 1.18.0-0.1.beta.4 - beta test * Mon May 08 2017 Josh Stone - 1.17.0-2 From ef8535c58085cd7bfe4f902d56fa6e772ebc3c1f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 20 Jul 2017 10:31:40 -0700 Subject: [PATCH 13/59] beta test, now using llvm4 --- rust-1.18.0-no-fail-fast.patch | 368 --------------------------------- rust.spec | 40 ++-- 2 files changed, 28 insertions(+), 380 deletions(-) delete mode 100644 rust-1.18.0-no-fail-fast.patch diff --git a/rust-1.18.0-no-fail-fast.patch b/rust-1.18.0-no-fail-fast.patch deleted file mode 100644 index 9d23400..0000000 --- a/rust-1.18.0-no-fail-fast.patch +++ /dev/null @@ -1,368 +0,0 @@ -From 9d8fc50c4a989c934f9473e28022b86a07556dca Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 6 Jun 2017 12:59:04 -0700 -Subject: [PATCH] rustbuild: Add `./x.py test --no-fail-fast` - -This option forwards to each `cargo test` invocation, and applies the -same logic across all test steps to keep going after failures. At the -end, a brief summary line reports how many commands failed, if any. - -Note that if a test program fails to even start at all, or if an -auxiliary build command related to testing fails, these are still left -to stop everything right away. - -Fixes #40219. ---- - src/bootstrap/check.rs | 53 ++++++++++++++++++++++++++++++++++++++----------- - src/bootstrap/flags.rs | 14 ++++++++++++- - src/bootstrap/lib.rs | 22 +++++++++++++++++++- - src/bootstrap/step.rs | 12 +++++++++-- - src/build_helper/lib.rs | 38 ++++++++++++++++++++++++----------- - 5 files changed, 111 insertions(+), 28 deletions(-) - -diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs -index f8f641060c44..f39a7ba61213 100644 ---- a/src/bootstrap/check.rs -+++ b/src/bootstrap/check.rs -@@ -58,6 +58,29 @@ impl fmt::Display for TestKind { - } - } - -+fn try_run(build: &Build, cmd: &mut Command) { -+ if build.flags.cmd.no_fail_fast() { -+ if !build.try_run(cmd) { -+ let failures = build.delayed_failures.get(); -+ build.delayed_failures.set(failures + 1); -+ } -+ } else { -+ build.run(cmd); -+ } -+} -+ -+#[allow(unused)] -+fn try_run_quiet(build: &Build, cmd: &mut Command) { -+ if build.flags.cmd.no_fail_fast() { -+ if !build.try_run_quiet(cmd) { -+ let failures = build.delayed_failures.get(); -+ build.delayed_failures.set(failures + 1); -+ } -+ } else { -+ build.run_quiet(cmd); -+ } -+} -+ - /// Runs the `linkchecker` tool as compiled in `stage` by the `host` compiler. - /// - /// This tool in `src/tools` will verify the validity of all our links in the -@@ -67,8 +90,8 @@ pub fn linkcheck(build: &Build, host: &str) { - let compiler = Compiler::new(0, host); - - let _time = util::timeit(); -- build.run(build.tool_cmd(&compiler, "linkchecker") -- .arg(build.out.join(host).join("doc"))); -+ try_run(build, build.tool_cmd(&compiler, "linkchecker") -+ .arg(build.out.join(host).join("doc"))); - } - - /// Runs the `cargotest` tool as compiled in `stage` by the `host` compiler. -@@ -95,9 +118,9 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) { - let _time = util::timeit(); - let mut cmd = Command::new(build.tool(&Compiler::new(0, host), "cargotest")); - build.prepare_tool_cmd(compiler, &mut cmd); -- build.run(cmd.env("PATH", newpath) -- .arg(&build.cargo) -- .arg(&out_dir)); -+ try_run(build, cmd.env("PATH", newpath) -+ .arg(&build.cargo) -+ .arg(&out_dir)); - } - - /// Runs the `tidy` tool as compiled in `stage` by the `host` compiler. -@@ -113,7 +136,7 @@ pub fn tidy(build: &Build, host: &str) { - if !build.config.vendor { - cmd.arg("--no-vendor"); - } -- build.run(&mut cmd); -+ try_run(build, &mut cmd); - } - - fn testdir(build: &Build, host: &str) -> PathBuf { -@@ -261,7 +284,7 @@ pub fn compiletest(build: &Build, - } - - let _time = util::timeit(); -- build.run(&mut cmd); -+ try_run(build, &mut cmd); - } - - /// Run `rustdoc --test` for all documentation in `src/doc`. -@@ -337,7 +360,7 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) { - } - cmd.arg("--test-args").arg(test_args); - -- build.run(&mut cmd); -+ try_run(build, &mut cmd); - } - - /// Run all unit tests plus documentation tests for an entire crate DAG defined -@@ -388,6 +411,9 @@ pub fn krate(build: &Build, - cargo.arg("--manifest-path") - .arg(build.src.join(path).join("Cargo.toml")) - .arg("--features").arg(features); -+ if test_kind.subcommand() == "test" && build.flags.cmd.no_fail_fast() { -+ cargo.arg("--no-fail-fast"); -+ } - - match krate { - Some(krate) => { -@@ -452,7 +478,7 @@ pub fn krate(build: &Build, - krate_qemu(build, &compiler, target, mode); - } else { - cargo.args(&build.flags.cmd.test_args()); -- build.run(&mut cargo); -+ try_run(build, &mut cargo); - } - } - -@@ -521,7 +547,7 @@ fn krate_emscripten(build: &Build, - if build.config.quiet_tests { - cmd.arg("--quiet"); - } -- build.run(&mut cmd); -+ try_run(build, &mut cmd); - } - } - -@@ -544,7 +570,7 @@ fn krate_qemu(build: &Build, - cmd.arg("--quiet"); - } - cmd.args(&build.flags.cmd.test_args()); -- build.run(&mut cmd); -+ try_run(build, &mut cmd); - } - } - -@@ -671,6 +697,9 @@ pub fn bootstrap(build: &Build) { - .current_dir(build.src.join("src/bootstrap")) - .env("CARGO_TARGET_DIR", build.out.join("bootstrap")) - .env("RUSTC", &build.rustc); -+ if build.flags.cmd.no_fail_fast() { -+ cmd.arg("--no-fail-fast"); -+ } - cmd.arg("--").args(&build.flags.cmd.test_args()); -- build.run(&mut cmd); -+ try_run(build, &mut cmd); - } -diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs -index a1466d68a135..1ed759d24c54 100644 ---- a/src/bootstrap/flags.rs -+++ b/src/bootstrap/flags.rs -@@ -61,6 +61,7 @@ pub enum Subcommand { - Test { - paths: Vec, - test_args: Vec, -+ no_fail_fast: bool, - }, - Bench { - paths: Vec, -@@ -137,7 +138,10 @@ To learn more about a subcommand, run `./x.py -h`"); - - // Some subcommands get extra options - match subcommand.as_str() { -- "test" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); }, -+ "test" => { -+ opts.optflag("", "no-fail-fast", "Run all tests regardless of failure"); -+ opts.optmulti("", "test-args", "extra arguments", "ARGS"); -+ }, - "bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); }, - "dist" => { opts.optflag("", "install", "run installer as well"); }, - _ => { }, -@@ -260,6 +264,7 @@ Arguments: - Subcommand::Test { - paths: paths, - test_args: matches.opt_strs("test-args"), -+ no_fail_fast: matches.opt_present("no-fail-fast"), - } - } - "bench" => { -@@ -335,6 +340,13 @@ impl Subcommand { - _ => Vec::new(), - } - } -+ -+ pub fn no_fail_fast(&self) -> bool { -+ match *self { -+ Subcommand::Test { no_fail_fast, .. } => no_fail_fast, -+ _ => false, -+ } -+ } - } - - fn split(s: Vec) -> Vec { -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 5e046f41673e..d2303c96d201 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -76,6 +76,7 @@ extern crate num_cpus; - extern crate rustc_serialize; - extern crate toml; - -+use std::cell::Cell; - use std::cmp; - use std::collections::HashMap; - use std::env; -@@ -85,7 +86,7 @@ use std::io::Read; - use std::path::{Component, PathBuf, Path}; - use std::process::Command; - --use build_helper::{run_silent, run_suppressed, output, mtime}; -+use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppressed, output, mtime}; - - use util::{exe, libdir, add_lib_path}; - -@@ -164,6 +165,7 @@ pub struct Build { - crates: HashMap, - is_sudo: bool, - src_is_git: bool, -+ delayed_failures: Cell, - } - - #[derive(Debug)] -@@ -257,6 +259,7 @@ impl Build { - lldb_python_dir: None, - is_sudo: is_sudo, - src_is_git: src_is_git, -+ delayed_failures: Cell::new(0), - } - } - -@@ -847,6 +850,23 @@ impl Build { - run_suppressed(cmd) - } - -+ /// Runs a command, printing out nice contextual information if it fails. -+ /// Exits if the command failed to execute at all, otherwise returns its -+ /// `status.success()`. -+ fn try_run(&self, cmd: &mut Command) -> bool { -+ self.verbose(&format!("running: {:?}", cmd)); -+ try_run_silent(cmd) -+ } -+ -+ /// Runs a command, printing out nice contextual information if it fails. -+ /// Exits if the command failed to execute at all, otherwise returns its -+ /// `status.success()`. -+ #[allow(unused)] -+ fn try_run_quiet(&self, cmd: &mut Command) -> bool { -+ self.verbose(&format!("running: {:?}", cmd)); -+ try_run_suppressed(cmd) -+ } -+ - /// Prints a message if this build is configured in verbose mode. - fn verbose(&self, msg: &str) { - if self.flags.verbose() || self.config.verbose() { -diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs -index 17902a39df1e..f0522035127c 100644 ---- a/src/bootstrap/step.rs -+++ b/src/bootstrap/step.rs -@@ -28,6 +28,7 @@ - - use std::collections::{BTreeMap, HashSet, HashMap}; - use std::mem; -+use std::process; - - use check::{self, TestKind}; - use compile; -@@ -1092,8 +1093,8 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd? - let (kind, paths) = match self.build.flags.cmd { - Subcommand::Build { ref paths } => (Kind::Build, &paths[..]), - Subcommand::Doc { ref paths } => (Kind::Doc, &paths[..]), -- Subcommand::Test { ref paths, test_args: _ } => (Kind::Test, &paths[..]), -- Subcommand::Bench { ref paths, test_args: _ } => (Kind::Bench, &paths[..]), -+ Subcommand::Test { ref paths, .. } => (Kind::Test, &paths[..]), -+ Subcommand::Bench { ref paths, .. } => (Kind::Bench, &paths[..]), - Subcommand::Dist { ref paths, install } => { - if install { - return vec![self.sbuild.name("install")] -@@ -1191,6 +1192,13 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd? - self.build.verbose(&format!("executing step {:?}", step)); - (self.rules[step.name].run)(step); - } -+ -+ // Check for postponed failures from `test --no-fail-fast`. -+ let failures = self.build.delayed_failures.get(); -+ if failures > 0 { -+ println!("\n{} command(s) did not execute successfully.\n", failures); -+ process::exit(1); -+ } - } - - /// From the top level targets `steps` generate a topological ordering of -diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs -index cb58a916fb79..10b0f19d6274 100644 ---- a/src/build_helper/lib.rs -+++ b/src/build_helper/lib.rs -@@ -42,35 +42,49 @@ pub fn run(cmd: &mut Command) { - } - - pub fn run_silent(cmd: &mut Command) { -+ if !try_run_silent(cmd) { -+ std::process::exit(1); -+ } -+} -+ -+pub fn try_run_silent(cmd: &mut Command) -> bool { - let status = match cmd.status() { - Ok(status) => status, - Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}", - cmd, e)), - }; - if !status.success() { -- fail(&format!("command did not execute successfully: {:?}\n\ -- expected success, got: {}", -- cmd, -- status)); -+ println!("\n\ncommand did not execute successfully: {:?}\n\ -+ expected success, got: {}\n\n", -+ cmd, -+ status); - } -+ status.success() - } - - pub fn run_suppressed(cmd: &mut Command) { -+ if !try_run_suppressed(cmd) { -+ std::process::exit(1); -+ } -+} -+ -+pub fn try_run_suppressed(cmd: &mut Command) -> bool { - let output = match cmd.output() { - Ok(status) => status, - Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}", - cmd, e)), - }; - if !output.status.success() { -- fail(&format!("command did not execute successfully: {:?}\n\ -- expected success, got: {}\n\n\ -- stdout ----\n{}\n\ -- stderr ----\n{}\n", -- cmd, -- output.status, -- String::from_utf8_lossy(&output.stdout), -- String::from_utf8_lossy(&output.stderr))); -+ println!("\n\ncommand did not execute successfully: {:?}\n\ -+ expected success, got: {}\n\n\ -+ stdout ----\n{}\n\ -+ stderr ----\n{}\n\n", -+ cmd, -+ output.status, -+ String::from_utf8_lossy(&output.stdout), -+ String::from_utf8_lossy(&output.stderr)); - } -+ output.status.success() - } - - pub fn gnu_target(target: &str) -> String { --- -2.13.0 - diff --git a/rust.spec b/rust.spec index c7ced76..d1a0461 100644 --- a/rust.spec +++ b/rust.spec @@ -8,10 +8,10 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.17.0 -%global bootstrap_cargo 0.18.0 +%global bootstrap_rust 1.18.0 +%global bootstrap_cargo 0.19.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2017-04-27 +%global bootstrap_date 2017-06-08 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -47,8 +47,8 @@ Name: rust -Version: 1.18.0 -Release: 1%{?dist} +Version: 1.19.0 +Release: 0.beta.4%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -65,9 +65,6 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz # Don't let configure clobber our debuginfo choice for stable releases. Patch1: rust-1.16.0-configure-no-override.patch -# Backport rust#42363 to run all tests -Patch2: rust-1.18.0-no-fail-fast.patch - # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -128,7 +125,7 @@ BuildRequires: curl BuildRequires: cmake3 Provides: bundled(llvm) = 3.9 %else -%if 0%{?fedora} >= 26 || 0%{?epel} +%if 0%{?epel} %global llvm llvm3.9 %global llvm_root %{_libdir}/%{llvm} %else @@ -180,8 +177,13 @@ Requires: gcc # there's no stable ABI, we still need the unallocated metadata (.rustc) to # support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is # very eager by default, so we have to limit it to -g, only debugging symbols. +%if 0%{?fedora} >= 27 +# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 +%global _find_debuginfo_opts --keep-section .rustc +%else %global _find_debuginfo_opts -g %undefine _include_minidebuginfo +%endif # Use hardening ldflags. %global rustflags -Clink-arg=-Wl,-z,relro,-z,now @@ -286,6 +288,11 @@ sed -i.jemalloc -e '1i // ignore-test jemalloc is disabled' \ src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs \ src/test/run-pass/allocator-default.rs +# This tests a problem of exponential growth, which seems to be less-reliably +# fixed when running on older LLVM and/or some arches. Just skip it for now. +sed -i.ignore -e '1i // ignore-test may still be exponential...' \ + src/test/run-pass/issue-41696.rs + %if %{with bundled_llvm} && 0%{?epel} mkdir -p cmake-bin ln -s /usr/bin/cmake3 cmake-bin/cmake @@ -300,7 +307,12 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %endif %patch1 -p1 -b .no-override -%patch2 -p1 -b .no-fail-fast + +# The configure macro will modify some autoconf-related files, which upsets +# cargo when it tries to verify checksums in those files. If we just truncate +# that file list, cargo won't have anything to complain about. +find src/vendor -name .cargo-checksum.json \ + -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' %build @@ -326,7 +338,8 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ --enable-vendor \ --release-channel=%{channel} -./x.py dist +./x.py build +./x.py doc %install @@ -334,7 +347,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %{?library_path:export LIBRARY_PATH="%{library_path}"} %{?rustflags:export RUSTFLAGS="%{rustflags}"} -DESTDIR=%{buildroot} ./x.py dist --install +DESTDIR=%{buildroot} ./x.py install # Make sure the shared libraries are in the proper libdir @@ -444,6 +457,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Fri Jul 14 2017 Josh Stone - 1.19.0-0.beta.4 +- beta test, now using llvm4 + * Thu Jun 08 2017 Josh Stone - 1.18.0-1 - Update to 1.18.0. From 0e0e5eedcd2981b5ea401457e4169cf853ace32f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 22 Aug 2017 10:18:55 -0700 Subject: [PATCH 14/59] update patches --- rust-1.19.0-43072-stack-guard.patch | 80 ----------------------------- rust.spec | 13 +---- 2 files changed, 2 insertions(+), 91 deletions(-) delete mode 100644 rust-1.19.0-43072-stack-guard.patch diff --git a/rust-1.19.0-43072-stack-guard.patch b/rust-1.19.0-43072-stack-guard.patch deleted file mode 100644 index 137eaf3..0000000 --- a/rust-1.19.0-43072-stack-guard.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 1d5e3cd80b66a3abd274107e75854476c603617d Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 5 Jul 2017 12:03:17 -0700 -Subject: [PATCH] Skip the main thread's manual stack guard on Linux - -Linux doesn't allocate the whole stack right away, and the kernel has -its own stack-guard mechanism to fault when growing too close to an -existing mapping. If we map our own guard, then the kernel starts -enforcing a rather large gap above that, rendering much of the possible -stack space useless. - -Instead, we'll just note where we expect rlimit to start faulting, so -our handler can report "stack overflow", and trust that the kernel's own -stack guard will work. - -Fixes #43052. ---- - src/libstd/sys/unix/thread.rs | 44 ++++++++++++++++++++++++++++--------------- - 1 file changed, 29 insertions(+), 15 deletions(-) - -diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs -index 1642baa34d63..15747746611c 100644 ---- a/src/libstd/sys/unix/thread.rs -+++ b/src/libstd/sys/unix/thread.rs -@@ -264,23 +264,37 @@ pub mod guard { - as *mut libc::c_void; - } - -- // Rellocate the last page of the stack. -- // This ensures SIGBUS will be raised on -- // stack overflow. -- let result = mmap(stackaddr, psize, PROT_NONE, -- MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0); -- -- if result != stackaddr || result == MAP_FAILED { -- panic!("failed to allocate a guard page"); -- } -- -- let offset = if cfg!(any(target_os = "linux", target_os = "freebsd")) { -- 2 -+ if cfg!(target_os = "linux") { -+ // Linux doesn't allocate the whole stack right away, and -+ // the kernel has its own stack-guard mechanism to fault -+ // when growing too close to an existing mapping. If we map -+ // our own guard, then the kernel starts enforcing a rather -+ // large gap above that, rendering much of the possible -+ // stack space useless. See #43052. -+ // -+ // Instead, we'll just note where we expect rlimit to start -+ // faulting, so our handler can report "stack overflow", and -+ // trust that the kernel's own stack guard will work. -+ Some(stackaddr as usize) - } else { -- 1 -- }; -+ // Reallocate the last page of the stack. -+ // This ensures SIGBUS will be raised on -+ // stack overflow. -+ let result = mmap(stackaddr, psize, PROT_NONE, -+ MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0); -+ -+ if result != stackaddr || result == MAP_FAILED { -+ panic!("failed to allocate a guard page"); -+ } - -- Some(stackaddr as usize + offset * psize) -+ let offset = if cfg!(target_os = "freebsd") { -+ 2 -+ } else { -+ 1 -+ }; -+ -+ Some(stackaddr as usize + offset * psize) -+ } - } - - #[cfg(target_os = "solaris")] --- -2.13.3 - diff --git a/rust.spec b/rust.spec index 9fc77fd..151bb4d 100644 --- a/rust.spec +++ b/rust.spec @@ -62,8 +62,7 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -Patch1: rust-1.19.0-43072-stack-guard.patch -Patch2: rust-1.19.0-43297-configure-debuginfo.patch +Patch1: rust-1.19.0-43297-configure-debuginfo.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -281,13 +280,6 @@ cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown sed -e '/*\//q' src/libbacktrace/backtrace.h \ >src/libbacktrace/LICENSE-libbacktrace -# These tests assume that alloc_jemalloc is present -# https://github.com/rust-lang/rust/issues/35017 -sed -i.jemalloc -e '1i // ignore-test jemalloc is disabled' \ - src/test/compile-fail/allocator-dylib-is-system.rs \ - src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs \ - src/test/run-pass/allocator-default.rs - # This tests a problem of exponential growth, which seems to be less-reliably # fixed when running on older LLVM and/or some arches. Just skip it for now. sed -i.ignore -e '1i // ignore-test may still be exponential...' \ @@ -306,8 +298,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ src/librustc_llvm/lib.rs %endif -%patch1 -p1 -b .stack-guard -%patch2 -p1 -b .debuginfo +%patch1 -p1 -b .debuginfo # The configure macro will modify some autoconf-related files, which upsets # cargo when it tries to verify checksums in those files. If we just truncate From dba382a9de95e7bf9ad6e1c33ccfd2537d228df7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Aug 2017 11:29:19 -0700 Subject: [PATCH 15/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 151bb4d..e3c7662 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ Name: rust Version: 1.20.0 -Release: 0.beta.2%{?dist} +Release: 0.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -451,7 +451,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Tue Aug 22 2017 Josh Stone - 1.20.0-0.beta.2 +* Wed Aug 23 2017 Josh Stone - 1.20.0-0.beta.3 - beta test * Thu Aug 03 2017 Fedora Release Engineering - 1.19.0-4 From 8c4c8be2a93b544f6fa94ee1c16c9099b045705d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Aug 2017 12:54:25 -0700 Subject: [PATCH 16/59] update bootstrap --- rust.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust.spec b/rust.spec index e3c7662..fa4b8bf 100644 --- a/rust.spec +++ b/rust.spec @@ -8,10 +8,10 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.18.0 -%global bootstrap_cargo 0.19.0 +%global bootstrap_rust 1.19.0 +%global bootstrap_cargo 0.20.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2017-06-08 +%global bootstrap_date 2017-07-20 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -92,7 +92,7 @@ end} .."/rust-%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do - print(string.format("Source%d: %s-%s.tar.gz\n", + print(string.format("Source%d: %s-%s.tar.xz\n", i, base, rust_triple(arch))) if arch == target_arch then rpm.define("bootstrap_source "..i) From 27cc11db97658846e85d0a562e40bd5a5e1b99df Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 30 Aug 2017 16:34:33 -0700 Subject: [PATCH 17/59] bump the bundled llvm --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index fa4b8bf..86283c4 100644 --- a/rust.spec +++ b/rust.spec @@ -122,7 +122,7 @@ BuildRequires: curl %if %with bundled_llvm BuildRequires: cmake3 -Provides: bundled(llvm) = 3.9 +Provides: bundled(llvm) = 4.0 %else %if 0%{?epel} %global llvm llvm3.9 From bfac8ec0d42f348de10fb129946ce8dd88e33571 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 30 Aug 2017 16:34:52 -0700 Subject: [PATCH 18/59] specifically require /usr/bin/cc --- rust.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index 86283c4..963ebf4 100644 --- a/rust.spec +++ b/rust.spec @@ -163,7 +163,7 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release} # The C compiler is needed at runtime just for linking. Someday rustc might # invoke the linker directly, and then we'll only need binutils. # https://github.com/rust-lang/rust/issues/11937 -Requires: gcc +Requires: /usr/bin/cc # ALL Rust libraries are private, because they don't keep an ABI. %global _privatelibs lib.*-[[:xdigit:]]*[.]so.* From 24b87e1c67f7d292b88feafe440acb4634a27a35 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 30 Aug 2017 16:35:31 -0700 Subject: [PATCH 19/59] add rust-src --- rust.spec | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 963ebf4..8e503fe 100644 --- a/rust.spec +++ b/rust.spec @@ -257,6 +257,15 @@ This package includes HTML documentation for the Rust programming language and its standard library. +%package src +Summary: Sources for the Rust standard library +BuildArch: noarch + +%description src +This package includes source files for the Rust standard library. It may be +useful as a reference for code completion tools in various editors. + + %prep %ifarch %{bootstrap_arches} @@ -269,8 +278,9 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -# unbundle -rm -rf src/jemalloc/ +# We're disabling jemalloc, but rust-src still wants it. +# rm -rf src/jemalloc/ + %if %without bundled_llvm rm -rf src/llvm/ %endif @@ -342,6 +352,7 @@ find src/vendor -name .cargo-checksum.json \ %{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} ./x.py install +DESTDIR=%{buildroot} ./x.py install src # Make sure the shared libraries are in the proper libdir @@ -450,6 +461,11 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %license %{_docdir}/%{name}/html/*.txt +%files src +%dir %{rustlibdir} +%{rustlibdir}/src + + %changelog * Wed Aug 23 2017 Josh Stone - 1.20.0-0.beta.3 - beta test From 688aed533e3e92a6639d28e9f0526c1a757a6bc2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 12 Sep 2017 11:35:47 -0700 Subject: [PATCH 20/59] beta test --- rust-1.19.0-43297-configure-debuginfo.patch | 38 ------------------- ...> rust-1.21.0-44066-ppc64-struct-abi.patch | 26 ++++++------- ....21.0-44203-exclude-compiler-rt-test.patch | 16 ++++---- rust-1.21.0-44353-install-rustc.patch | 28 ++++++++++++++ ...rust-1.21.0-44440-s390x-global-align.patch | 29 +++++++------- rust.spec | 27 +++++++------ 6 files changed, 79 insertions(+), 85 deletions(-) delete mode 100644 rust-1.19.0-43297-configure-debuginfo.patch rename rust-1.20.0-44066-ppc64-struct-abi.patch => rust-1.21.0-44066-ppc64-struct-abi.patch (93%) rename rust-1.20.0-44203-exclude-compiler-rt-test.patch => rust-1.21.0-44203-exclude-compiler-rt-test.patch (70%) create mode 100644 rust-1.21.0-44353-install-rustc.patch rename rust-1.20.0-44440-s390x-global-align.patch => rust-1.21.0-44440-s390x-global-align.patch (91%) diff --git a/rust-1.19.0-43297-configure-debuginfo.patch b/rust-1.19.0-43297-configure-debuginfo.patch deleted file mode 100644 index dac7b61..0000000 --- a/rust-1.19.0-43297-configure-debuginfo.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 253ff9c24f0e11323ae4f173cc620721fb322beb Mon Sep 17 00:00:00 2001 -From: Ximin Luo -Date: Mon, 17 Jul 2017 22:29:09 +0200 -Subject: [PATCH] configure: allow distros to disable debuginfo-only-std - ---- - configure | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/configure b/configure -index af59d5b0bb88..084f5bfdedbc 100755 ---- a/configure -+++ b/configure -@@ -558,8 +558,8 @@ case "$CFG_RELEASE_CHANNEL" in - *-pc-windows-gnu) - ;; - *) -- CFG_ENABLE_DEBUGINFO_LINES=1 -- CFG_ENABLE_DEBUGINFO_ONLY_STD=1 -+ enable_if_not_disabled debuginfo-lines -+ enable_if_not_disabled debuginfo-only-std - ;; - esac - -@@ -570,8 +570,8 @@ case "$CFG_RELEASE_CHANNEL" in - *-pc-windows-gnu) - ;; - *) -- CFG_ENABLE_DEBUGINFO_LINES=1 -- CFG_ENABLE_DEBUGINFO_ONLY_STD=1 -+ enable_if_not_disabled debuginfo-lines -+ enable_if_not_disabled debuginfo-only-std - ;; - esac - ;; --- -2.13.3 - diff --git a/rust-1.20.0-44066-ppc64-struct-abi.patch b/rust-1.21.0-44066-ppc64-struct-abi.patch similarity index 93% rename from rust-1.20.0-44066-ppc64-struct-abi.patch rename to rust-1.21.0-44066-ppc64-struct-abi.patch index 3f7d3b8..de922be 100644 --- a/rust-1.20.0-44066-ppc64-struct-abi.patch +++ b/rust-1.21.0-44066-ppc64-struct-abi.patch @@ -1,4 +1,4 @@ -From 6f680d06544edae491d2281d89b0b93efcdd6143 Mon Sep 17 00:00:00 2001 +From bc3a71ed00af01855b0ae8908ae271b83eca34f6 Mon Sep 17 00:00:00 2001 From: bors Date: Sat, 2 Sep 2017 19:46:51 +0000 Subject: [PATCH] Auto merge of #44066 - cuviper:powerpc64-extern-abi, @@ -35,7 +35,7 @@ formerly-failing tests now pass on powerpc64: 6 files changed, 151 insertions(+), 44 deletions(-) diff --git a/src/librustc_trans/cabi_powerpc64.rs b/src/librustc_trans/cabi_powerpc64.rs -index c4f8d0b4b963..a3780c8cfa92 100644 +index 5c695387236f..fb5472eb6ae1 100644 --- a/src/librustc_trans/cabi_powerpc64.rs +++ b/src/librustc_trans/cabi_powerpc64.rs @@ -14,14 +14,26 @@ @@ -44,7 +44,7 @@ index c4f8d0b4b963..a3780c8cfa92 100644 use context::CrateContext; +use rustc::ty::layout; --fn is_homogenous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) +-fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) +#[derive(Debug, Clone, Copy, PartialEq)] +enum ABI { + ELFv1, // original ABI used for powerpc64 (big-endian) @@ -52,11 +52,11 @@ index c4f8d0b4b963..a3780c8cfa92 100644 +} +use self::ABI::*; + -+fn is_homogenous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, -+ arg: &mut ArgType<'tcx>, -+ abi: ABI) ++fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ++ arg: &mut ArgType<'tcx>, ++ abi: ABI) -> Option { - arg.layout.homogenous_aggregate(ccx).and_then(|unit| { + arg.layout.homogeneous_aggregate(ccx).and_then(|unit| { let size = arg.layout.size(ccx); - // Ensure we have at most eight uniquely addressable members. @@ -68,7 +68,7 @@ index c4f8d0b4b963..a3780c8cfa92 100644 return None; } -@@ -42,21 +54,23 @@ fn is_homogenous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut Arg +@@ -42,21 +54,23 @@ fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut Ar }) } @@ -87,8 +87,8 @@ index c4f8d0b4b963..a3780c8cfa92 100644 + return; } -- if let Some(uniform) = is_homogenous_aggregate(ccx, ret) { -+ if let Some(uniform) = is_homogenous_aggregate(ccx, ret, abi) { +- if let Some(uniform) = is_homogeneous_aggregate(ccx, ret) { ++ if let Some(uniform) = is_homogeneous_aggregate(ccx, ret, abi) { ret.cast_to(ccx, uniform); return; } @@ -107,8 +107,8 @@ index c4f8d0b4b963..a3780c8cfa92 100644 return; } -- if let Some(uniform) = is_homogenous_aggregate(ccx, arg) { -+ if let Some(uniform) = is_homogenous_aggregate(ccx, arg, abi) { +- if let Some(uniform) = is_homogeneous_aggregate(ccx, arg) { ++ if let Some(uniform) = is_homogeneous_aggregate(ccx, arg, abi) { arg.cast_to(ccx, uniform); return; } @@ -159,7 +159,7 @@ index c4f8d0b4b963..a3780c8cfa92 100644 } } diff --git a/src/librustc_trans/cabi_x86.rs b/src/librustc_trans/cabi_x86.rs -index 9f5520dabe33..05932ef2de80 100644 +index 8b024b8c97fa..49634d6e78ce 100644 --- a/src/librustc_trans/cabi_x86.rs +++ b/src/librustc_trans/cabi_x86.rs @@ -11,12 +11,30 @@ diff --git a/rust-1.20.0-44203-exclude-compiler-rt-test.patch b/rust-1.21.0-44203-exclude-compiler-rt-test.patch similarity index 70% rename from rust-1.20.0-44203-exclude-compiler-rt-test.patch rename to rust-1.21.0-44203-exclude-compiler-rt-test.patch index eac112a..feba8ab 100644 --- a/rust-1.20.0-44203-exclude-compiler-rt-test.patch +++ b/rust-1.21.0-44203-exclude-compiler-rt-test.patch @@ -14,14 +14,14 @@ diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 746f85a9d59d..05d59e7d5956 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs -@@ -562,7 +562,7 @@ impl Step for Src { - "src/libprofiler_builtins", - ]; - let std_src_dirs_exclude = [ -- "src/compiler-rt/test", -+ "src/libcompiler_builtins/compiler-rt/test", - "src/jemalloc/test/unit", - ]; +@@ -754,7 +754,7 @@ impl Step for Src { + "src/libprofiler_builtins", + ]; + let std_src_dirs_exclude = [ +- "src/compiler-rt/test", ++ "src/libcompiler_builtins/compiler-rt/test", + "src/jemalloc/test/unit", + ]; -- 2.13.5 diff --git a/rust-1.21.0-44353-install-rustc.patch b/rust-1.21.0-44353-install-rustc.patch new file mode 100644 index 0000000..0b6dec4 --- /dev/null +++ b/rust-1.21.0-44353-install-rustc.patch @@ -0,0 +1,28 @@ +From 110efe25fae60570c00e00d4c6d609f3f9666fb3 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 5 Sep 2017 14:19:22 -0700 +Subject: [PATCH] Include rustc in the default `./x.py install` + +The default install used to include rustc, rust-std, and rust-docs, but +the refactoring in commit 6b3413d825fa6 make rustc only default in +extended builds. This commit makes rustc installed by default again. +--- + src/bootstrap/install.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs +index 89690e444d1f..608924c9c28d 100644 +--- a/src/bootstrap/install.rs ++++ b/src/bootstrap/install.rs +@@ -200,7 +200,7 @@ install!((self, builder, _config), + builder.ensure(dist::Src); + install_src(builder, self.stage); + }, ONLY_BUILD; +- Rustc, "src/librustc", _config.extended, only_hosts: true, { ++ Rustc, "src/librustc", true, only_hosts: true, { + builder.ensure(dist::Rustc { + compiler: builder.compiler(self.stage, self.target), + }); +-- +2.13.5 + diff --git a/rust-1.20.0-44440-s390x-global-align.patch b/rust-1.21.0-44440-s390x-global-align.patch similarity index 91% rename from rust-1.20.0-44440-s390x-global-align.patch rename to rust-1.21.0-44440-s390x-global-align.patch index ddc2180..b368907 100644 --- a/rust-1.20.0-44440-s390x-global-align.patch +++ b/rust-1.21.0-44440-s390x-global-align.patch @@ -1,7 +1,8 @@ -From 3ca86983df58daf0242b0618d3beb9ea917193e2 Mon Sep 17 00:00:00 2001 +From 0f5ee28213a73733e6811b176c89ecececfe9cbc Mon Sep 17 00:00:00 2001 From: bors Date: Mon, 11 Sep 2017 12:53:21 +0000 -Subject: [PATCH] Auto merge of #44440 - cuviper:min_global_align, r=japaric +Subject: [PATCH] Auto merge of #44440 - cuviper:min_global_align, + r=japaric Add `TargetOptions::min_global_align`, with s390x at 16-bit @@ -27,10 +28,10 @@ r? @eddyb create mode 100644 src/test/run-make/min-global-align/min_global_align.rs diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs -index edbbcf6f0b64..f88a3879d6c0 100644 +index 130e1b695dbd..301cf3f8c820 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs -@@ -414,6 +414,9 @@ pub struct TargetOptions { +@@ -425,6 +425,9 @@ pub struct TargetOptions { /// Whether or not stack probes (__rust_probestack) are enabled pub stack_probes: bool, @@ -40,25 +41,25 @@ index edbbcf6f0b64..f88a3879d6c0 100644 } impl Default for TargetOptions { -@@ -472,6 +475,7 @@ impl Default for TargetOptions { - abi_blacklist: vec![], +@@ -486,6 +489,7 @@ impl Default for TargetOptions { crt_static_default: false, + crt_static_respected: false, stack_probes: false, + min_global_align: None, } } } -@@ -695,6 +699,7 @@ impl Target { - try!(key!(panic_strategy, PanicStrategy)); +@@ -724,6 +728,7 @@ impl Target { key!(crt_static_default, bool); + key!(crt_static_respected, bool); key!(stack_probes, bool); + key!(min_global_align, Option); if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) { for name in array.iter().filter_map(|abi| abi.as_string()) { -@@ -882,6 +887,7 @@ impl ToJson for Target { - target_option_val!(panic_strategy); +@@ -914,6 +919,7 @@ impl ToJson for Target { target_option_val!(crt_static_default); + target_option_val!(crt_static_respected); target_option_val!(stack_probes); + target_option_val!(min_global_align); @@ -77,7 +78,7 @@ index 78a6bb7933d9..aad9effacd44 100644 Ok(Target { llvm_target: "s390x-unknown-linux-gnu".to_string(), diff --git a/src/librustc_trans/consts.rs b/src/librustc_trans/consts.rs -index eac0a0625671..cfb29d848d0f 100644 +index 310cd6fe9559..f7f9b9386841 100644 --- a/src/librustc_trans/consts.rs +++ b/src/librustc_trans/consts.rs @@ -26,6 +26,7 @@ use rustc::ty; @@ -88,7 +89,7 @@ index eac0a0625671..cfb29d848d0f 100644 use std::ffi::{CStr, CString}; use syntax::ast; use syntax::attr; -@@ -36,6 +37,25 @@ pub fn ptrcast(val: ValueRef, ty: Type) -> ValueRef { +@@ -42,6 +43,25 @@ pub fn bitcast(val: ValueRef, ty: Type) -> ValueRef { } } @@ -114,7 +115,7 @@ index eac0a0625671..cfb29d848d0f 100644 pub fn addr_of_mut(ccx: &CrateContext, cv: ValueRef, align: machine::llalign, -@@ -47,7 +67,7 @@ pub fn addr_of_mut(ccx: &CrateContext, +@@ -53,7 +73,7 @@ pub fn addr_of_mut(ccx: &CrateContext, bug!("symbol `{}` is already defined", name); }); llvm::LLVMSetInitializer(gv, cv); @@ -123,7 +124,7 @@ index eac0a0625671..cfb29d848d0f 100644 llvm::LLVMRustSetLinkage(gv, llvm::Linkage::InternalLinkage); SetUnnamedAddr(gv, true); gv -@@ -251,7 +271,7 @@ pub fn trans_static<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, +@@ -271,7 +291,7 @@ pub fn trans_static<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ccx.statics_to_rauw().borrow_mut().push((g, new_g)); new_g }; diff --git a/rust.spec b/rust.spec index 035cfe4..b2f4517 100644 --- a/rust.spec +++ b/rust.spec @@ -3,15 +3,15 @@ %global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x # The channel can be stable, beta, or nightly -%{!?channel: %global channel stable} +%{!?channel: %global channel beta} # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.19.0 -%global bootstrap_cargo 0.20.0 +%global bootstrap_rust 1.20.0 +%global bootstrap_cargo 0.21.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2017-07-20 +%global bootstrap_date 2017-08-31 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -47,8 +47,8 @@ Name: rust -Version: 1.20.0 -Release: 2%{?dist} +Version: 1.21.0 +Release: 0.beta.2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -62,10 +62,10 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -Patch1: rust-1.19.0-43297-configure-debuginfo.patch -Patch2: rust-1.20.0-44203-exclude-compiler-rt-test.patch -Patch3: rust-1.20.0-44066-ppc64-struct-abi.patch -Patch4: rust-1.20.0-44440-s390x-global-align.patch +Patch1: rust-1.21.0-44203-exclude-compiler-rt-test.patch +Patch2: rust-1.21.0-44353-install-rustc.patch +Patch3: rust-1.21.0-44066-ppc64-struct-abi.patch +Patch4: rust-1.21.0-44440-s390x-global-align.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -311,8 +311,8 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ src/librustc_llvm/lib.rs %endif -%patch1 -p1 -b .debuginfo -%patch2 -p1 -b .compiler-rt +%patch1 -p1 -b .compiler-rt +%patch2 -p1 -b .install-rustc %patch3 -p1 -b .ppc64-struct-abi %patch4 -p1 -b .s390x-global-align @@ -473,6 +473,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Tue Sep 12 2017 Josh Stone - 1.21.0-0.beta.2 +- beta test + * Mon Sep 11 2017 Josh Stone - 1.20.0-2 - ABI fixes for ppc64 and s390x. From 84c02283ad3d85ea84cd4359b7d39d16703bb5b0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 15 Sep 2017 13:06:46 -0700 Subject: [PATCH 21/59] beta test --- rust-1.21.0-44353-install-rustc.patch | 28 --------------------------- rust.spec | 14 ++++++-------- 2 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 rust-1.21.0-44353-install-rustc.patch diff --git a/rust-1.21.0-44353-install-rustc.patch b/rust-1.21.0-44353-install-rustc.patch deleted file mode 100644 index 0b6dec4..0000000 --- a/rust-1.21.0-44353-install-rustc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 110efe25fae60570c00e00d4c6d609f3f9666fb3 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 5 Sep 2017 14:19:22 -0700 -Subject: [PATCH] Include rustc in the default `./x.py install` - -The default install used to include rustc, rust-std, and rust-docs, but -the refactoring in commit 6b3413d825fa6 make rustc only default in -extended builds. This commit makes rustc installed by default again. ---- - src/bootstrap/install.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs -index 89690e444d1f..608924c9c28d 100644 ---- a/src/bootstrap/install.rs -+++ b/src/bootstrap/install.rs -@@ -200,7 +200,7 @@ install!((self, builder, _config), - builder.ensure(dist::Src); - install_src(builder, self.stage); - }, ONLY_BUILD; -- Rustc, "src/librustc", _config.extended, only_hosts: true, { -+ Rustc, "src/librustc", true, only_hosts: true, { - builder.ensure(dist::Rustc { - compiler: builder.compiler(self.stage, self.target), - }); --- -2.13.5 - diff --git a/rust.spec b/rust.spec index b2f4517..2924a10 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ Name: rust Version: 1.21.0 -Release: 0.beta.2%{?dist} +Release: 0.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -63,9 +63,8 @@ ExclusiveArch: %{rust_arches} Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz Patch1: rust-1.21.0-44203-exclude-compiler-rt-test.patch -Patch2: rust-1.21.0-44353-install-rustc.patch -Patch3: rust-1.21.0-44066-ppc64-struct-abi.patch -Patch4: rust-1.21.0-44440-s390x-global-align.patch +Patch2: rust-1.21.0-44066-ppc64-struct-abi.patch +Patch3: rust-1.21.0-44440-s390x-global-align.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -312,9 +311,8 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ %endif %patch1 -p1 -b .compiler-rt -%patch2 -p1 -b .install-rustc -%patch3 -p1 -b .ppc64-struct-abi -%patch4 -p1 -b .s390x-global-align +%patch2 -p1 -b .ppc64-struct-abi +%patch3 -p1 -b .s390x-global-align # The configure macro will modify some autoconf-related files, which upsets # cargo when it tries to verify checksums in those files. If we just truncate @@ -473,7 +471,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Tue Sep 12 2017 Josh Stone - 1.21.0-0.beta.2 +* Fri Sep 15 2017 Josh Stone - 1.21.0-0.beta.3 - beta test * Mon Sep 11 2017 Josh Stone - 1.20.0-2 From 68c6023eac9cf61c59ed4db949e137a2da3efe2b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 12 Oct 2017 10:42:49 -0700 Subject: [PATCH 22/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 2924a10..bf79523 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ Name: rust Version: 1.21.0 -Release: 0.beta.3%{?dist} +Release: 0.beta.4%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -471,7 +471,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Fri Sep 15 2017 Josh Stone - 1.21.0-0.beta.3 +* Mon Oct 09 2017 Josh Stone - 1.21.0-0.beta.4 - beta test * Mon Sep 11 2017 Josh Stone - 1.20.0-2 From d64fb6367aa172badf0c8d0b47f198fb69c50728 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 15 Nov 2017 16:44:35 -0800 Subject: [PATCH 23/59] beta test --- rust-1.21.0-44066-ppc64-struct-abi.patch | 405 ------------------ ....21.0-44203-exclude-compiler-rt-test.patch | 28 -- rust-1.21.0-44440-s390x-global-align.patch | 210 --------- rust-1.22.0-45566-option-checking.patch | 93 ++++ rust.spec | 39 +- 5 files changed, 118 insertions(+), 657 deletions(-) delete mode 100644 rust-1.21.0-44066-ppc64-struct-abi.patch delete mode 100644 rust-1.21.0-44203-exclude-compiler-rt-test.patch delete mode 100644 rust-1.21.0-44440-s390x-global-align.patch create mode 100644 rust-1.22.0-45566-option-checking.patch diff --git a/rust-1.21.0-44066-ppc64-struct-abi.patch b/rust-1.21.0-44066-ppc64-struct-abi.patch deleted file mode 100644 index de922be..0000000 --- a/rust-1.21.0-44066-ppc64-struct-abi.patch +++ /dev/null @@ -1,405 +0,0 @@ -From bc3a71ed00af01855b0ae8908ae271b83eca34f6 Mon Sep 17 00:00:00 2001 -From: bors -Date: Sat, 2 Sep 2017 19:46:51 +0000 -Subject: [PATCH] Auto merge of #44066 - cuviper:powerpc64-extern-abi, - r=alexcrichton - -powerpc64: improve extern struct ABI - -These fixes all have to do with the 64-bit PowerPC ELF ABI for big-endian -targets. The ELF v2 ABI for powerpc64le already worked well. - -- Return after marking return aggregates indirect. Fixes #42757. -- Pass one-member float aggregates as direct argument values. -- Aggregate arguments less than 64-bit must be written in the least- - significant bits of the parameter space. -- Larger aggregates are instead padded at the tail. - (i.e. filling MSBs, padding the remaining LSBs.) - -New tests were also added for the single-float aggregate, and a 3-byte -aggregate to check that it's filled into LSBs. Overall, at least these -formerly-failing tests now pass on powerpc64: - -- run-make/extern-fn-struct-passing-abi -- run-make/extern-fn-with-packed-struct -- run-pass/extern-pass-TwoU16s.rs -- run-pass/extern-pass-TwoU8s.rs -- run-pass/struct-return.rs ---- - src/librustc_trans/cabi_powerpc64.rs | 64 +++++++++++++++++----- - src/librustc_trans/cabi_x86.rs | 41 ++++++++++++-- - .../run-make/extern-fn-struct-passing-abi/test.c | 32 ++++++++++- - .../run-make/extern-fn-struct-passing-abi/test.rs | 27 +++++++++ - .../run-make/extern-fn-with-packed-struct/test.c | 5 ++ - .../run-make/extern-fn-with-packed-struct/test.rs | 26 +-------- - 6 files changed, 151 insertions(+), 44 deletions(-) - -diff --git a/src/librustc_trans/cabi_powerpc64.rs b/src/librustc_trans/cabi_powerpc64.rs -index 5c695387236f..fb5472eb6ae1 100644 ---- a/src/librustc_trans/cabi_powerpc64.rs -+++ b/src/librustc_trans/cabi_powerpc64.rs -@@ -14,14 +14,26 @@ - - use abi::{FnType, ArgType, LayoutExt, Reg, RegKind, Uniform}; - use context::CrateContext; -+use rustc::ty::layout; - --fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) -+#[derive(Debug, Clone, Copy, PartialEq)] -+enum ABI { -+ ELFv1, // original ABI used for powerpc64 (big-endian) -+ ELFv2, // newer ABI used for powerpc64le -+} -+use self::ABI::*; -+ -+fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, -+ arg: &mut ArgType<'tcx>, -+ abi: ABI) - -> Option { - arg.layout.homogeneous_aggregate(ccx).and_then(|unit| { - let size = arg.layout.size(ccx); - -- // Ensure we have at most eight uniquely addressable members. -- if size > unit.size.checked_mul(8, ccx).unwrap() { -+ // ELFv1 only passes one-member aggregates transparently. -+ // ELFv2 passes up to eight uniquely addressable members. -+ if (abi == ELFv1 && size > unit.size) -+ || size > unit.size.checked_mul(8, ccx).unwrap() { - return None; - } - -@@ -42,21 +54,23 @@ fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut Ar - }) - } - --fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>) { -+fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>, abi: ABI) { - if !ret.layout.is_aggregate() { - ret.extend_integer_width_to(64); - return; - } - -- // The PowerPC64 big endian ABI doesn't return aggregates in registers -- if ccx.sess().target.target.target_endian == "big" { -+ // The ELFv1 ABI doesn't return aggregates in registers -+ if abi == ELFv1 { - ret.make_indirect(ccx); -+ return; - } - -- if let Some(uniform) = is_homogeneous_aggregate(ccx, ret) { -+ if let Some(uniform) = is_homogeneous_aggregate(ccx, ret, abi) { - ret.cast_to(ccx, uniform); - return; - } -+ - let size = ret.layout.size(ccx); - let bits = size.bits(); - if bits <= 128 { -@@ -80,31 +94,55 @@ fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tc - ret.make_indirect(ccx); - } - --fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) { -+fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>, abi: ABI) { - if !arg.layout.is_aggregate() { - arg.extend_integer_width_to(64); - return; - } - -- if let Some(uniform) = is_homogeneous_aggregate(ccx, arg) { -+ if let Some(uniform) = is_homogeneous_aggregate(ccx, arg, abi) { - arg.cast_to(ccx, uniform); - return; - } - -- let total = arg.layout.size(ccx); -+ let size = arg.layout.size(ccx); -+ let (unit, total) = match abi { -+ ELFv1 => { -+ // In ELFv1, aggregates smaller than a doubleword should appear in -+ // the least-significant bits of the parameter doubleword. The rest -+ // should be padded at their tail to fill out multiple doublewords. -+ if size.bits() <= 64 { -+ (Reg { kind: RegKind::Integer, size }, size) -+ } else { -+ let align = layout::Align::from_bits(64, 64).unwrap(); -+ (Reg::i64(), size.abi_align(align)) -+ } -+ }, -+ ELFv2 => { -+ // In ELFv2, we can just cast directly. -+ (Reg::i64(), size) -+ }, -+ }; -+ - arg.cast_to(ccx, Uniform { -- unit: Reg::i64(), -+ unit, - total - }); - } - - pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fty: &mut FnType<'tcx>) { -+ let abi = match ccx.sess().target.target.target_endian.as_str() { -+ "big" => ELFv1, -+ "little" => ELFv2, -+ _ => unimplemented!(), -+ }; -+ - if !fty.ret.is_ignore() { -- classify_ret_ty(ccx, &mut fty.ret); -+ classify_ret_ty(ccx, &mut fty.ret, abi); - } - - for arg in &mut fty.args { - if arg.is_ignore() { continue; } -- classify_arg_ty(ccx, arg); -+ classify_arg_ty(ccx, arg, abi); - } - } -diff --git a/src/librustc_trans/cabi_x86.rs b/src/librustc_trans/cabi_x86.rs -index 8b024b8c97fa..49634d6e78ce 100644 ---- a/src/librustc_trans/cabi_x86.rs -+++ b/src/librustc_trans/cabi_x86.rs -@@ -11,12 +11,30 @@ - use abi::{ArgAttribute, FnType, LayoutExt, Reg, RegKind}; - use common::CrateContext; - -+use rustc::ty::layout::{self, Layout, TyLayout}; -+ - #[derive(PartialEq)] - pub enum Flavor { - General, - Fastcall - } - -+fn is_single_fp_element<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, -+ layout: TyLayout<'tcx>) -> bool { -+ match *layout { -+ Layout::Scalar { value: layout::F32, .. } | -+ Layout::Scalar { value: layout::F64, .. } => true, -+ Layout::Univariant { .. } => { -+ if layout.field_count() == 1 { -+ is_single_fp_element(ccx, layout.field(ccx, 0)) -+ } else { -+ false -+ } -+ } -+ _ => false -+ } -+} -+ - pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, - fty: &mut FnType<'tcx>, - flavor: Flavor) { -@@ -33,12 +51,23 @@ pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, - if t.options.is_like_osx || t.options.is_like_windows - || t.options.is_like_openbsd { - let size = fty.ret.layout.size(ccx); -- match size.bytes() { -- 1 => fty.ret.cast_to(ccx, Reg::i8()), -- 2 => fty.ret.cast_to(ccx, Reg::i16()), -- 4 => fty.ret.cast_to(ccx, Reg::i32()), -- 8 => fty.ret.cast_to(ccx, Reg::i64()), -- _ => fty.ret.make_indirect(ccx) -+ -+ // According to Clang, everyone but MSVC returns single-element -+ // float aggregates directly in a floating-point register. -+ if !t.options.is_like_msvc && is_single_fp_element(ccx, fty.ret.layout) { -+ match size.bytes() { -+ 4 => fty.ret.cast_to(ccx, Reg::f32()), -+ 8 => fty.ret.cast_to(ccx, Reg::f64()), -+ _ => fty.ret.make_indirect(ccx) -+ } -+ } else { -+ match size.bytes() { -+ 1 => fty.ret.cast_to(ccx, Reg::i8()), -+ 2 => fty.ret.cast_to(ccx, Reg::i16()), -+ 4 => fty.ret.cast_to(ccx, Reg::i32()), -+ 8 => fty.ret.cast_to(ccx, Reg::i64()), -+ _ => fty.ret.make_indirect(ccx) -+ } - } - } else { - fty.ret.make_indirect(ccx); -diff --git a/src/test/run-make/extern-fn-struct-passing-abi/test.c b/src/test/run-make/extern-fn-struct-passing-abi/test.c -index 44a940a17a98..25cd6da10b8f 100644 ---- a/src/test/run-make/extern-fn-struct-passing-abi/test.c -+++ b/src/test/run-make/extern-fn-struct-passing-abi/test.c -@@ -43,6 +43,16 @@ struct FloatPoint { - double y; - }; - -+struct FloatOne { -+ double x; -+}; -+ -+struct IntOdd { -+ int8_t a; -+ int8_t b; -+ int8_t c; -+}; -+ - // System V x86_64 ABI: - // a, b, c, d, e should be in registers - // s should be byval pointer -@@ -283,7 +293,7 @@ struct Huge huge_struct(struct Huge s) { - // p should be in registers - // return should be in registers - // --// Win64 ABI: -+// Win64 ABI and 64-bit PowerPC ELFv1 ABI: - // p should be a byval pointer - // return should be in a hidden sret pointer - struct FloatPoint float_point(struct FloatPoint p) { -@@ -292,3 +302,23 @@ struct FloatPoint float_point(struct FloatPoint p) { - - return p; - } -+ -+// 64-bit PowerPC ELFv1 ABI: -+// f1 should be in a register -+// return should be in a hidden sret pointer -+struct FloatOne float_one(struct FloatOne f1) { -+ assert(f1.x == 7.); -+ -+ return f1; -+} -+ -+// 64-bit PowerPC ELFv1 ABI: -+// i should be in the least-significant bits of a register -+// return should be in a hidden sret pointer -+struct IntOdd int_odd(struct IntOdd i) { -+ assert(i.a == 1); -+ assert(i.b == 2); -+ assert(i.c == 3); -+ -+ return i; -+} -diff --git a/src/test/run-make/extern-fn-struct-passing-abi/test.rs b/src/test/run-make/extern-fn-struct-passing-abi/test.rs -index aaae7ae4fb49..54a4f868eb4e 100644 ---- a/src/test/run-make/extern-fn-struct-passing-abi/test.rs -+++ b/src/test/run-make/extern-fn-struct-passing-abi/test.rs -@@ -53,6 +53,20 @@ struct FloatPoint { - y: f64 - } - -+#[derive(Clone, Copy, Debug, PartialEq)] -+#[repr(C)] -+struct FloatOne { -+ x: f64, -+} -+ -+#[derive(Clone, Copy, Debug, PartialEq)] -+#[repr(C)] -+struct IntOdd { -+ a: i8, -+ b: i8, -+ c: i8, -+} -+ - #[link(name = "test", kind = "static")] - extern { - fn byval_rect(a: i32, b: i32, c: i32, d: i32, e: i32, s: Rect); -@@ -83,6 +97,10 @@ extern { - fn huge_struct(s: Huge) -> Huge; - - fn float_point(p: FloatPoint) -> FloatPoint; -+ -+ fn float_one(f: FloatOne) -> FloatOne; -+ -+ fn int_odd(i: IntOdd) -> IntOdd; - } - - fn main() { -@@ -91,6 +109,8 @@ fn main() { - let u = FloatRect { a: 3489, b: 3490, c: 8. }; - let v = Huge { a: 5647, b: 5648, c: 5649, d: 5650, e: 5651 }; - let p = FloatPoint { x: 5., y: -3. }; -+ let f1 = FloatOne { x: 7. }; -+ let i = IntOdd { a: 1, b: 2, c: 3 }; - - unsafe { - byval_rect(1, 2, 3, 4, 5, s); -@@ -113,5 +133,12 @@ fn main() { - assert_eq!(sret_byval_struct(1, 2, 3, 4, s), t); - assert_eq!(sret_split_struct(1, 2, s), t); - assert_eq!(float_point(p), p); -+ assert_eq!(int_odd(i), i); -+ -+ // MSVC/GCC/Clang are not consistent in the ABI of single-float aggregates. -+ // x86_64: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82028 -+ // i686: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82041 -+ #[cfg(not(all(windows, target_env = "gnu")))] -+ assert_eq!(float_one(f1), f1); - } - } -diff --git a/src/test/run-make/extern-fn-with-packed-struct/test.c b/src/test/run-make/extern-fn-with-packed-struct/test.c -index 506954fca461..4124e202c1dd 100644 ---- a/src/test/run-make/extern-fn-with-packed-struct/test.c -+++ b/src/test/run-make/extern-fn-with-packed-struct/test.c -@@ -1,6 +1,8 @@ - // ignore-license - // Pragma needed cause of gcc bug on windows: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991 - -+#include -+ - #ifdef _MSC_VER - #pragma pack(push,1) - struct Foo { -@@ -18,5 +20,8 @@ struct __attribute__((packed)) Foo { - #endif - - struct Foo foo(struct Foo foo) { -+ assert(foo.a == 1); -+ assert(foo.b == 2); -+ assert(foo.c == 3); - return foo; - } -diff --git a/src/test/run-make/extern-fn-with-packed-struct/test.rs b/src/test/run-make/extern-fn-with-packed-struct/test.rs -index 9e81636e3670..d2540ad61542 100644 ---- a/src/test/run-make/extern-fn-with-packed-struct/test.rs -+++ b/src/test/run-make/extern-fn-with-packed-struct/test.rs -@@ -8,36 +8,14 @@ - // option. This file may not be copied, modified, or distributed - // except according to those terms. - --use std::fmt; -- --#[repr(packed)] --#[derive(Copy, Clone)] -+#[repr(C, packed)] -+#[derive(Copy, Clone, Debug, PartialEq)] - struct Foo { - a: i8, - b: i16, - c: i8 - } - --impl PartialEq for Foo { -- fn eq(&self, other: &Foo) -> bool { -- self.a == other.a && self.b == other.b && self.c == other.c -- } --} -- --impl fmt::Debug for Foo { -- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { -- let a = self.a; -- let b = self.b; -- let c = self.c; -- -- f.debug_struct("Foo") -- .field("a", &a) -- .field("b", &b) -- .field("c", &c) -- .finish() -- } --} -- - #[link(name = "test", kind = "static")] - extern { - fn foo(f: Foo) -> Foo; --- -2.13.5 - diff --git a/rust-1.21.0-44203-exclude-compiler-rt-test.patch b/rust-1.21.0-44203-exclude-compiler-rt-test.patch deleted file mode 100644 index feba8ab..0000000 --- a/rust-1.21.0-44203-exclude-compiler-rt-test.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 35f8a2065b7d17d39481a75cefa739df7a061084 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 30 Aug 2017 18:20:59 -0700 -Subject: [PATCH] rustbuild: update the rust-src filter for compiler-rt - -We wanted `src/compiler-rt/test` filtered from the `rust-src` package, -but that path is now `src/libcompiler_builtins/compiler-rt/test`. This -saves over half of the installed rust-src size. (50MB -> 22MB) ---- - src/bootstrap/dist.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index 746f85a9d59d..05d59e7d5956 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -754,7 +754,7 @@ impl Step for Src { - "src/libprofiler_builtins", - ]; - let std_src_dirs_exclude = [ -- "src/compiler-rt/test", -+ "src/libcompiler_builtins/compiler-rt/test", - "src/jemalloc/test/unit", - ]; - --- -2.13.5 - diff --git a/rust-1.21.0-44440-s390x-global-align.patch b/rust-1.21.0-44440-s390x-global-align.patch deleted file mode 100644 index b368907..0000000 --- a/rust-1.21.0-44440-s390x-global-align.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 0f5ee28213a73733e6811b176c89ecececfe9cbc Mon Sep 17 00:00:00 2001 -From: bors -Date: Mon, 11 Sep 2017 12:53:21 +0000 -Subject: [PATCH] Auto merge of #44440 - cuviper:min_global_align, - r=japaric - -Add `TargetOptions::min_global_align`, with s390x at 16-bit - -The SystemZ `LALR` instruction provides PC-relative addressing for globals, -but only to *even* addresses, so other compilers make sure that such -globals are always 2-byte aligned. In Clang, this is modeled with -`TargetInfo::MinGlobalAlign`, and `TargetOptions::min_global_align` now -serves the same purpose for rustc. - -In Clang, the only targets that set this are SystemZ, Lanai, and NVPTX, and -the latter two don't have targets in rust master. - -Fixes #44411. -r? @eddyb ---- - src/librustc_back/target/mod.rs | 6 ++++ - .../target/s390x_unknown_linux_gnu.rs | 1 + - src/librustc_trans/consts.rs | 24 ++++++++++++-- - src/test/run-make/min-global-align/Makefile | 22 +++++++++++++ - .../run-make/min-global-align/min_global_align.rs | 38 ++++++++++++++++++++++ - 5 files changed, 89 insertions(+), 2 deletions(-) - create mode 100644 src/test/run-make/min-global-align/Makefile - create mode 100644 src/test/run-make/min-global-align/min_global_align.rs - -diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs -index 130e1b695dbd..301cf3f8c820 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -425,6 +425,9 @@ pub struct TargetOptions { - - /// Whether or not stack probes (__rust_probestack) are enabled - pub stack_probes: bool, -+ -+ /// The minimum alignment for global symbols. -+ pub min_global_align: Option, - } - - impl Default for TargetOptions { -@@ -486,6 +489,7 @@ impl Default for TargetOptions { - crt_static_default: false, - crt_static_respected: false, - stack_probes: false, -+ min_global_align: None, - } - } - } -@@ -724,6 +728,7 @@ impl Target { - key!(crt_static_default, bool); - key!(crt_static_respected, bool); - key!(stack_probes, bool); -+ key!(min_global_align, Option); - - if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) { - for name in array.iter().filter_map(|abi| abi.as_string()) { -@@ -914,6 +919,7 @@ impl ToJson for Target { - target_option_val!(crt_static_default); - target_option_val!(crt_static_respected); - target_option_val!(stack_probes); -+ target_option_val!(min_global_align); - - if default.abi_blacklist != self.options.abi_blacklist { - d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter() -diff --git a/src/librustc_back/target/s390x_unknown_linux_gnu.rs b/src/librustc_back/target/s390x_unknown_linux_gnu.rs -index 78a6bb7933d9..aad9effacd44 100644 ---- a/src/librustc_back/target/s390x_unknown_linux_gnu.rs -+++ b/src/librustc_back/target/s390x_unknown_linux_gnu.rs -@@ -22,6 +22,7 @@ pub fn target() -> TargetResult { - base.max_atomic_width = Some(64); - // see #36994 - base.exe_allocation_crate = None; -+ base.min_global_align = Some(16); - - Ok(Target { - llvm_target: "s390x-unknown-linux-gnu".to_string(), -diff --git a/src/librustc_trans/consts.rs b/src/librustc_trans/consts.rs -index 310cd6fe9559..f7f9b9386841 100644 ---- a/src/librustc_trans/consts.rs -+++ b/src/librustc_trans/consts.rs -@@ -26,6 +26,7 @@ use rustc::ty; - - use rustc::hir; - -+use std::cmp; - use std::ffi::{CStr, CString}; - use syntax::ast; - use syntax::attr; -@@ -42,6 +43,25 @@ pub fn bitcast(val: ValueRef, ty: Type) -> ValueRef { - } - } - -+fn set_global_alignment(ccx: &CrateContext, -+ gv: ValueRef, -+ mut align: machine::llalign) { -+ // The target may require greater alignment for globals than the type does. -+ // Note: GCC and Clang also allow `__attribute__((aligned))` on variables, -+ // which can force it to be smaller. Rust doesn't support this yet. -+ if let Some(min) = ccx.sess().target.target.options.min_global_align { -+ match ty::layout::Align::from_bits(min, min) { -+ Ok(min) => align = cmp::max(align, min.abi() as machine::llalign), -+ Err(err) => { -+ ccx.sess().err(&format!("invalid minimum global alignment: {}", err)); -+ } -+ } -+ } -+ unsafe { -+ llvm::LLVMSetAlignment(gv, align); -+ } -+} -+ - pub fn addr_of_mut(ccx: &CrateContext, - cv: ValueRef, - align: machine::llalign, -@@ -53,7 +73,7 @@ pub fn addr_of_mut(ccx: &CrateContext, - bug!("symbol `{}` is already defined", name); - }); - llvm::LLVMSetInitializer(gv, cv); -- llvm::LLVMSetAlignment(gv, align); -+ set_global_alignment(ccx, gv, align); - llvm::LLVMRustSetLinkage(gv, llvm::Linkage::InternalLinkage); - SetUnnamedAddr(gv, true); - gv -@@ -271,7 +291,7 @@ pub fn trans_static<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, - ccx.statics_to_rauw().borrow_mut().push((g, new_g)); - new_g - }; -- llvm::LLVMSetAlignment(g, ccx.align_of(ty)); -+ set_global_alignment(ccx, g, ccx.align_of(ty)); - llvm::LLVMSetInitializer(g, v); - - // As an optimization, all shared statics which do not have interior -diff --git a/src/test/run-make/min-global-align/Makefile b/src/test/run-make/min-global-align/Makefile -new file mode 100644 -index 000000000000..2eacc36f380d ---- /dev/null -+++ b/src/test/run-make/min-global-align/Makefile -@@ -0,0 +1,22 @@ -+-include ../tools.mk -+ -+# This tests ensure that global variables respect the target minimum alignment. -+# The three bools `STATIC_BOOL`, `STATIC_MUT_BOOL`, and `CONST_BOOL` all have -+# type-alignment of 1, but some targets require greater global alignment. -+ -+SRC = min_global_align.rs -+LL = $(TMPDIR)/min_global_align.ll -+ -+all: -+ifeq ($(UNAME),Linux) -+# Most targets are happy with default alignment -- take i686 for example. -+ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86) -+ $(RUSTC) --target=i686-unknown-linux-gnu --emit=llvm-ir $(SRC) -+ [ "$$(grep -c 'align 1' "$(LL)")" -eq "3" ] -+endif -+# SystemZ requires even alignment for PC-relative addressing. -+ifeq ($(filter systemz,$(LLVM_COMPONENTS)),systemz) -+ $(RUSTC) --target=s390x-unknown-linux-gnu --emit=llvm-ir $(SRC) -+ [ "$$(grep -c 'align 2' "$(LL)")" -eq "3" ] -+endif -+endif -diff --git a/src/test/run-make/min-global-align/min_global_align.rs b/src/test/run-make/min-global-align/min_global_align.rs -new file mode 100644 -index 000000000000..3d4f9001a747 ---- /dev/null -+++ b/src/test/run-make/min-global-align/min_global_align.rs -@@ -0,0 +1,38 @@ -+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -+// file at the top-level directory of this distribution and at -+// http://rust-lang.org/COPYRIGHT. -+// -+// Licensed under the Apache License, Version 2.0 or the MIT license -+// , at your -+// option. This file may not be copied, modified, or distributed -+// except according to those terms. -+ -+#![feature(no_core, lang_items)] -+#![crate_type="rlib"] -+#![no_core] -+ -+pub static STATIC_BOOL: bool = true; -+ -+pub static mut STATIC_MUT_BOOL: bool = true; -+ -+const CONST_BOOL: bool = true; -+pub static CONST_BOOL_REF: &'static bool = &CONST_BOOL; -+ -+ -+#[lang = "sized"] -+trait Sized {} -+ -+#[lang = "copy"] -+trait Copy {} -+ -+#[lang = "freeze"] -+trait Freeze {} -+ -+#[lang = "sync"] -+trait Sync {} -+impl Sync for bool {} -+impl Sync for &'static bool {} -+ -+#[lang="drop_in_place"] -+pub unsafe fn drop_in_place(_: *mut T) { } --- -2.13.5 - diff --git a/rust-1.22.0-45566-option-checking.patch b/rust-1.22.0-45566-option-checking.patch new file mode 100644 index 0000000..777e1f5 --- /dev/null +++ b/rust-1.22.0-45566-option-checking.patch @@ -0,0 +1,93 @@ +commit 75277c72c0c6f603bb258383ad74d3082dc4a720 (from c1a0b6d9eb888ded9a7204db0d67d62b1cdc9944) +Merge: c1a0b6d9eb88 19714f55ee70 +Author: bors +Date: Sat Oct 28 07:08:52 2017 +0000 + + Auto merge of #45566 - cuviper:option-checking, r=alexcrichton + + configure.py: fix --disable-option-checking and extra config paths + + - indexing 'option-checking' out of `known_args` had a type error + - when option checking is disabled, don't error on duplicate args, just take the last + - add config.toml stubs for datadir, infodir, and localstatedir (which were already accepted, but broken) + + --- + + This fixes a regression from 1.21 to beta, when the configure script was rewritten in python. + +diff --git a/config.toml.example b/config.toml.example +index 261fe2053879..df0142b8d46d 100644 +--- a/config.toml.example ++++ b/config.toml.example +@@ -203,6 +203,16 @@ + # Where to install man pages in `prefix` above + #mandir = "share/man" + ++# Where to install data in `prefix` above (currently unused) ++#datadir = "share" ++ ++# Where to install additional info in `prefix` above (currently unused) ++#infodir = "share/info" ++ ++# Where to install local state (currently unused) ++# If this is a relative path, it will get installed in `prefix` above ++#localstatedir = "/var/lib" ++ + # ============================================================================= + # Options for compiling Rust code itself + # ============================================================================= +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index 66e5efcea4e8..33c7141e7044 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -207,6 +207,11 @@ struct Install { + bindir: Option, + libdir: Option, + mandir: Option, ++ ++ // standard paths, currently unused ++ datadir: Option, ++ infodir: Option, ++ localstatedir: Option, + } + + /// TOML representation of how the LLVM build is configured. +diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py +index 42425a164a20..579422c97993 100755 +--- a/src/bootstrap/configure.py ++++ b/src/bootstrap/configure.py +@@ -225,7 +225,12 @@ while i < len(sys.argv): + unknown_args.append(arg) + p("") + +-if 'option-checking' not in known_args or known_args['option-checking'][1]: ++# Note: here and a few other places, we use [-1] to apply the *last* value ++# passed. But if option-checking is enabled, then the known_args loop will ++# also assert that options are only passed once. ++option_checking = ('option-checking' not in known_args ++ or known_args['option-checking'][-1][1]) ++if option_checking: + if len(unknown_args) > 0: + err("Option '" + unknown_args[0] + "' is not recognized") + if len(need_value_args) > 0: +@@ -238,7 +243,7 @@ config = {} + + def build(): + if 'build' in known_args: +- return known_args['build'][0][1] ++ return known_args['build'][-1][1] + return bootstrap.default_build_triple() + + +@@ -276,9 +281,9 @@ for key in known_args: + + # Ensure each option is only passed once + arr = known_args[key] +- if len(arr) > 1: ++ if option_checking and len(arr) > 1: + err("Option '{}' provided more than once".format(key)) +- option, value = arr[0] ++ option, value = arr[-1] + + # If we have a clear avenue to set our value in rustbuild, do so + if option.rustbuild is not None: diff --git a/rust.spec b/rust.spec index 830d844..beffa9b 100644 --- a/rust.spec +++ b/rust.spec @@ -8,10 +8,10 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.20.0 -%global bootstrap_cargo 0.21.0 +%global bootstrap_rust 1.21.0 +%global bootstrap_cargo 0.22.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2017-08-31 +%global bootstrap_date 2017-10-12 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -47,8 +47,8 @@ Name: rust -Version: 1.21.0 -Release: 1%{?dist} +Version: 1.22.0 +Release: 0.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -62,9 +62,7 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -Patch1: rust-1.21.0-44203-exclude-compiler-rt-test.patch -Patch2: rust-1.21.0-44066-ppc64-struct-abi.patch -Patch3: rust-1.21.0-44440-s390x-global-align.patch +Patch1: rust-1.22.0-45566-option-checking.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -128,6 +126,11 @@ Provides: bundled(llvm) = 4.0 %else %if 0%{?epel} %global llvm llvm3.9 +%endif +%if 0%{?fedora} >= 28 +%global llvm llvm4.0 +%endif +%if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else %global llvm llvm @@ -310,9 +313,8 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ src/librustc_llvm/lib.rs %endif -%patch1 -p1 -b .compiler-rt -%patch2 -p1 -b .ppc64-struct-abi -%patch3 -p1 -b .s390x-global-align +%global _default_patch_fuzz 1 +%patch1 -p1 -b .option-checking # The configure macro will modify some autoconf-related files, which upsets # cargo when it tries to verify checksums in those files. If we just truncate @@ -332,6 +334,14 @@ find src/vendor -name .cargo-checksum.json \ %global common_libdir %{_prefix}/lib %global rustlibdir %{common_libdir}/rustlib +%ifarch %{arm} +# full debuginfo is exhausting memory; just do libstd for now +# https://github.com/rust-lang/rust/issues/45854 +%define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-lines +%else +%define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-lines +%endif + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -340,9 +350,7 @@ find src/vendor -name .cargo-checksum.json \ %{!?with_llvm_static: --enable-llvm-link-shared } } \ --disable-jemalloc \ --disable-rpath \ - --disable-debuginfo-lines \ - --disable-debuginfo-only-std \ - --enable-debuginfo \ + %{enable_debuginfo} \ --enable-vendor \ --release-channel=%{channel} @@ -471,6 +479,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed Nov 15 2017 Josh Stone - 1.22.0-0.beta.3 +- beta test + * Thu Oct 12 2017 Josh Stone - 1.21.0-1 - Update to 1.21.0. From 6006123dafb86e20f80d8005021b177e6635e834 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 1 Feb 2018 09:40:45 -0800 Subject: [PATCH 24/59] beta test --- rust-1.24.0-beta-prerelease.patch | 17 +++++++++++++++++ rust.spec | 17 ++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 rust-1.24.0-beta-prerelease.patch diff --git a/rust-1.24.0-beta-prerelease.patch b/rust-1.24.0-beta-prerelease.patch new file mode 100644 index 0000000..1e63ce1 --- /dev/null +++ b/rust-1.24.0-beta-prerelease.patch @@ -0,0 +1,17 @@ +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 3738828a4bae..9fbbbb0278a0 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -776,7 +776,11 @@ impl Build { + fn release(&self, num: &str) -> String { + match &self.config.channel[..] { + "stable" => num.to_string(), +- "beta" => format!("{}-beta.{}", num, self.beta_prerelease_version()), ++ "beta" => if self.rust_info.is_git() { ++ format!("{}-beta.{}", num, self.beta_prerelease_version()) ++ } else { ++ format!("{}-beta", num) ++ }, + "nightly" => format!("{}-nightly", num), + _ => format!("{}-dev", num), + } diff --git a/rust.spec b/rust.spec index b61a636..06e6182 100644 --- a/rust.spec +++ b/rust.spec @@ -8,10 +8,10 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.22.0 -%global bootstrap_cargo 0.23.0 +%global bootstrap_rust 1.23.0 +%global bootstrap_cargo 0.24.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2017-11-22 +%global bootstrap_date 2018-01-04 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -47,8 +47,8 @@ Name: rust -Version: 1.23.0 -Release: 1%{?dist} +Version: 1.24.0 +Release: 0.beta.8%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -62,6 +62,8 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +Patch1: rust-1.24.0-beta-prerelease.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -282,6 +284,8 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} +%patch1 -p1 -b .beta-prerelease + # We're disabling jemalloc, but rust-src still wants it. # rm -rf src/jemalloc/ @@ -475,6 +479,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Jan 25 2018 Josh Stone - 1.24.0-0.beta.8 +- beta test + * Mon Jan 08 2018 Josh Stone - 1.23.0-1 - Update to 1.23.0. From 9731a9fcfaf6f893fe94ca61e0798811e9754776 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 2 Feb 2018 17:15:51 -0800 Subject: [PATCH 25/59] beta test, use LLVM 5 where available --- 0001-Fix-Wcatch-value-from-GCC-8.patch | 57 ++++++++++++++++ ...-DW_OP_deref-to-indirect-args-itself.patch | 53 +++++++++++++++ ...date-DW_OP_plus-to-DW_OP_plus_uconst.patch | 67 +++++++++++++++++++ rust.spec | 22 +++++- 4 files changed, 196 insertions(+), 3 deletions(-) create mode 100644 0001-Fix-Wcatch-value-from-GCC-8.patch create mode 100644 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch create mode 100644 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch diff --git a/0001-Fix-Wcatch-value-from-GCC-8.patch b/0001-Fix-Wcatch-value-from-GCC-8.patch new file mode 100644 index 0000000..49d037b --- /dev/null +++ b/0001-Fix-Wcatch-value-from-GCC-8.patch @@ -0,0 +1,57 @@ +From 327c3d06258576cc9d9f2e5c0861abc72ebd10ef Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 2 Feb 2018 16:23:04 -0800 +Subject: [PATCH] Fix -Wcatch-value from GCC 8 + +These instances may simply be caught by reference instead. +--- + src/tools/asm2wasm.cpp | 2 +- + src/tools/s2wasm.cpp | 2 +- + src/wasm/wasm-s-parser.cpp | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/tools/asm2wasm.cpp b/src/tools/asm2wasm.cpp +index 75a2c4d15e2e..6d14067d240f 100644 +--- a/src/tools/asm2wasm.cpp ++++ b/src/tools/asm2wasm.cpp +@@ -87,7 +87,7 @@ int main(int argc, const char *argv[]) { + [&trapMode](Options *o, const std::string &argument) { + try { + trapMode = trapModeFromString(argument); +- } catch (std::invalid_argument e) { ++ } catch (std::invalid_argument &e) { + std::cerr << "Error: " << e.what() << "\n"; + exit(EXIT_FAILURE); + } +diff --git a/src/tools/s2wasm.cpp b/src/tools/s2wasm.cpp +index 32af57dba5bf..c5e1d52b8d96 100644 +--- a/src/tools/s2wasm.cpp ++++ b/src/tools/s2wasm.cpp +@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { + [&trapMode](Options *o, const std::string &argument) { + try { + trapMode = trapModeFromString(argument); +- } catch (std::invalid_argument e) { ++ } catch (std::invalid_argument &e) { + std::cerr << "Error: " << e.what() << "\n"; + exit(EXIT_FAILURE); + } +diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp +index 0de3edf3f6b4..78a150f8146c 100644 +--- a/src/wasm/wasm-s-parser.cpp ++++ b/src/wasm/wasm-s-parser.cpp +@@ -1408,9 +1408,9 @@ Name SExpressionWasmBuilder::getLabel(Element& s) { + uint64_t offset; + try { + offset = std::stoll(s.c_str(), nullptr, 0); +- } catch (std::invalid_argument) { ++ } catch (std::invalid_argument&) { + throw ParseException("invalid break offset"); +- } catch (std::out_of_range) { ++ } catch (std::out_of_range&) { + throw ParseException("out of range break offset"); + } + if (offset > nameMapper.labelStack.size()) throw ParseException("invalid label", s.line, s.col); +-- +2.14.3 + diff --git a/0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch b/0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch new file mode 100644 index 0000000..3e8a4be --- /dev/null +++ b/0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch @@ -0,0 +1,53 @@ +From 7eb7d45c0b0a9dc0454c5f3a3c5e911c7900bbea Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 23 Jan 2018 13:53:01 -0800 +Subject: [PATCH] Let LLVM 5 add DW_OP_deref to indirect args itself + +We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, +but starting with [D31439] in LLVM 5, it appears that LLVM will always +handle this itself. When we were still adding this manually, the +resulting `.debug_loc` had too many derefs, and this failed test +`debuginfo/by-value-self-argument-in-trait-impl.rs`. + +[D31439]: https://reviews.llvm.org/D31439 + +Fixes #47611. +cc @alexcrichton +r? @michaelwoerister +--- + src/librustc_trans/mir/mod.rs | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs +index b367eb6548d0..da01592d9118 100644 +--- a/src/librustc_trans/mir/mod.rs ++++ b/src/librustc_trans/mir/mod.rs +@@ -487,16 +487,18 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, + // The Rust ABI passes indirect variables using a pointer and a manual copy, so we + // need to insert a deref here, but the C ABI uses a pointer and a copy using the + // byval attribute, for which LLVM does the deref itself, so we must not add it. ++ // Starting with D31439 in LLVM 5, it *always* does the deref itself. + let mut variable_access = VariableAccess::DirectVariable { + alloca: place.llval + }; +- +- if let PassMode::Indirect(ref attrs) = arg.mode { +- if !attrs.contains(ArgAttribute::ByVal) { +- variable_access = VariableAccess::IndirectVariable { +- alloca: place.llval, +- address_operations: &deref_op, +- }; ++ if unsafe { llvm::LLVMRustVersionMajor() < 5 } { ++ if let PassMode::Indirect(ref attrs) = arg.mode { ++ if !attrs.contains(ArgAttribute::ByVal) { ++ variable_access = VariableAccess::IndirectVariable { ++ alloca: place.llval, ++ address_operations: &deref_op, ++ }; ++ } + } + } + +-- +2.14.3 + diff --git a/0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch b/0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch new file mode 100644 index 0000000..f975051 --- /dev/null +++ b/0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch @@ -0,0 +1,67 @@ +From e2f6b280ea13e48bff86254549988e61eee37139 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 19 Jan 2018 21:43:53 -0800 +Subject: [PATCH] Update DW_OP_plus to DW_OP_plus_uconst + +LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`. In the +DWARF standard, this adds two items on the expressions stack. LLVM's +behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant +that follows the op. The patch series starting with [D33892] switched +to the standard DWARF interpretation, so we need to follow. + +[D33892]: https://reviews.llvm.org/D33892 +--- + src/librustc_llvm/ffi.rs | 2 +- + src/librustc_trans/mir/mod.rs | 2 +- + src/rustllvm/RustWrapper.cpp | 9 ++++++++- + 3 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs +index b97e37f4c8fb..f51e51a88b10 100644 +--- a/src/librustc_llvm/ffi.rs ++++ b/src/librustc_llvm/ffi.rs +@@ -1546,7 +1546,7 @@ extern "C" { + InlinedAt: MetadataRef) + -> ValueRef; + pub fn LLVMRustDIBuilderCreateOpDeref() -> i64; +- pub fn LLVMRustDIBuilderCreateOpPlus() -> i64; ++ pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64; + + pub fn LLVMRustWriteTypeToString(Type: TypeRef, s: RustStringRef); + pub fn LLVMRustWriteValueToString(value_ref: ValueRef, s: RustStringRef); +diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs +index 3064e2f7c7af..b367eb6548d0 100644 +--- a/src/librustc_trans/mir/mod.rs ++++ b/src/librustc_trans/mir/mod.rs +@@ -547,7 +547,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, + + let ops = unsafe { + [llvm::LLVMRustDIBuilderCreateOpDeref(), +- llvm::LLVMRustDIBuilderCreateOpPlus(), ++ llvm::LLVMRustDIBuilderCreateOpPlusUconst(), + byte_offset_of_var_in_env as i64, + llvm::LLVMRustDIBuilderCreateOpDeref()] + }; +diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp +index 95130d596e16..0fe533d447bc 100644 +--- a/src/rustllvm/RustWrapper.cpp ++++ b/src/rustllvm/RustWrapper.cpp +@@ -866,7 +866,14 @@ extern "C" int64_t LLVMRustDIBuilderCreateOpDeref() { + return dwarf::DW_OP_deref; + } + +-extern "C" int64_t LLVMRustDIBuilderCreateOpPlus() { return dwarf::DW_OP_plus; } ++extern "C" int64_t LLVMRustDIBuilderCreateOpPlusUconst() { ++#if LLVM_VERSION_GE(5, 0) ++ return dwarf::DW_OP_plus_uconst; ++#else ++ // older LLVM used `plus` to behave like `plus_uconst`. ++ return dwarf::DW_OP_plus; ++#endif ++} + + extern "C" void LLVMRustWriteTypeToString(LLVMTypeRef Ty, RustStringRef Str) { + RawRustStringOstream OS(Str); +-- +2.14.3 + diff --git a/rust.spec b/rust.spec index 447668e..356868b 100644 --- a/rust.spec +++ b/rust.spec @@ -62,8 +62,18 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# https://github.com/rust-lang/rust/pull/47762 Patch1: rust-1.24.0-beta-prerelease.patch +# https://github.com/rust-lang/rust/pull/47610 +Patch2: 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch + +# https://github.com/rust-lang/rust/pull/47688 +Patch3: 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch + +# https://github.com/WebAssembly/binaryen/pull/1400 +Patch4: 0001-Fix-Wcatch-value-from-GCC-8.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -128,8 +138,8 @@ BuildRequires: cmake >= 2.8.7 %if 0%{?epel} %global llvm llvm3.9 %endif -%if 0%{?fedora} >= 27 -%global llvm llvm4.0 +%if 0%{?fedora} >= 28 +%global llvm llvm5.0 %endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} @@ -285,6 +295,12 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -b .beta-prerelease +%patch2 -p1 -b .DW_OP_plus_uconst +%patch3 -p1 -b .DW_OP_deref + +pushd src/binaryen +%patch4 -p1 -b .catch-value +popd # We're disabling jemalloc, but rust-src still wants it. # rm -rf src/jemalloc/ @@ -479,7 +495,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog * Fri Feb 02 2018 Josh Stone - 1.24.0-0.beta.8 -- beta test +- beta test, use LLVM 5 where available * Thu Feb 01 2018 Igor Gnatenko - 1.23.0-2 - Switch to %%ldconfig_scriptlets From 7fe47101e07647c35619aacd3fa0f96b90f2c4a7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 5 Feb 2018 13:29:08 -0800 Subject: [PATCH 26/59] beta test --- rust-1.24.0-beta-prerelease.patch | 17 ----------------- rust.spec | 21 ++++++++++----------- 2 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 rust-1.24.0-beta-prerelease.patch diff --git a/rust-1.24.0-beta-prerelease.patch b/rust-1.24.0-beta-prerelease.patch deleted file mode 100644 index 1e63ce1..0000000 --- a/rust-1.24.0-beta-prerelease.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 3738828a4bae..9fbbbb0278a0 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -776,7 +776,11 @@ impl Build { - fn release(&self, num: &str) -> String { - match &self.config.channel[..] { - "stable" => num.to_string(), -- "beta" => format!("{}-beta.{}", num, self.beta_prerelease_version()), -+ "beta" => if self.rust_info.is_git() { -+ format!("{}-beta.{}", num, self.beta_prerelease_version()) -+ } else { -+ format!("{}-beta", num) -+ }, - "nightly" => format!("{}-nightly", num), - _ => format!("{}-dev", num), - } diff --git a/rust.spec b/rust.spec index 356868b..1d6bf27 100644 --- a/rust.spec +++ b/rust.spec @@ -48,7 +48,7 @@ Name: rust Version: 1.24.0 -Release: 0.beta.8%{?dist} +Release: 0.beta.11%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -62,17 +62,14 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/47762 -Patch1: rust-1.24.0-beta-prerelease.patch - # https://github.com/rust-lang/rust/pull/47610 -Patch2: 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch +Patch1: 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch # https://github.com/rust-lang/rust/pull/47688 -Patch3: 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch +Patch2: 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch # https://github.com/WebAssembly/binaryen/pull/1400 -Patch4: 0001-Fix-Wcatch-value-from-GCC-8.patch +Patch3: 0001-Fix-Wcatch-value-from-GCC-8.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -294,12 +291,11 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -b .beta-prerelease -%patch2 -p1 -b .DW_OP_plus_uconst -%patch3 -p1 -b .DW_OP_deref +%patch1 -p1 -b .DW_OP_plus_uconst +%patch2 -p1 -b .DW_OP_deref pushd src/binaryen -%patch4 -p1 -b .catch-value +%patch3 -p1 -b .catch-value popd # We're disabling jemalloc, but rust-src still wants it. @@ -494,6 +490,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Mon Feb 05 2018 Josh Stone - 1.24.0-0.beta.11 +- beta test + * Fri Feb 02 2018 Josh Stone - 1.24.0-0.beta.8 - beta test, use LLVM 5 where available From 01f9f4f8d7b9c8102b3630ebdd629854a904aae1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 6 Feb 2018 23:21:45 -0800 Subject: [PATCH 27/59] use llvm5 for epel7 --- rust.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rust.spec b/rust.spec index 1d6bf27..24d444f 100644 --- a/rust.spec +++ b/rust.spec @@ -132,10 +132,7 @@ BuildRequires: cmake3 >= 3.4.3 Provides: bundled(llvm) = 4.0 %else BuildRequires: cmake >= 2.8.7 -%if 0%{?epel} -%global llvm llvm3.9 -%endif -%if 0%{?fedora} >= 28 +%if 0%{?epel} || 0%{?fedora} >= 28 %global llvm llvm5.0 %endif %if %defined llvm From c580c4657801462b832d61a63146f4914643b31f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 26 Mar 2018 13:55:33 -0700 Subject: [PATCH 28/59] beta test --- ...ling-rustfmt-without-config.extended.patch | 27 ++ ...ack-probe-tests-with-system-LLVM-5.0.patch | 67 ---- 0001-Fix-Wcatch-value-from-GCC-8.patch | 57 --- ...run-pass-sse2-when-using-system-LLVM.patch | 27 -- ...-DW_OP_deref-to-indirect-args-itself.patch | 53 --- ...date-DW_OP_plus-to-DW_OP_plus_uconst.patch | 67 ---- ...-to-identify-SIGSEGV-in-stack-guards.patch | 341 ------------------ rust-pr46592-bootstrap-libdir.patch | 159 -------- rust-pr48362-libdir-relative.patch | 64 ---- rust.spec | 97 ++--- 10 files changed, 76 insertions(+), 883 deletions(-) create mode 100644 0001-Allow-installing-rustfmt-without-config.extended.patch delete mode 100644 0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch delete mode 100644 0001-Fix-Wcatch-value-from-GCC-8.patch delete mode 100644 0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch delete mode 100644 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch delete mode 100644 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch delete mode 100644 0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch delete mode 100644 rust-pr46592-bootstrap-libdir.patch delete mode 100644 rust-pr48362-libdir-relative.patch diff --git a/0001-Allow-installing-rustfmt-without-config.extended.patch b/0001-Allow-installing-rustfmt-without-config.extended.patch new file mode 100644 index 0000000..531761f --- /dev/null +++ b/0001-Allow-installing-rustfmt-without-config.extended.patch @@ -0,0 +1,27 @@ +From 86f7d8939d19d42e21d4e794e648f0aef14eeec9 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 22 Mar 2018 18:31:32 -0700 +Subject: [PATCH] Allow installing rustfmt without config.extended + +This assertion was preventing `./x.py install rustfmt` if attempted +without an "extended" build configuration, but it actually builds and +installs just fine. +--- + src/bootstrap/dist.rs | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index eca06eac7f30..142296b20958 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -1186,7 +1186,6 @@ impl Step for Rustfmt { + let build = builder.build; + let stage = self.stage; + let target = self.target; +- assert!(build.config.extended); + + println!("Dist Rustfmt stage{} ({})", stage, target); + let src = build.src.join("src/tools/rustfmt"); +-- +2.14.3 + diff --git a/0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch b/0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch deleted file mode 100644 index b3626cc..0000000 --- a/0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 8a1f3d066d9c6f97a55958f8d638ae98957e8962 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 30 Jan 2018 16:47:30 -0800 -Subject: [PATCH 1/2] Enable stack-probe tests with system LLVM >= 5.0 - ---- - src/test/codegen/stack-probes.rs | 2 +- - src/test/run-pass/stack-probes-lto.rs | 2 +- - src/test/run-pass/stack-probes.rs | 2 +- - src/tools/compiletest/src/header.rs | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs -index 5b26dade9aff..4a489f1edb3b 100644 ---- a/src/test/codegen/stack-probes.rs -+++ b/src/test/codegen/stack-probes.rs -@@ -15,7 +15,7 @@ - // ignore-wasm - // ignore-emscripten - // ignore-windows --// no-system-llvm -+// min-system-llvm-version 5.0 - // compile-flags: -C no-prepopulate-passes - - #![crate_type = "lib"] -diff --git a/src/test/run-pass/stack-probes-lto.rs b/src/test/run-pass/stack-probes-lto.rs -index 78a1019578e3..33d4c63582e8 100644 ---- a/src/test/run-pass/stack-probes-lto.rs -+++ b/src/test/run-pass/stack-probes-lto.rs -@@ -14,7 +14,7 @@ - // ignore-emscripten no processes - // ignore-musl FIXME #31506 - // ignore-pretty --// no-system-llvm -+// min-system-llvm-version 5.0 - // compile-flags: -C lto - // no-prefer-dynamic - -diff --git a/src/test/run-pass/stack-probes.rs b/src/test/run-pass/stack-probes.rs -index bb9471e1b48b..6fbb85dda15a 100644 ---- a/src/test/run-pass/stack-probes.rs -+++ b/src/test/run-pass/stack-probes.rs -@@ -13,7 +13,7 @@ - // ignore-wasm - // ignore-emscripten no processes - // ignore-musl FIXME #31506 --// no-system-llvm -+// min-system-llvm-version 5.0 - - use std::mem; - use std::process::Command; -diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs -index 1f736e33c8b2..6908f3b5cf28 100644 ---- a/src/tools/compiletest/src/header.rs -+++ b/src/tools/compiletest/src/header.rs -@@ -163,7 +163,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[..] < min_version - } else { - false - } --- -2.14.3 - diff --git a/0001-Fix-Wcatch-value-from-GCC-8.patch b/0001-Fix-Wcatch-value-from-GCC-8.patch deleted file mode 100644 index 49d037b..0000000 --- a/0001-Fix-Wcatch-value-from-GCC-8.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 327c3d06258576cc9d9f2e5c0861abc72ebd10ef Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 2 Feb 2018 16:23:04 -0800 -Subject: [PATCH] Fix -Wcatch-value from GCC 8 - -These instances may simply be caught by reference instead. ---- - src/tools/asm2wasm.cpp | 2 +- - src/tools/s2wasm.cpp | 2 +- - src/wasm/wasm-s-parser.cpp | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/tools/asm2wasm.cpp b/src/tools/asm2wasm.cpp -index 75a2c4d15e2e..6d14067d240f 100644 ---- a/src/tools/asm2wasm.cpp -+++ b/src/tools/asm2wasm.cpp -@@ -87,7 +87,7 @@ int main(int argc, const char *argv[]) { - [&trapMode](Options *o, const std::string &argument) { - try { - trapMode = trapModeFromString(argument); -- } catch (std::invalid_argument e) { -+ } catch (std::invalid_argument &e) { - std::cerr << "Error: " << e.what() << "\n"; - exit(EXIT_FAILURE); - } -diff --git a/src/tools/s2wasm.cpp b/src/tools/s2wasm.cpp -index 32af57dba5bf..c5e1d52b8d96 100644 ---- a/src/tools/s2wasm.cpp -+++ b/src/tools/s2wasm.cpp -@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { - [&trapMode](Options *o, const std::string &argument) { - try { - trapMode = trapModeFromString(argument); -- } catch (std::invalid_argument e) { -+ } catch (std::invalid_argument &e) { - std::cerr << "Error: " << e.what() << "\n"; - exit(EXIT_FAILURE); - } -diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp -index 0de3edf3f6b4..78a150f8146c 100644 ---- a/src/wasm/wasm-s-parser.cpp -+++ b/src/wasm/wasm-s-parser.cpp -@@ -1408,9 +1408,9 @@ Name SExpressionWasmBuilder::getLabel(Element& s) { - uint64_t offset; - try { - offset = std::stoll(s.c_str(), nullptr, 0); -- } catch (std::invalid_argument) { -+ } catch (std::invalid_argument&) { - throw ParseException("invalid break offset"); -- } catch (std::out_of_range) { -+ } catch (std::out_of_range&) { - throw ParseException("out of range break offset"); - } - if (offset > nameMapper.labelStack.size()) throw ParseException("invalid label", s.line, s.col); --- -2.14.3 - diff --git a/0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch b/0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch deleted file mode 100644 index bf8eedd..0000000 --- a/0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch +++ /dev/null @@ -1,27 +0,0 @@ -From ebca82f1fc8103830727bda970468ca8eae55d82 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 30 Jan 2018 10:18:54 -0800 -Subject: [PATCH] Ignore run-pass/sse2 when using system LLVM - -This is a test of `target_feature`, which needs a rust-specific patch to -LLVM to add `MCSubtargetInfo::getFeatureTable()`. ---- - src/test/run-pass/sse2.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/test/run-pass/sse2.rs b/src/test/run-pass/sse2.rs -index c27f83011cb1..858a53cb3836 100644 ---- a/src/test/run-pass/sse2.rs -+++ b/src/test/run-pass/sse2.rs -@@ -7,7 +7,7 @@ - // , at your - // option. This file may not be copied, modified, or distributed - // except according to those terms. --// min-llvm-version 4.0 -+// no-system-llvm -- needs MCSubtargetInfo::getFeatureTable() - - #![feature(cfg_target_feature)] - --- -2.14.3 - diff --git a/0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch b/0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch deleted file mode 100644 index 3e8a4be..0000000 --- a/0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 7eb7d45c0b0a9dc0454c5f3a3c5e911c7900bbea Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 23 Jan 2018 13:53:01 -0800 -Subject: [PATCH] Let LLVM 5 add DW_OP_deref to indirect args itself - -We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, -but starting with [D31439] in LLVM 5, it appears that LLVM will always -handle this itself. When we were still adding this manually, the -resulting `.debug_loc` had too many derefs, and this failed test -`debuginfo/by-value-self-argument-in-trait-impl.rs`. - -[D31439]: https://reviews.llvm.org/D31439 - -Fixes #47611. -cc @alexcrichton -r? @michaelwoerister ---- - src/librustc_trans/mir/mod.rs | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs -index b367eb6548d0..da01592d9118 100644 ---- a/src/librustc_trans/mir/mod.rs -+++ b/src/librustc_trans/mir/mod.rs -@@ -487,16 +487,18 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, - // The Rust ABI passes indirect variables using a pointer and a manual copy, so we - // need to insert a deref here, but the C ABI uses a pointer and a copy using the - // byval attribute, for which LLVM does the deref itself, so we must not add it. -+ // Starting with D31439 in LLVM 5, it *always* does the deref itself. - let mut variable_access = VariableAccess::DirectVariable { - alloca: place.llval - }; -- -- if let PassMode::Indirect(ref attrs) = arg.mode { -- if !attrs.contains(ArgAttribute::ByVal) { -- variable_access = VariableAccess::IndirectVariable { -- alloca: place.llval, -- address_operations: &deref_op, -- }; -+ if unsafe { llvm::LLVMRustVersionMajor() < 5 } { -+ if let PassMode::Indirect(ref attrs) = arg.mode { -+ if !attrs.contains(ArgAttribute::ByVal) { -+ variable_access = VariableAccess::IndirectVariable { -+ alloca: place.llval, -+ address_operations: &deref_op, -+ }; -+ } - } - } - --- -2.14.3 - diff --git a/0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch b/0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch deleted file mode 100644 index f975051..0000000 --- a/0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch +++ /dev/null @@ -1,67 +0,0 @@ -From e2f6b280ea13e48bff86254549988e61eee37139 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 19 Jan 2018 21:43:53 -0800 -Subject: [PATCH] Update DW_OP_plus to DW_OP_plus_uconst - -LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`. In the -DWARF standard, this adds two items on the expressions stack. LLVM's -behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant -that follows the op. The patch series starting with [D33892] switched -to the standard DWARF interpretation, so we need to follow. - -[D33892]: https://reviews.llvm.org/D33892 ---- - src/librustc_llvm/ffi.rs | 2 +- - src/librustc_trans/mir/mod.rs | 2 +- - src/rustllvm/RustWrapper.cpp | 9 ++++++++- - 3 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs -index b97e37f4c8fb..f51e51a88b10 100644 ---- a/src/librustc_llvm/ffi.rs -+++ b/src/librustc_llvm/ffi.rs -@@ -1546,7 +1546,7 @@ extern "C" { - InlinedAt: MetadataRef) - -> ValueRef; - pub fn LLVMRustDIBuilderCreateOpDeref() -> i64; -- pub fn LLVMRustDIBuilderCreateOpPlus() -> i64; -+ pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64; - - pub fn LLVMRustWriteTypeToString(Type: TypeRef, s: RustStringRef); - pub fn LLVMRustWriteValueToString(value_ref: ValueRef, s: RustStringRef); -diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs -index 3064e2f7c7af..b367eb6548d0 100644 ---- a/src/librustc_trans/mir/mod.rs -+++ b/src/librustc_trans/mir/mod.rs -@@ -547,7 +547,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, - - let ops = unsafe { - [llvm::LLVMRustDIBuilderCreateOpDeref(), -- llvm::LLVMRustDIBuilderCreateOpPlus(), -+ llvm::LLVMRustDIBuilderCreateOpPlusUconst(), - byte_offset_of_var_in_env as i64, - llvm::LLVMRustDIBuilderCreateOpDeref()] - }; -diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp -index 95130d596e16..0fe533d447bc 100644 ---- a/src/rustllvm/RustWrapper.cpp -+++ b/src/rustllvm/RustWrapper.cpp -@@ -866,7 +866,14 @@ extern "C" int64_t LLVMRustDIBuilderCreateOpDeref() { - return dwarf::DW_OP_deref; - } - --extern "C" int64_t LLVMRustDIBuilderCreateOpPlus() { return dwarf::DW_OP_plus; } -+extern "C" int64_t LLVMRustDIBuilderCreateOpPlusUconst() { -+#if LLVM_VERSION_GE(5, 0) -+ return dwarf::DW_OP_plus_uconst; -+#else -+ // older LLVM used `plus` to behave like `plus_uconst`. -+ return dwarf::DW_OP_plus; -+#endif -+} - - extern "C" void LLVMRustWriteTypeToString(LLVMTypeRef Ty, RustStringRef Str) { - RawRustStringOstream OS(Str); --- -2.14.3 - diff --git a/0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch b/0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch deleted file mode 100644 index 6003804..0000000 --- a/0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch +++ /dev/null @@ -1,341 +0,0 @@ -From 36fcfd117373283de7c052cf361a705d611d47fa Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Wed, 31 Jan 2018 11:41:29 -0800 -Subject: [PATCH 2/2] Use a range to identify SIGSEGV in stack guards -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Previously, the `guard::init()` and `guard::current()` functions were -returning a `usize` address representing the top of the stack guard, -respectively for the main thread and for spawned threads. The `SIGSEGV` -handler on `unix` targets checked if a fault was within one page below -that address, if so reporting it as a stack overflow. - -Now `unix` targets report a `Range` representing the guard -memory, so it can cover arbitrary guard sizes. Non-`unix` targets which -always return `None` for guards now do so with `Option`, so they -don't pay any overhead. - -For `linux-gnu` in particular, the previous guard upper-bound was -`stackaddr + guardsize`, as the protected memory was *inside* the stack. -This was a glibc bug, and starting from 2.27 they are moving the guard -*past* the end of the stack. However, there's no simple way for us to -know where the guard page actually lies, so now we declare it as the -whole range of `stackaddr ± guardsize`, and any fault therein will be -called a stack overflow. This fixes #47863. ---- - src/libstd/sys/redox/thread.rs | 5 +- - src/libstd/sys/unix/stack_overflow.rs | 9 +-- - src/libstd/sys/unix/thread.rs | 115 +++++++++++++++++++++------------- - src/libstd/sys/wasm/thread.rs | 5 +- - src/libstd/sys/windows/thread.rs | 5 +- - src/libstd/sys_common/thread_info.rs | 9 +-- - 6 files changed, 86 insertions(+), 62 deletions(-) - -diff --git a/src/libstd/sys/redox/thread.rs b/src/libstd/sys/redox/thread.rs -index c4aad8d86f8b..c4719a94c7e9 100644 ---- a/src/libstd/sys/redox/thread.rs -+++ b/src/libstd/sys/redox/thread.rs -@@ -88,6 +88,7 @@ impl Thread { - } - - pub mod guard { -- pub unsafe fn current() -> Option { None } -- pub unsafe fn init() -> Option { None } -+ pub type Guard = !; -+ pub unsafe fn current() -> Option { None } -+ pub unsafe fn init() -> Option { None } - } -diff --git a/src/libstd/sys/unix/stack_overflow.rs b/src/libstd/sys/unix/stack_overflow.rs -index 51adbc24ae04..40453f9b8a15 100644 ---- a/src/libstd/sys/unix/stack_overflow.rs -+++ b/src/libstd/sys/unix/stack_overflow.rs -@@ -57,9 +57,6 @@ mod imp { - use sys_common::thread_info; - - -- // This is initialized in init() and only read from after -- static mut PAGE_SIZE: usize = 0; -- - #[cfg(any(target_os = "linux", target_os = "android"))] - unsafe fn siginfo_si_addr(info: *mut libc::siginfo_t) -> usize { - #[repr(C)] -@@ -102,12 +99,12 @@ mod imp { - _data: *mut libc::c_void) { - use sys_common::util::report_overflow; - -- let guard = thread_info::stack_guard().unwrap_or(0); -+ let guard = thread_info::stack_guard().unwrap_or(0..0); - let addr = siginfo_si_addr(info); - - // If the faulting address is within the guard page, then we print a - // message saying so and abort. -- if guard != 0 && guard - PAGE_SIZE <= addr && addr < guard { -+ if guard.start <= addr && addr < guard.end { - report_overflow(); - rtabort!("stack overflow"); - } else { -@@ -123,8 +120,6 @@ mod imp { - static mut MAIN_ALTSTACK: *mut libc::c_void = ptr::null_mut(); - - pub unsafe fn init() { -- PAGE_SIZE = ::sys::os::page_size(); -- - let mut action: sigaction = mem::zeroed(); - action.sa_flags = SA_SIGINFO | SA_ONSTACK; - action.sa_sigaction = signal_handler as sighandler_t; -diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs -index cb249af42540..72cdb9440b8e 100644 ---- a/src/libstd/sys/unix/thread.rs -+++ b/src/libstd/sys/unix/thread.rs -@@ -205,8 +205,10 @@ impl Drop for Thread { - not(target_os = "solaris")))] - #[cfg_attr(test, allow(dead_code))] - pub mod guard { -- pub unsafe fn current() -> Option { None } -- pub unsafe fn init() -> Option { None } -+ use ops::Range; -+ pub type Guard = Range; -+ pub unsafe fn current() -> Option { None } -+ pub unsafe fn init() -> Option { None } - } - - -@@ -222,14 +224,43 @@ pub mod guard { - use libc; - use libc::mmap; - use libc::{PROT_NONE, MAP_PRIVATE, MAP_ANON, MAP_FAILED, MAP_FIXED}; -+ use ops::Range; - use sys::os; - -- #[cfg(any(target_os = "macos", -- target_os = "bitrig", -- target_os = "openbsd", -- target_os = "solaris"))] -+ // This is initialized in init() and only read from after -+ static mut PAGE_SIZE: usize = 0; -+ -+ pub type Guard = Range; -+ -+ #[cfg(target_os = "solaris")] -+ unsafe fn get_stack_start() -> Option<*mut libc::c_void> { -+ let mut current_stack: libc::stack_t = ::mem::zeroed(); -+ assert_eq!(libc::stack_getbounds(&mut current_stack), 0); -+ Some(current_stack.ss_sp) -+ } -+ -+ #[cfg(target_os = "macos")] - unsafe fn get_stack_start() -> Option<*mut libc::c_void> { -- current().map(|s| s as *mut libc::c_void) -+ let stackaddr = libc::pthread_get_stackaddr_np(libc::pthread_self()) as usize - -+ libc::pthread_get_stacksize_np(libc::pthread_self()); -+ Some(stackaddr as *mut libc::c_void) -+ } -+ -+ #[cfg(any(target_os = "openbsd", target_os = "bitrig"))] -+ unsafe fn get_stack_start() -> Option<*mut libc::c_void> { -+ let mut current_stack: libc::stack_t = ::mem::zeroed(); -+ assert_eq!(libc::pthread_stackseg_np(libc::pthread_self(), -+ &mut current_stack), 0); -+ -+ let extra = if cfg!(target_os = "bitrig") {3} else {1} * PAGE_SIZE; -+ let stackaddr = if libc::pthread_main_np() == 1 { -+ // main thread -+ current_stack.ss_sp as usize - current_stack.ss_size + extra -+ } else { -+ // new thread -+ current_stack.ss_sp as usize - current_stack.ss_size -+ }; -+ Some(stackaddr as *mut libc::c_void) - } - - #[cfg(any(target_os = "android", target_os = "freebsd", -@@ -253,8 +284,9 @@ pub mod guard { - ret - } - -- pub unsafe fn init() -> Option { -- let psize = os::page_size(); -+ pub unsafe fn init() -> Option { -+ PAGE_SIZE = os::page_size(); -+ - let mut stackaddr = get_stack_start()?; - - // Ensure stackaddr is page aligned! A parent process might -@@ -263,9 +295,9 @@ pub mod guard { - // stackaddr < stackaddr + stacksize, so if stackaddr is not - // page-aligned, calculate the fix such that stackaddr < - // new_page_aligned_stackaddr < stackaddr + stacksize -- let remainder = (stackaddr as usize) % psize; -+ let remainder = (stackaddr as usize) % PAGE_SIZE; - if remainder != 0 { -- stackaddr = ((stackaddr as usize) + psize - remainder) -+ stackaddr = ((stackaddr as usize) + PAGE_SIZE - remainder) - as *mut libc::c_void; - } - -@@ -280,60 +312,42 @@ pub mod guard { - // Instead, we'll just note where we expect rlimit to start - // faulting, so our handler can report "stack overflow", and - // trust that the kernel's own stack guard will work. -- Some(stackaddr as usize) -+ let stackaddr = stackaddr as usize; -+ Some(stackaddr - PAGE_SIZE..stackaddr) - } else { - // Reallocate the last page of the stack. - // This ensures SIGBUS will be raised on - // stack overflow. -- let result = mmap(stackaddr, psize, PROT_NONE, -+ let result = mmap(stackaddr, PAGE_SIZE, PROT_NONE, - MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0); - - if result != stackaddr || result == MAP_FAILED { - panic!("failed to allocate a guard page"); - } - -+ let guardaddr = stackaddr as usize; - let offset = if cfg!(target_os = "freebsd") { - 2 - } else { - 1 - }; - -- Some(stackaddr as usize + offset * psize) -+ Some(guardaddr..guardaddr + offset * PAGE_SIZE) - } - } - -- #[cfg(target_os = "solaris")] -- pub unsafe fn current() -> Option { -- let mut current_stack: libc::stack_t = ::mem::zeroed(); -- assert_eq!(libc::stack_getbounds(&mut current_stack), 0); -- Some(current_stack.ss_sp as usize) -- } -- -- #[cfg(target_os = "macos")] -- pub unsafe fn current() -> Option { -- Some((libc::pthread_get_stackaddr_np(libc::pthread_self()) as usize - -- libc::pthread_get_stacksize_np(libc::pthread_self()))) -- } -- -- #[cfg(any(target_os = "openbsd", target_os = "bitrig"))] -- pub unsafe fn current() -> Option { -- let mut current_stack: libc::stack_t = ::mem::zeroed(); -- assert_eq!(libc::pthread_stackseg_np(libc::pthread_self(), -- &mut current_stack), 0); -- -- let extra = if cfg!(target_os = "bitrig") {3} else {1} * os::page_size(); -- Some(if libc::pthread_main_np() == 1 { -- // main thread -- current_stack.ss_sp as usize - current_stack.ss_size + extra -- } else { -- // new thread -- current_stack.ss_sp as usize - current_stack.ss_size -- }) -+ #[cfg(any(target_os = "macos", -+ target_os = "bitrig", -+ target_os = "openbsd", -+ target_os = "solaris"))] -+ pub unsafe fn current() -> Option { -+ let stackaddr = get_stack_start()? as usize; -+ Some(stackaddr - PAGE_SIZE..stackaddr) - } - - #[cfg(any(target_os = "android", target_os = "freebsd", - target_os = "linux", target_os = "netbsd", target_os = "l4re"))] -- pub unsafe fn current() -> Option { -+ pub unsafe fn current() -> Option { - let mut ret = None; - let mut attr: libc::pthread_attr_t = ::mem::zeroed(); - assert_eq!(libc::pthread_attr_init(&mut attr), 0); -@@ -352,12 +366,23 @@ pub mod guard { - assert_eq!(libc::pthread_attr_getstack(&attr, &mut stackaddr, - &mut size), 0); - -+ let stackaddr = stackaddr as usize; - ret = if cfg!(target_os = "freebsd") { -- Some(stackaddr as usize - guardsize) -+ // FIXME does freebsd really fault *below* the guard addr? -+ let guardaddr = stackaddr - guardsize; -+ Some(guardaddr - PAGE_SIZE..guardaddr) - } else if cfg!(target_os = "netbsd") { -- Some(stackaddr as usize) -+ Some(stackaddr - guardsize..stackaddr) -+ } else if cfg!(all(target_os = "linux", target_env = "gnu")) { -+ // glibc used to include the guard area within the stack, as noted in the BUGS -+ // section of `man pthread_attr_getguardsize`. This has been corrected starting -+ // with glibc 2.27, and in some distro backports, so the guard is now placed at the -+ // end (below) the stack. There's no easy way for us to know which we have at -+ // runtime, so we'll just match any fault in the range right above or below the -+ // stack base to call that fault a stack overflow. -+ Some(stackaddr - guardsize..stackaddr + guardsize) - } else { -- Some(stackaddr as usize + guardsize) -+ Some(stackaddr..stackaddr + guardsize) - }; - } - assert_eq!(libc::pthread_attr_destroy(&mut attr), 0); -diff --git a/src/libstd/sys/wasm/thread.rs b/src/libstd/sys/wasm/thread.rs -index 13980e0cc19d..6a066509b492 100644 ---- a/src/libstd/sys/wasm/thread.rs -+++ b/src/libstd/sys/wasm/thread.rs -@@ -43,6 +43,7 @@ impl Thread { - } - - pub mod guard { -- pub unsafe fn current() -> Option { None } -- pub unsafe fn init() -> Option { None } -+ pub type Guard = !; -+ pub unsafe fn current() -> Option { None } -+ pub unsafe fn init() -> Option { None } - } -diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs -index 74786d092855..43abfbb1f645 100644 ---- a/src/libstd/sys/windows/thread.rs -+++ b/src/libstd/sys/windows/thread.rs -@@ -93,6 +93,7 @@ impl Thread { - - #[cfg_attr(test, allow(dead_code))] - pub mod guard { -- pub unsafe fn current() -> Option { None } -- pub unsafe fn init() -> Option { None } -+ pub type Guard = !; -+ pub unsafe fn current() -> Option { None } -+ pub unsafe fn init() -> Option { None } - } -diff --git a/src/libstd/sys_common/thread_info.rs b/src/libstd/sys_common/thread_info.rs -index 7970042b1d67..6a2b6742367a 100644 ---- a/src/libstd/sys_common/thread_info.rs -+++ b/src/libstd/sys_common/thread_info.rs -@@ -11,10 +11,11 @@ - #![allow(dead_code)] // stack_guard isn't used right now on all platforms - - use cell::RefCell; -+use sys::thread::guard::Guard; - use thread::Thread; - - struct ThreadInfo { -- stack_guard: Option, -+ stack_guard: Option, - thread: Thread, - } - -@@ -38,11 +39,11 @@ pub fn current_thread() -> Option { - ThreadInfo::with(|info| info.thread.clone()) - } - --pub fn stack_guard() -> Option { -- ThreadInfo::with(|info| info.stack_guard).and_then(|o| o) -+pub fn stack_guard() -> Option { -+ ThreadInfo::with(|info| info.stack_guard.clone()).and_then(|o| o) - } - --pub fn set(stack_guard: Option, thread: Thread) { -+pub fn set(stack_guard: Option, thread: Thread) { - THREAD_INFO.with(|c| assert!(c.borrow().is_none())); - THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{ - stack_guard, --- -2.14.3 - diff --git a/rust-pr46592-bootstrap-libdir.patch b/rust-pr46592-bootstrap-libdir.patch deleted file mode 100644 index b21fcfb..0000000 --- a/rust-pr46592-bootstrap-libdir.patch +++ /dev/null @@ -1,159 +0,0 @@ -commit 6cf081c8c54e92702f350fa30d77561540324401 (from 6eff103aa1f93cbc07b1e5684e695635993c9752) -Merge: 6eff103aa1f9 472f4e1cc8c3 -Author: bors -Date: Sat Jan 13 05:02:04 2018 +0000 - - Auto merge of #46592 - o01eg:fix-45345, r=alexcrichton - - Fix 45345 - - There is a fix for https://github.com/rust-lang/rust/issues/45345 - - It re-introduces `CFG_LIBDIR_RELATIVE` which was broken when migration from `configure` script to `x.py`. - - Other commits fix errors which happen after rustbuild cleanups. - -diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs -index 62037590853c..389b504c64cd 100644 ---- a/src/bootstrap/bin/rustdoc.rs -+++ b/src/bootstrap/bin/rustdoc.rs -@@ -23,10 +23,17 @@ use std::path::PathBuf; - fn main() { - let args = env::args_os().skip(1).collect::>(); - let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set"); -- let libdir = env::var_os("RUSTC_LIBDIR").expect("RUSTC_LIBDIR was not set"); -+ let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set"); - let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set"); - let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set"); - -+ use std::str::FromStr; -+ -+ let verbose = match env::var("RUSTC_VERBOSE") { -+ Ok(s) => usize::from_str(&s).expect("RUSTC_VERBOSE should be an integer"), -+ Err(_) => 0, -+ }; -+ - let mut dylib_path = bootstrap::util::dylib_path(); - dylib_path.insert(0, PathBuf::from(libdir)); - -@@ -63,6 +70,10 @@ fn main() { - cmd.arg("--deny-render-differences"); - } - -+ if verbose > 1 { -+ eprintln!("rustdoc command: {:?}", cmd); -+ } -+ - std::process::exit(match cmd.status() { - Ok(s) => s.code().unwrap_or(1), - Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e), -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index ce30d1f4cec4..a660b5cf852a 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -357,8 +357,8 @@ impl<'a> Builder<'a> { - - fn run(self, builder: &Builder) -> Interned { - let compiler = self.compiler; -- let lib = if compiler.stage >= 2 && builder.build.config.libdir_relative.is_some() { -- builder.build.config.libdir_relative.clone().unwrap() -+ let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() { -+ builder.build.config.libdir.clone().unwrap() - } else { - PathBuf::from("lib") - }; -@@ -416,7 +416,7 @@ impl<'a> Builder<'a> { - let compiler = self.compiler(self.top_stage, host); - cmd.env("RUSTC_STAGE", compiler.stage.to_string()) - .env("RUSTC_SYSROOT", self.sysroot(compiler)) -- .env("RUSTC_LIBDIR", self.sysroot_libdir(compiler, self.build.build)) -+ .env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.build.build)) - .env("CFG_RELEASE_CHANNEL", &self.build.config.channel) - .env("RUSTDOC_REAL", self.rustdoc(host)) - .env("RUSTDOC_CRATE_VERSION", self.build.rust_version()) -@@ -496,6 +496,9 @@ impl<'a> Builder<'a> { - if let Some(target_linker) = self.build.linker(target) { - cargo.env("RUSTC_TARGET_LINKER", target_linker); - } -+ if cmd != "build" { -+ cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build))); -+ } - - if mode != Mode::Tool { - // Tools don't get debuginfo right now, e.g. cargo and rls don't -diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs -index cc9be3cec347..ed110762cb3c 100644 ---- a/src/bootstrap/check.rs -+++ b/src/bootstrap/check.rs -@@ -1166,7 +1166,7 @@ impl Step for Crate { - } - Mode::Librustc => { - builder.ensure(compile::Rustc { compiler, target }); -- compile::rustc_cargo(build, &compiler, target, &mut cargo); -+ compile::rustc_cargo(build, target, &mut cargo); - ("librustc", "rustc-main") - } - _ => panic!("can only test libraries"), -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index c8e500a4f68c..c6adfc7ffae4 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -485,7 +485,7 @@ impl Step for Rustc { - build.clear_if_dirty(&stage_out, &libtest_stamp(build, compiler, target)); - - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build"); -- rustc_cargo(build, &compiler, target, &mut cargo); -+ rustc_cargo(build, target, &mut cargo); - run_cargo(build, - &mut cargo, - &librustc_stamp(build, compiler, target)); -@@ -500,7 +500,6 @@ impl Step for Rustc { - - /// Same as `std_cargo`, but for libtest - pub fn rustc_cargo(build: &Build, -- compiler: &Compiler, - target: Interned, - cargo: &mut Command) { - cargo.arg("--features").arg(build.rustc_features()) -@@ -514,13 +513,9 @@ pub fn rustc_cargo(build: &Build, - .env("CFG_VERSION", build.rust_version()) - .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default()); - -- if compiler.stage == 0 { -- cargo.env("CFG_LIBDIR_RELATIVE", "lib"); -- } else { -- let libdir_relative = -- build.config.libdir_relative.clone().unwrap_or(PathBuf::from("lib")); -- cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative); -- } -+ let libdir_relative = -+ build.config.libdir.clone().unwrap_or(PathBuf::from("lib")); -+ cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative); - - // If we're not building a compiler with debugging information then remove - // these two env vars which would be set otherwise. -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index f3ffe9a27611..72e75fddc194 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -121,7 +121,6 @@ pub struct Config { - pub docdir: Option, - pub bindir: Option, - pub libdir: Option, -- pub libdir_relative: Option, - pub mandir: Option, - pub codegen_tests: bool, - pub nodejs: Option, -diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs -index 832da24c994d..178d60dd7df7 100644 ---- a/src/bootstrap/doc.rs -+++ b/src/bootstrap/doc.rs -@@ -616,7 +616,7 @@ impl Step for Rustc { - t!(symlink_dir_force(&my_out, &out_dir)); - - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "doc"); -- compile::rustc_cargo(build, &compiler, target, &mut cargo); -+ compile::rustc_cargo(build, target, &mut cargo); - - if build.config.compiler_docs { - // src/rustc/Cargo.toml contains a bin crate called rustc which diff --git a/rust-pr48362-libdir-relative.patch b/rust-pr48362-libdir-relative.patch deleted file mode 100644 index 71714a9..0000000 --- a/rust-pr48362-libdir-relative.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 66a1c9724620..fcb78c479fa2 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -444,10 +444,11 @@ impl<'a> Builder<'a> { - - fn run(self, builder: &Builder) -> Interned { - let compiler = self.compiler; -- let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() { -- builder.build.config.libdir.clone().unwrap() -+ let config = &builder.build.config; -+ let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() { -+ builder.build.config.libdir_relative().unwrap() - } else { -- PathBuf::from("lib") -+ Path::new("lib") - }; - let sysroot = builder.sysroot(self.compiler).join(lib) - .join("rustlib").join(self.target).join("lib"); -diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 2dcc0e0e7cd9..c85b04ddc024 100644 ---- a/src/bootstrap/compile.rs -+++ b/src/bootstrap/compile.rs -@@ -516,8 +516,7 @@ fn rustc_cargo_env(build: &Build, cargo: &mut Command) { - .env("CFG_VERSION", build.rust_version()) - .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default()); - -- let libdir_relative = -- build.config.libdir.clone().unwrap_or(PathBuf::from("lib")); -+ let libdir_relative = build.config.libdir_relative().unwrap_or(Path::new("lib")); - cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative); - - // If we're not building a compiler with debugging information then remove -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index 812ca6d64fb6..3cf8f36df25e 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -17,7 +17,7 @@ use std::collections::{HashMap, HashSet}; - use std::env; - use std::fs::File; - use std::io::prelude::*; --use std::path::PathBuf; -+use std::path::{Path, PathBuf}; - use std::process; - use std::cmp; - -@@ -564,6 +564,17 @@ impl Config { - config - } - -+ /// Try to find the relative path of `libdir`. -+ pub fn libdir_relative(&self) -> Option<&Path> { -+ let libdir = self.libdir.as_ref()?; -+ if libdir.is_relative() { -+ Some(libdir) -+ } else { -+ // Try to make it relative to the prefix. -+ libdir.strip_prefix(self.prefix.as_ref()?).ok() -+ } -+ } -+ - pub fn verbose(&self) -> bool { - self.verbose > 0 - } diff --git a/rust.spec b/rust.spec index d88f080..6c6e101 100644 --- a/rust.spec +++ b/rust.spec @@ -8,20 +8,15 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.23.0 -%global bootstrap_cargo 0.24.0 +%global bootstrap_rust 1.24.0 +%global bootstrap_cargo 0.25.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-01-04 +%global bootstrap_date 2018-02-15 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} -# We generally don't want llvm-static present at all, since llvm-config will -# make us link statically. But we can opt in, e.g. to aid LLVM rebases. -# FIXME: LLVM 3.9 prefers shared linking now! Which is good, but next time we -# *want* static we'll have to force it with "llvm-config --link-static". -# See also https://github.com/rust-lang/rust/issues/36854 -# The new rustbuild accepts `--enable-llvm-link-shared`, else links static. +# Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM @@ -47,8 +42,8 @@ Name: rust -Version: 1.24.1 -Release: 1%{?dist} +Version: 1.25.0 +Release: 0.1.beta.13%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -62,26 +57,8 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/WebAssembly/binaryen/pull/1400 -Patch1: 0001-Fix-Wcatch-value-from-GCC-8.patch - -# https://github.com/rust-lang/rust/pull/47610 -Patch2: 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch - -# https://github.com/rust-lang/rust/pull/47688 -Patch3: 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch - -# https://github.com/rust-lang/rust/pull/47884 -Patch4: 0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch - -# https://github.com/rust-lang/rust/pull/47912 -Patch5: 0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch -Patch6: 0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch - -# fix for https://github.com/rust-lang/rust/issues/47469 -# via https://github.com/rust-lang/rust/pull/46592 -Patch7: rust-pr46592-bootstrap-libdir.patch -Patch8: rust-pr48362-libdir-relative.patch +# https://github.com/rust-lang/rust/pull/49290 +Patch1: 0001-Allow-installing-rustfmt-without-config.extended.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -126,8 +103,12 @@ end} Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else BuildRequires: cargo >= %{bootstrap_cargo} +%if 0%{?fedora} >= 27 +BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) +%else BuildRequires: %{name} >= %{bootstrap_rust} BuildConflicts: %{name} > %{version} +%endif %global local_rust_root %{_prefix} %endif @@ -147,10 +128,10 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 4.0 +Provides: bundled(llvm) = 6.0 %else BuildRequires: cmake >= 2.8.7 -%if 0%{?epel} || 0%{?fedora} >= 28 +%if 0%{?epel} %global llvm llvm5.0 %endif %if %defined llvm @@ -159,13 +140,10 @@ BuildRequires: cmake >= 2.8.7 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 3.7 +BuildRequires: %{llvm}-devel >= 3.9 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel -%else -# Make sure llvm-config doesn't see it. -BuildConflicts: %{llvm}-static %endif %endif @@ -285,6 +263,20 @@ This package includes HTML documentation for the Rust programming language and its standard library. +%package -n rustfmt-preview +Summary: Tool to find and fix Rust formatting issues +Version: 0.3.8 +Requires: cargo + +# Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9. +# It's expected to stay "preview" until it's released as 1.0. +Obsoletes: rustfmt <= 0.9.0 +Provides: rustfmt = %{version} + +%description -n rustfmt-preview +A tool for formatting Rust code according to style guidelines. + + %package src Summary: Sources for the Rust standard library BuildArch: noarch @@ -306,17 +298,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -pushd src/binaryen -%patch1 -p1 -b .catch-value -popd - -%patch2 -p1 -b .DW_OP_plus_uconst -%patch3 -p1 -b .DW_OP_deref -%patch4 -p1 -b .sse2 -%patch5 -p1 -b .out-of-stack -%patch6 -p1 -b .out-of-stack -%patch7 -p1 -b .bootstrap-libdir -%patch8 -p1 -b .bootstrap-libdir-relative +%patch1 -p1 -b .dist-rustfmt %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -329,6 +311,9 @@ sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure rm -rf src/llvm/ %endif +# We never enable emscripten. +rm -rf src/llvm-emscripten/ + # extract bundled licenses for packaging cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown sed -e '/*\//q' src/libbacktrace/backtrace.h \ @@ -391,6 +376,7 @@ find src/vendor -name .cargo-checksum.json \ --release-channel=%{channel} %{python} ./x.py build +%{python} ./x.py build src/tools/rustfmt %{python} ./x.py doc @@ -400,6 +386,7 @@ find src/vendor -name .cargo-checksum.json \ %{?rustflags:export RUSTFLAGS="%{rustflags}"} DESTDIR=%{buildroot} %{python} ./x.py install +DESTDIR=%{buildroot} %{python} ./x.py install rustfmt DESTDIR=%{buildroot} %{python} ./x.py install src @@ -436,6 +423,7 @@ rm -f %{buildroot}%{_docdir}/%{name}/README.md rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT +rm -f %{buildroot}%{_docdir}/%{name}/*.old # Sanitize the HTML documentation find %{buildroot}%{_docdir}/%{name}/html -empty -delete @@ -454,6 +442,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* # The results are not stable on koji, so mask errors and just log it. %{python} ./x.py test --no-fail-fast || : +%{python} ./x.py test --no-fail-fast src/tools/rustfmt || : %ldconfig_scriptlets @@ -473,6 +462,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so +%{rustlibdir}/%{rust_triple}/codegen-backends/ %files std-static @@ -508,16 +498,27 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{_docdir}/%{name}/html/*.html %{_docdir}/%{name}/html/*.css %{_docdir}/%{name}/html/*.js +%{_docdir}/%{name}/html/*.svg %{_docdir}/%{name}/html/*.woff %license %{_docdir}/%{name}/html/*.txt +%files -n rustfmt-preview +%{_bindir}/rustfmt +%{_bindir}/cargo-fmt +%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md +%license src/tools/rustfmt/LICENSE-{APACHE,MIT} + + %files src %dir %{rustlibdir} %{rustlibdir}/src %changelog +* Mon Mar 26 2018 Josh Stone - 1.25.0-0.1.beta.13 +- beta test + * Thu Mar 01 2018 Josh Stone - 1.24.1-1 - Update to 1.24.1. From 5da6ebf9a5ea89534cddb711bbe0db8755ee5c1e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 4 May 2018 09:58:25 -0700 Subject: [PATCH 29/59] beta test --- ...ling-rustfmt-without-config.extended.patch | 27 ---------- ...ck-probes-tests-on-powerpc-s390x-too.patch | 54 ------------------- pull-49959.patch | 54 +++++++++---------- rust.spec | 33 ++++++------ 4 files changed, 42 insertions(+), 126 deletions(-) delete mode 100644 0001-Allow-installing-rustfmt-without-config.extended.patch delete mode 100644 0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch diff --git a/0001-Allow-installing-rustfmt-without-config.extended.patch b/0001-Allow-installing-rustfmt-without-config.extended.patch deleted file mode 100644 index 531761f..0000000 --- a/0001-Allow-installing-rustfmt-without-config.extended.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 86f7d8939d19d42e21d4e794e648f0aef14eeec9 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 22 Mar 2018 18:31:32 -0700 -Subject: [PATCH] Allow installing rustfmt without config.extended - -This assertion was preventing `./x.py install rustfmt` if attempted -without an "extended" build configuration, but it actually builds and -installs just fine. ---- - src/bootstrap/dist.rs | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index eca06eac7f30..142296b20958 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -1186,7 +1186,6 @@ impl Step for Rustfmt { - let build = builder.build; - let stage = self.stage; - let target = self.target; -- assert!(build.config.extended); - - println!("Dist Rustfmt stage{} ({})", stage, target); - let src = build.src.join("src/tools/rustfmt"); --- -2.14.3 - diff --git a/0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch b/0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch deleted file mode 100644 index c6d83cc..0000000 --- a/0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch +++ /dev/null @@ -1,54 +0,0 @@ -From b404ec4b4880db7f6aea23ebf778869dfd6ecf99 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 29 Mar 2018 10:25:32 -0700 -Subject: [PATCH] Ignore stack-probes tests on powerpc/s390x too - -We only support stack probes on x86 and x86_64. -Other arches are already ignored. ---- - src/test/codegen/stack-probes.rs | 1 + - src/test/run-pass/stack-probes-lto.rs | 2 ++ - src/test/run-pass/stack-probes.rs | 2 ++ - 3 files changed, 5 insertions(+) - -diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs -index af400ff3bcbd..51ebc42a0dd6 100644 ---- a/src/test/codegen/stack-probes.rs -+++ b/src/test/codegen/stack-probes.rs -@@ -11,6 +11,7 @@ - // ignore-arm - // ignore-aarch64 - // ignore-powerpc -+// ignore-s390x - // ignore-aarch64 - // ignore-wasm - // ignore-emscripten -diff --git a/src/test/run-pass/stack-probes-lto.rs b/src/test/run-pass/stack-probes-lto.rs -index e7fa3bc0a75c..d1cb75909c15 100644 ---- a/src/test/run-pass/stack-probes-lto.rs -+++ b/src/test/run-pass/stack-probes-lto.rs -@@ -10,6 +10,8 @@ - - // ignore-arm - // ignore-aarch64 -+// ignore-powerpc -+// ignore-s390x - // ignore-wasm - // ignore-cloudabi no processes - // ignore-emscripten no processes -diff --git a/src/test/run-pass/stack-probes.rs b/src/test/run-pass/stack-probes.rs -index 67b3962ee5fb..78c5782be383 100644 ---- a/src/test/run-pass/stack-probes.rs -+++ b/src/test/run-pass/stack-probes.rs -@@ -10,6 +10,8 @@ - - // ignore-arm - // ignore-aarch64 -+// ignore-powerpc -+// ignore-s390x - // ignore-wasm - // ignore-cloudabi no processes - // ignore-emscripten no processes --- -2.14.3 - diff --git a/pull-49959.patch b/pull-49959.patch index be2ed9f..b281425 100644 --- a/pull-49959.patch +++ b/pull-49959.patch @@ -1,4 +1,4 @@ -From f89f1b496c0c3b96aa8e41bef882131008dac6c3 Mon Sep 17 00:00:00 2001 +From cc2906cb26304301709557a88ac4a3334b88616b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 13 Apr 2018 16:52:54 -0700 Subject: [PATCH 1/3] rustbuild: allow building tools with debuginfo @@ -19,7 +19,7 @@ a concern in regular use. 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md -index 70376c120f..fcd995b703 100644 +index 7a62405f0596..73d4188d6954 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -121,6 +121,7 @@ configuration used in the build process. Some options to note: @@ -31,10 +31,10 @@ index 70376c120f..fcd995b703 100644 - `optimize = false` - Disable optimizations to speed up compilation of stage1 rust, but makes the stage1 compiler x100 slower. diff --git a/config.toml.example b/config.toml.example -index f153562a53..64e2f1b424 100644 +index 68bc7dfe720f..bd18a604a9c8 100644 --- a/config.toml.example +++ b/config.toml.example -@@ -259,6 +259,10 @@ +@@ -262,6 +262,10 @@ # standard library. #debuginfo-only-std = false @@ -46,10 +46,10 @@ index f153562a53..64e2f1b424 100644 #use-jemalloc = true diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index fcb78c479f..584c0cbe75 100644 +index 7ff64af91967..ae19c66d6070 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -603,10 +603,14 @@ impl<'a> Builder<'a> { +@@ -622,10 +622,14 @@ impl<'a> Builder<'a> { cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build))); } @@ -69,10 +69,10 @@ index fcb78c479f..584c0cbe75 100644 cargo.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string()); cargo.env("RUSTC_FORCE_UNSTABLE", "1"); diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index f3810ac869..ac64e6e8e3 100644 +index 239316d45c49..95d138b9fab2 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -88,6 +88,7 @@ pub struct Config { +@@ -94,6 +94,7 @@ pub struct Config { pub rust_debuginfo: bool, pub rust_debuginfo_lines: bool, pub rust_debuginfo_only_std: bool, @@ -80,7 +80,7 @@ index f3810ac869..ac64e6e8e3 100644 pub rust_rpath: bool, pub rustc_parallel_queries: bool, pub rustc_default_linker: Option, -@@ -271,6 +272,7 @@ struct Rust { +@@ -282,6 +283,7 @@ struct Rust { debuginfo: Option, debuginfo_lines: Option, debuginfo_only_std: Option, @@ -88,7 +88,7 @@ index f3810ac869..ac64e6e8e3 100644 experimental_parallel_queries: Option, debug_jemalloc: Option, use_jemalloc: Option, -@@ -425,6 +427,7 @@ impl Config { +@@ -462,6 +464,7 @@ impl Config { let mut llvm_assertions = None; let mut debuginfo_lines = None; let mut debuginfo_only_std = None; @@ -96,7 +96,7 @@ index f3810ac869..ac64e6e8e3 100644 let mut debug = None; let mut debug_jemalloc = None; let mut debuginfo = None; -@@ -462,6 +465,7 @@ impl Config { +@@ -499,6 +502,7 @@ impl Config { debuginfo = rust.debuginfo; debuginfo_lines = rust.debuginfo_lines; debuginfo_only_std = rust.debuginfo_only_std; @@ -104,8 +104,8 @@ index f3810ac869..ac64e6e8e3 100644 optimize = rust.optimize; ignore_git = rust.ignore_git; debug_jemalloc = rust.debug_jemalloc; -@@ -553,6 +557,7 @@ impl Config { - config.rust_thinlto = thinlto.unwrap_or(true); +@@ -582,6 +586,7 @@ impl Config { + }; config.rust_debuginfo_lines = debuginfo_lines.unwrap_or(default); config.rust_debuginfo_only_std = debuginfo_only_std.unwrap_or(default); + config.rust_debuginfo_tools = debuginfo_tools.unwrap_or(default); @@ -113,10 +113,10 @@ index f3810ac869..ac64e6e8e3 100644 let default = debug == Some(true); config.debug_jemalloc = debug_jemalloc.unwrap_or(default); diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py -index 99a3ee4e4c..689dd905fb 100755 +index b06968d313ba..a0123da6d8ff 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py -@@ -78,6 +78,7 @@ def v(*args): +@@ -79,6 +79,7 @@ o("llvm-release-debuginfo", "llvm.release-debuginfo", "build LLVM with debugger o("debuginfo", "rust.debuginfo", "build with debugger metadata") o("debuginfo-lines", "rust.debuginfo-lines", "build with line number debugger metadata") o("debuginfo-only-std", "rust.debuginfo-only-std", "build only libstd with debugging information") @@ -125,10 +125,10 @@ index 99a3ee4e4c..689dd905fb 100755 v("save-toolstates", "rust.save-toolstates", "save build and test status of external tools into this file") -- -2.14.3 +2.17.0 -From f0a43d3a9a4c28ea45d6bed430b1d9d561944e16 Mon Sep 17 00:00:00 2001 +From bc7403d067b3e2a154df1ef088377cb2a75f429c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 13 Apr 2018 21:57:53 -0700 Subject: [PATCH 2/3] Avoid specific claims about debuginfo size @@ -139,10 +139,10 @@ Subject: [PATCH 2/3] Avoid specific claims about debuginfo size 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.toml.example b/config.toml.example -index 64e2f1b424..46be1ecab7 100644 +index bd18a604a9c8..effe00843810 100644 --- a/config.toml.example +++ b/config.toml.example -@@ -260,7 +260,7 @@ +@@ -263,7 +263,7 @@ #debuginfo-only-std = false # Enable debuginfo for the extended tools: cargo, rls, rustfmt @@ -152,10 +152,10 @@ index 64e2f1b424..46be1ecab7 100644 # Whether or not jemalloc is built and enabled diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 584c0cbe75..627a695884 100644 +index ae19c66d6070..6874efa5a4c7 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -605,7 +605,7 @@ impl<'a> Builder<'a> { +@@ -624,7 +624,7 @@ impl<'a> Builder<'a> { if mode == Mode::Tool { // Tools like cargo and rls don't get debuginfo by default right now, but this can be @@ -165,10 +165,10 @@ index 584c0cbe75..627a695884 100644 cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string()); cargo.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string()); -- -2.14.3 +2.17.0 -From 7ddb573a2ea41ad3c35f927b7b90fd545a6ab9da Mon Sep 17 00:00:00 2001 +From 93734e9c46e30acc9a51f19c56511ce8516b6855 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 13 Apr 2018 21:58:21 -0700 Subject: [PATCH 3/3] Make debuginfo-tools always default false @@ -178,11 +178,11 @@ Subject: [PATCH 3/3] Make debuginfo-tools always default false 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index ac64e6e8e3..06443ae6cd 100644 +index 95d138b9fab2..1b4b2c5fb2a5 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -557,7 +557,7 @@ impl Config { - config.rust_thinlto = thinlto.unwrap_or(true); +@@ -586,7 +586,7 @@ impl Config { + }; config.rust_debuginfo_lines = debuginfo_lines.unwrap_or(default); config.rust_debuginfo_only_std = debuginfo_only_std.unwrap_or(default); - config.rust_debuginfo_tools = debuginfo_tools.unwrap_or(default); @@ -191,5 +191,5 @@ index ac64e6e8e3..06443ae6cd 100644 let default = debug == Some(true); config.debug_jemalloc = debug_jemalloc.unwrap_or(default); -- -2.14.3 +2.17.0 diff --git a/rust.spec b/rust.spec index ca24bb2..7c9656e 100644 --- a/rust.spec +++ b/rust.spec @@ -8,10 +8,10 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%global bootstrap_rust 1.24.0 -%global bootstrap_cargo 0.25.0 +%global bootstrap_rust 1.25.0 +%global bootstrap_cargo 0.26.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-02-15 +%global bootstrap_date 2018-03-29 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -47,16 +47,16 @@ %endif # Some sub-packages are versioned independently of the rust compiler and runtime itself. -%global rustc_version 1.25.0 -%global cargo_version 0.26.0 -%global rustfmt_version 0.3.8 -%global rls_version 0.125.1 +%global rustc_version 1.26.0 +%global cargo_version %{rustc_version} +%global rustfmt_version 0.4.1 +%global rls_version 0.126.0 Name: rust Version: %{rustc_version} -Release: 3%{?dist} +Release: 0.1.beta.18%{?dist} Summary: The Rust Programming Language -License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) +License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) URL: https://www.rust-lang.org ExclusiveArch: %{rust_arches} @@ -68,11 +68,9 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/49484 -Patch1: 0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch - +# rustbuild: allow building tools with debuginfo # https://github.com/rust-lang/rust/pull/49959 -Patch2: pull-49959.patch +Patch1: pull-49959.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -172,7 +170,6 @@ BuildRequires: procps-ng BuildRequires: gdb # TODO: work on unbundling these! -Provides: bundled(hoedown) = 3.0.7 Provides: bundled(jquery) = 2.1.4 Provides: bundled(libbacktrace) = 6.1.0 Provides: bundled(miniz) = 1.16~beta+r1 @@ -374,8 +371,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -b .ignore-ibm -%patch2 -p1 +%patch1 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -392,7 +388,6 @@ rm -rf src/llvm/ rm -rf src/llvm-emscripten/ # extract bundled licenses for packaging -cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown sed -e '/*\//q' src/libbacktrace/backtrace.h \ >src/libbacktrace/LICENSE-libbacktrace @@ -558,7 +553,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT %license src/libbacktrace/LICENSE-libbacktrace -%license src/rt/hoedown/LICENSE-hoedown %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc @@ -648,6 +642,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Fri May 04 2018 Josh Stone - -0.1.beta.18 +- beta test + * Mon Apr 16 2018 Dan Callaghan - 1.25.0-3 - Add cargo, rls, and analysis From 8b950ace9c1db36d24b663cbeb046b6637b27788 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 26 Jul 2018 14:33:38 -0700 Subject: [PATCH 30/59] beta test --- ...-built-in-stage0-have-unique-metadat.patch | 40 ----------- ...enamed_and_removed_lints-warning-247.patch | 70 ------------------- rust.spec | 32 +++------ 3 files changed, 11 insertions(+), 131 deletions(-) delete mode 100644 0001-Ensure-libraries-built-in-stage0-have-unique-metadat.patch delete mode 100644 0001-Fix-new-renamed_and_removed_lints-warning-247.patch diff --git a/0001-Ensure-libraries-built-in-stage0-have-unique-metadat.patch b/0001-Ensure-libraries-built-in-stage0-have-unique-metadat.patch deleted file mode 100644 index 38a4402..0000000 --- a/0001-Ensure-libraries-built-in-stage0-have-unique-metadat.patch +++ /dev/null @@ -1,40 +0,0 @@ -From e8e5eb58c0d6890f73ea01354e18f51b1a6697f8 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 15 May 2018 17:48:02 -0700 -Subject: [PATCH] Ensure libraries built in stage0 have unique metadata - -Issue #50786 shows a case with local rebuild where the libraries built -by stage0 had the same suffix as stage0's own, and were accidentally -loaded by that stage0 rustc when compiling `librustc_trans`. - -Now we set `__CARGO_DEFAULT_LIB_METADATA` to "bootstrap" during stage0, -rather than the release channel like usual, so the library suffix will -always be completely distinct from the stage0 compiler. ---- - src/bootstrap/builder.rs | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 17f19222e6ea..e5824010ef2c 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -592,7 +592,15 @@ impl<'a> Builder<'a> { - - // FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005 - // Force cargo to output binaries with disambiguating hashes in the name -- cargo.env("__CARGO_DEFAULT_LIB_METADATA", &self.config.channel); -+ let metadata = if compiler.stage == 0 { -+ // Treat stage0 like special channel, whether it's a normal prior- -+ // release rustc or a local rebuild with the same version, so we -+ // never mix these libraries by accident. -+ "bootstrap" -+ } else { -+ &self.config.channel -+ }; -+ cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); - - let stage; - if compiler.stage == 0 && self.local_rebuild { --- -2.17.0 - diff --git a/0001-Fix-new-renamed_and_removed_lints-warning-247.patch b/0001-Fix-new-renamed_and_removed_lints-warning-247.patch deleted file mode 100644 index 3270fb0..0000000 --- a/0001-Fix-new-renamed_and_removed_lints-warning-247.patch +++ /dev/null @@ -1,70 +0,0 @@ -From ab80da4ea9ea88cdd802f80955e7382bd9368247 Mon Sep 17 00:00:00 2001 -From: Benjamin Gill -Date: Sat, 16 Jun 2018 12:59:44 +0100 -Subject: [PATCH] Fix new renamed_and_removed_lints warning (#247) - -I've verified that this now produces no warnings with Rust 1.26.1 and -1.28.0-nightly (c3b09c968 2018-05-27) ---- - src/error_chain.rs | 4 ++-- - src/impl_error_chain_kind.rs | 4 ++-- - src/lib.rs | 1 - - 3 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/src/error_chain.rs b/src/error_chain.rs -index cbd42cd67eaf..0926c8889278 100644 ---- a/src/error_chain.rs -+++ b/src/error_chain.rs -@@ -173,7 +173,7 @@ macro_rules! impl_error_chain_processed { - self.0.description() - } - -- #[allow(unknown_lints, unused_doc_comment)] -+ #[allow(unknown_lints, renamed_and_removed_lints, unused_doc_comment, unused_doc_comments)] - fn cause(&self) -> Option<&::std::error::Error> { - match self.1.next_error { - Some(ref c) => Some(&**c), -@@ -424,7 +424,7 @@ macro_rules! impl_extract_backtrace { - ($error_name: ident - $error_kind_name: ident - $([$link_error_path: path, $(#[$meta_links: meta])*])*) => { -- #[allow(unknown_lints, unused_doc_comment)] -+ #[allow(unknown_lints, renamed_and_removed_lints, unused_doc_comment, unused_doc_comments)] - fn extract_backtrace(e: &(::std::error::Error + Send + 'static)) - -> Option<::std::sync::Arc<$crate::Backtrace>> { - if let Some(e) = e.downcast_ref::<$error_name>() { -diff --git a/src/impl_error_chain_kind.rs b/src/impl_error_chain_kind.rs -index d6c05c8a882b..d5e266389cd6 100644 ---- a/src/impl_error_chain_kind.rs -+++ b/src/impl_error_chain_kind.rs -@@ -264,7 +264,7 @@ macro_rules! impl_error_chain_kind { - $item:ident: $imode:tt [$(#[$imeta:meta])*] [$( $var:ident: $typ:ty ),*] {$( $funcs:tt )*} - )*} - ) => { -- #[allow(unknown_lints, unused, unused_doc_comment)] -+ #[allow(unknown_lints, unused, renamed_and_removed_lints, unused_doc_comment, unused_doc_comments)] - impl ::std::fmt::Display for $name { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter) - -> ::std::fmt::Result -@@ -316,7 +316,7 @@ macro_rules! impl_error_chain_kind { - } - } - }*/ -- #[allow(unknown_lints, unused, unused_doc_comment)] -+ #[allow(unknown_lints, unused, renamed_and_removed_lints, unused_doc_comment, unused_doc_comments)] - impl $name { - /// A string describing the error kind. - pub fn description(&self) -> &str { -diff --git a/src/lib.rs b/src/lib.rs -index d0881fcef1c1..6421194f8ca8 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -1,5 +1,4 @@ - #![deny(missing_docs)] --#![allow(unknown_lints)] // to be removed when unused_doc_comments lints is merged - #![doc(html_root_url = "https://docs.rs/error-chain/0.11.0")] - - //! A library for consistent and reliable error handling --- -2.17.1 - diff --git a/rust.spec b/rust.spec index 910b6e8..7008c60 100644 --- a/rust.spec +++ b/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.26.0 -%global bootstrap_cargo 1.26.0 +%global bootstrap_rust 1.27.0 +%global bootstrap_cargo 1.27.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-05-10 +%global bootstrap_date 2018-06-21 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -49,14 +49,14 @@ # Some sub-packages are versioned independently of the rust compiler and runtime itself. # Also beware that if any of these are not changed in a version bump, then the release # number should still increase, not be reset to 1! -%global rustc_version 1.27.2 -%global cargo_version 1.27.0 -%global rustfmt_version 0.6.1 -%global rls_version 0.127.0 +%global rustc_version 1.28.0 +%global cargo_version 1.28.0 +%global rustfmt_version 0.8.2 +%global rls_version 0.128.0 Name: rust Version: %{rustc_version} -Release: 4%{?dist} +Release: 0.1.beta.14%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -70,13 +70,6 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/50789/ -Patch1: 0001-Ensure-libraries-built-in-stage0-have-unique-metadat.patch - -# https://github.com/rust-lang/rust/issues/51650 -# https://github.com/rust-lang-nursery/error-chain/pull/247 -Patch2: 0001-Fix-new-renamed_and_removed_lints-warning-247.patch - # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -375,12 +368,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 - -pushd src/vendor/error-chain -%patch2 -p1 -popd - %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure %endif @@ -650,6 +637,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Jul 26 2018 Josh Stone - 1.28.0-0.1.beta.14 +- beta test + * Tue Jul 24 2018 Josh Stone - 1.27.2-4 - Update to 1.27.2. From fe90904f28003c8451dc97be12892939d507a2e2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 16 Aug 2018 16:35:30 -0700 Subject: [PATCH 31/59] beta test Add a clippy-preview subpackage --- ...m-function-attributes-for-__rust_try.patch | 186 ++++++++++++++++++ ...e-target_pointer_width-for-BACKTRACE.patch | 36 ++++ ...vm-Restore-the-closure-env-alloca-ha.patch | 74 +++++++ ...pointer_width-for-BACKTRACE_ELF_SIZE.patch | 37 ++++ ...backtracing-when-the-frames-are-full.patch | 122 ++++++++++++ rust-52760-test_loading_atoi.patch | 62 ------ rust.spec | 108 +++++++--- 7 files changed, 541 insertions(+), 84 deletions(-) create mode 100644 0001-Set-more-llvm-function-attributes-for-__rust_try.patch create mode 100644 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch create mode 100644 0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch create mode 100644 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch create mode 100644 0001-std-stop-backtracing-when-the-frames-are-full.patch delete mode 100644 rust-52760-test_loading_atoi.patch diff --git a/0001-Set-more-llvm-function-attributes-for-__rust_try.patch b/0001-Set-more-llvm-function-attributes-for-__rust_try.patch new file mode 100644 index 0000000..36bb15c --- /dev/null +++ b/0001-Set-more-llvm-function-attributes-for-__rust_try.patch @@ -0,0 +1,186 @@ +From 4b95b1a4fd035a73998dc21b265ce4594e35f8ae Mon Sep 17 00:00:00 2001 +From: Alex Crichton +Date: Thu, 16 Aug 2018 13:19:04 -0700 +Subject: [PATCH] Set more llvm function attributes for __rust_try + +This shim is generated elsewhere in the compiler so this commit adds support to +ensure it goes through similar paths as the rest of the compiler to set llvm +function attributes like target features. + +cc #53372 +--- + src/librustc_codegen_llvm/attributes.rs | 52 +++++++++++++++++++------ + src/librustc_codegen_llvm/base.rs | 21 ---------- + src/librustc_codegen_llvm/callee.rs | 2 +- + src/librustc_codegen_llvm/intrinsic.rs | 2 + + src/librustc_codegen_llvm/mono_item.rs | 2 +- + 5 files changed, 44 insertions(+), 35 deletions(-) + +diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs +index 3b5f927d52f0..2a79ce2f2285 100644 +--- a/src/librustc_codegen_llvm/attributes.rs ++++ b/src/librustc_codegen_llvm/attributes.rs +@@ -11,7 +11,7 @@ + + use std::ffi::{CStr, CString}; + +-use rustc::hir::CodegenFnAttrFlags; ++use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs}; + use rustc::hir::def_id::{DefId, LOCAL_CRATE}; + use rustc::session::Session; + use rustc::session::config::Sanitizer; +@@ -123,11 +123,37 @@ pub fn llvm_target_features(sess: &Session) -> impl Iterator { + + /// Composite function which sets LLVM attributes for function depending on its AST (#[attribute]) + /// attributes. +-pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) { +- let codegen_fn_attrs = cx.tcx.codegen_fn_attrs(id); ++pub fn from_fn_attrs( ++ cx: &CodegenCx, ++ llfn: ValueRef, ++ id: Option, ++) { ++ let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id)) ++ .unwrap_or(CodegenFnAttrs::new()); + + inline(llfn, codegen_fn_attrs.inline); + ++ // The `uwtable` attribute according to LLVM is: ++ // ++ // This attribute indicates that the ABI being targeted requires that an ++ // unwind table entry be produced for this function even if we can show ++ // that no exceptions passes by it. This is normally the case for the ++ // ELF x86-64 abi, but it can be disabled for some compilation units. ++ // ++ // Typically when we're compiling with `-C panic=abort` (which implies this ++ // `no_landing_pads` check) we don't need `uwtable` because we can't ++ // generate any exceptions! On Windows, however, exceptions include other ++ // events such as illegal instructions, segfaults, etc. This means that on ++ // Windows we end up still needing the `uwtable` attribute even if the `-C ++ // panic=abort` flag is passed. ++ // ++ // You can also find more info on why Windows is whitelisted here in: ++ // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 ++ if !cx.sess().no_landing_pads() || ++ cx.sess().target.target.options.requires_uwtable { ++ attributes::emit_uwtable(llfn, true); ++ } ++ + set_frame_pointer_elimination(cx, llfn); + set_probestack(cx, llfn); + +@@ -151,7 +177,7 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) { + // *in Rust code* may unwind. Foreign items like `extern "C" { + // fn foo(); }` are assumed not to unwind **unless** they have + // a `#[unwind]` attribute. +- } else if !cx.tcx.is_foreign_item(id) { ++ } else if id.map(|id| !cx.tcx.is_foreign_item(id)).unwrap_or(false) { + Some(true) + } else { + None +@@ -188,14 +214,16 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) { + // Note that currently the `wasm-import-module` doesn't do anything, but + // eventually LLVM 7 should read this and ferry the appropriate import + // module to the output file. +- if cx.tcx.sess.target.target.arch == "wasm32" { +- if let Some(module) = wasm_import_module(cx.tcx, id) { +- llvm::AddFunctionAttrStringValue( +- llfn, +- llvm::AttributePlace::Function, +- cstr("wasm-import-module\0"), +- &module, +- ); ++ if let Some(id) = id { ++ if cx.tcx.sess.target.target.arch == "wasm32" { ++ if let Some(module) = wasm_import_module(cx.tcx, id) { ++ llvm::AddFunctionAttrStringValue( ++ llfn, ++ llvm::AttributePlace::Function, ++ cstr("wasm-import-module\0"), ++ &module, ++ ); ++ } + } + } + } +diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs +index 223c04f420f3..b0461582ddcb 100644 +--- a/src/librustc_codegen_llvm/base.rs ++++ b/src/librustc_codegen_llvm/base.rs +@@ -486,27 +486,6 @@ pub fn codegen_instance<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, instance: Instance<' + + cx.stats.borrow_mut().n_closures += 1; + +- // The `uwtable` attribute according to LLVM is: +- // +- // This attribute indicates that the ABI being targeted requires that an +- // unwind table entry be produced for this function even if we can show +- // that no exceptions passes by it. This is normally the case for the +- // ELF x86-64 abi, but it can be disabled for some compilation units. +- // +- // Typically when we're compiling with `-C panic=abort` (which implies this +- // `no_landing_pads` check) we don't need `uwtable` because we can't +- // generate any exceptions! On Windows, however, exceptions include other +- // events such as illegal instructions, segfaults, etc. This means that on +- // Windows we end up still needing the `uwtable` attribute even if the `-C +- // panic=abort` flag is passed. +- // +- // You can also find more info on why Windows is whitelisted here in: +- // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 +- if !cx.sess().no_landing_pads() || +- cx.sess().target.target.options.requires_uwtable { +- attributes::emit_uwtable(lldecl, true); +- } +- + let mir = cx.tcx.instance_mir(instance.def); + mir::codegen_mir(cx, lldecl, &mir, instance, sig); + } +diff --git a/src/librustc_codegen_llvm/callee.rs b/src/librustc_codegen_llvm/callee.rs +index 2c01bd42cc77..97f07792ede8 100644 +--- a/src/librustc_codegen_llvm/callee.rs ++++ b/src/librustc_codegen_llvm/callee.rs +@@ -97,7 +97,7 @@ pub fn get_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, + if instance.def.is_inline(tcx) { + attributes::inline(llfn, attributes::InlineAttr::Hint); + } +- attributes::from_fn_attrs(cx, llfn, instance.def.def_id()); ++ attributes::from_fn_attrs(cx, llfn, Some(instance.def.def_id())); + + let instance_def_id = instance.def_id(); + +diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs +index 9c5c0f730c16..f69fce15dc55 100644 +--- a/src/librustc_codegen_llvm/intrinsic.rs ++++ b/src/librustc_codegen_llvm/intrinsic.rs +@@ -10,6 +10,7 @@ + + #![allow(non_upper_case_globals)] + ++use attributes; + use intrinsics::{self, Intrinsic}; + use llvm; + use llvm::{ValueRef}; +@@ -936,6 +937,7 @@ fn gen_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, + Abi::Rust + ))); + let llfn = declare::define_internal_fn(cx, name, rust_fn_ty); ++ attributes::from_fn_attrs(cx, llfn, None); + let bx = Builder::new_block(cx, llfn, "entry-block"); + codegen(bx); + llfn +diff --git a/src/librustc_codegen_llvm/mono_item.rs b/src/librustc_codegen_llvm/mono_item.rs +index a528008e3b4b..32d8b24e3c15 100644 +--- a/src/librustc_codegen_llvm/mono_item.rs ++++ b/src/librustc_codegen_llvm/mono_item.rs +@@ -183,7 +183,7 @@ fn predefine_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, + if instance.def.is_inline(cx.tcx) { + attributes::inline(lldecl, attributes::InlineAttr::Hint); + } +- attributes::from_fn_attrs(cx, lldecl, instance.def.def_id()); ++ attributes::from_fn_attrs(cx, lldecl, Some(instance.def.def_id())); + + cx.instances.borrow_mut().insert(instance, lldecl); + } +-- +2.17.1 + diff --git a/0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch b/0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch new file mode 100644 index 0000000..aaad0c8 --- /dev/null +++ b/0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch @@ -0,0 +1,36 @@ +From 8af0dbaf90a3ce7cdbc96552f31f8aec45cc3084 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 14 Aug 2018 17:17:58 -0700 +Subject: [PATCH] backtrace-sys: Use target_pointer_width for + BACKTRACE_ELF_SIZE + +The former code used `target.contains("64")` to detect Elf64 targets, +but this is inaccurate in a few cases: + +- `s390x-unknown-linux-gnu` is 64-bit +- `sparcv9-sun-solaris` is 64-bit +- `x86_64-unknown-linux-gnux32` is 32-bit + +Instead the build script can use `CARGO_CFG_TARGET_POINTER_WIDTH` to +reliably detect 64-bit targets. +--- + backtrace-sys/build.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/backtrace-sys/build.rs b/backtrace-sys/build.rs +index a423aade4116..10486d1f850c 100644 +--- a/backtrace-sys/build.rs ++++ b/backtrace-sys/build.rs +@@ -40,7 +40,8 @@ fn main() { + build.flag("-fvisibility=hidden"); + build.file("src/libbacktrace/elf.c"); + +- if target.contains("64") { ++ let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); ++ if pointer_width == "64" { + build.define("BACKTRACE_ELF_SIZE", "64"); + } else { + build.define("BACKTRACE_ELF_SIZE", "32"); +-- +2.17.1 + diff --git a/0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch b/0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch new file mode 100644 index 0000000..c9dee47 --- /dev/null +++ b/0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch @@ -0,0 +1,74 @@ +From 763e72110a913c7aab396a0f687e2ebd3c9e572a Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 9 Aug 2018 16:35:25 -0700 +Subject: [PATCH] rustc_codegen_llvm: Restore the closure env alloca hack for + LLVM 5. + +This hack was removed in #50949, but without it I found that building +`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment` +errors, then die `LLVM ERROR: Failed to strip malformed debug info`. + +It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack +just for older LLVM. + +This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb. +Fixes #53204. +r? @eddyb +--- + src/librustc_codegen_llvm/mir/mod.rs | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +diff --git a/src/librustc_codegen_llvm/mir/mod.rs b/src/librustc_codegen_llvm/mir/mod.rs +index 8fdb67f5930c..8bb049be3054 100644 +--- a/src/librustc_codegen_llvm/mir/mod.rs ++++ b/src/librustc_codegen_llvm/mir/mod.rs +@@ -574,6 +574,25 @@ fn arg_local_refs( + }; + let upvar_tys = upvar_substs.upvar_tys(def_id, tcx); + ++ // Store the pointer to closure data in an alloca for debuginfo ++ // because that's what the llvm.dbg.declare intrinsic expects. ++ ++ // FIXME(eddyb) this shouldn't be necessary but SROA seems to ++ // mishandle DW_OP_plus not preceded by DW_OP_deref, i.e. it ++ // doesn't actually strip the offset when splitting the closure ++ // environment into its components so it ends up out of bounds. ++ // (cuviper) It seems to be fine without the alloca on LLVM 6 and later. ++ let env_alloca = !env_ref && unsafe { llvm::LLVMRustVersionMajor() < 6 }; ++ let env_ptr = if env_alloca { ++ let scratch = PlaceRef::alloca(bx, ++ bx.cx.layout_of(tcx.mk_mut_ptr(arg.layout.ty)), ++ "__debuginfo_env_ptr"); ++ bx.store(place.llval, scratch.llval, scratch.align); ++ scratch.llval ++ } else { ++ place.llval ++ }; ++ + for (i, (decl, ty)) in mir.upvar_decls.iter().zip(upvar_tys).enumerate() { + let byte_offset_of_var_in_env = closure_layout.fields.offset(i).bytes(); + +@@ -585,7 +604,10 @@ fn arg_local_refs( + }; + + // The environment and the capture can each be indirect. +- let mut ops = if env_ref { &ops[..] } else { &ops[1..] }; ++ ++ // FIXME(eddyb) see above why we sometimes have to keep ++ // a pointer in an alloca for debuginfo atm. ++ let mut ops = if env_ref || env_alloca { &ops[..] } else { &ops[1..] }; + + let ty = if let (true, &ty::TyRef(_, ty, _)) = (decl.by_ref, &ty.sty) { + ty +@@ -595,7 +617,7 @@ fn arg_local_refs( + }; + + let variable_access = VariableAccess::IndirectVariable { +- alloca: place.llval, ++ alloca: env_ptr, + address_operations: &ops + }; + declare_local( +-- +2.17.1 + diff --git a/0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch b/0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch new file mode 100644 index 0000000..b4ed87d --- /dev/null +++ b/0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch @@ -0,0 +1,37 @@ +From e0d8364dadd404a37bc344ef089926745cfdbe20 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 14 Aug 2018 21:08:42 -0700 +Subject: [PATCH] std: Use target_pointer_width for BACKTRACE_ELF_SIZE + +The former code used `target.contains("64")` to detect Elf64 targets, +but this is inaccurate in a few cases: + +- `s390x-unknown-linux-gnu` is 64-bit +- `sparcv9-sun-solaris` is 64-bit +- `x86_64-unknown-linux-gnux32` is 32-bit + +Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH` +to reliably detect 64-bit targets for libbacktrace. + +Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122. +--- + src/libstd/build.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/libstd/build.rs b/src/libstd/build.rs +index 26d93f97e69f..016e7adb4c91 100644 +--- a/src/libstd/build.rs ++++ b/src/libstd/build.rs +@@ -104,7 +104,8 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> { + } else { + build.file("../libbacktrace/elf.c"); + +- if target.contains("64") { ++ let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); ++ if pointer_width == "64" { + build.define("BACKTRACE_ELF_SIZE", "64"); + } else { + build.define("BACKTRACE_ELF_SIZE", "32"); +-- +2.17.1 + diff --git a/0001-std-stop-backtracing-when-the-frames-are-full.patch b/0001-std-stop-backtracing-when-the-frames-are-full.patch new file mode 100644 index 0000000..aa1b9a5 --- /dev/null +++ b/0001-std-stop-backtracing-when-the-frames-are-full.patch @@ -0,0 +1,122 @@ +From f4e8d57b6ad6f599de54c020ba185db83cb011a3 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Thu, 16 Aug 2018 11:26:27 -0700 +Subject: [PATCH] std: stop backtracing when the frames are full + +--- + src/libstd/sys/cloudabi/backtrace.rs | 18 ++++++++++-------- + src/libstd/sys/redox/backtrace/tracing.rs | 18 ++++++++++-------- + src/libstd/sys/unix/backtrace/tracing/gcc_s.rs | 18 ++++++++++-------- + 3 files changed, 30 insertions(+), 24 deletions(-) + +diff --git a/src/libstd/sys/cloudabi/backtrace.rs b/src/libstd/sys/cloudabi/backtrace.rs +index 1b970187558c..2c43b5937ce5 100644 +--- a/src/libstd/sys/cloudabi/backtrace.rs ++++ b/src/libstd/sys/cloudabi/backtrace.rs +@@ -64,6 +64,10 @@ extern "C" fn trace_fn( + arg: *mut libc::c_void, + ) -> uw::_Unwind_Reason_Code { + let cx = unsafe { &mut *(arg as *mut Context) }; ++ if cx.idx >= cx.frames.len() { ++ return uw::_URC_NORMAL_STOP; ++ } ++ + let mut ip_before_insn = 0; + let mut ip = unsafe { uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void }; + if !ip.is_null() && ip_before_insn == 0 { +@@ -73,14 +77,12 @@ extern "C" fn trace_fn( + } + + let symaddr = unsafe { uw::_Unwind_FindEnclosingFunction(ip) }; +- if cx.idx < cx.frames.len() { +- cx.frames[cx.idx] = Frame { +- symbol_addr: symaddr as *mut u8, +- exact_position: ip as *mut u8, +- inline_context: 0, +- }; +- cx.idx += 1; +- } ++ cx.frames[cx.idx] = Frame { ++ symbol_addr: symaddr as *mut u8, ++ exact_position: ip as *mut u8, ++ inline_context: 0, ++ }; ++ cx.idx += 1; + + uw::_URC_NO_REASON + } +diff --git a/src/libstd/sys/redox/backtrace/tracing.rs b/src/libstd/sys/redox/backtrace/tracing.rs +index bb70ca360370..c0414b78f8d6 100644 +--- a/src/libstd/sys/redox/backtrace/tracing.rs ++++ b/src/libstd/sys/redox/backtrace/tracing.rs +@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame]) + extern fn trace_fn(ctx: *mut uw::_Unwind_Context, + arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { + let cx = unsafe { &mut *(arg as *mut Context) }; ++ if cx.idx >= cx.frames.len() { ++ return uw::_URC_NORMAL_STOP; ++ } ++ + let mut ip_before_insn = 0; + let mut ip = unsafe { + uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void +@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context, + unsafe { uw::_Unwind_FindEnclosingFunction(ip) } + }; + +- if cx.idx < cx.frames.len() { +- cx.frames[cx.idx] = Frame { +- symbol_addr: symaddr as *mut u8, +- exact_position: ip as *mut u8, +- inline_context: 0, +- }; +- cx.idx += 1; +- } ++ cx.frames[cx.idx] = Frame { ++ symbol_addr: symaddr as *mut u8, ++ exact_position: ip as *mut u8, ++ inline_context: 0, ++ }; ++ cx.idx += 1; + + uw::_URC_NO_REASON + } +diff --git a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs +index 1b92fc0e6ad0..6e8415686792 100644 +--- a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs ++++ b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs +@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame]) + extern fn trace_fn(ctx: *mut uw::_Unwind_Context, + arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { + let cx = unsafe { &mut *(arg as *mut Context) }; ++ if cx.idx >= cx.frames.len() { ++ return uw::_URC_NORMAL_STOP; ++ } ++ + let mut ip_before_insn = 0; + let mut ip = unsafe { + uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void +@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context, + unsafe { uw::_Unwind_FindEnclosingFunction(ip) } + }; + +- if cx.idx < cx.frames.len() { +- cx.frames[cx.idx] = Frame { +- symbol_addr: symaddr as *mut u8, +- exact_position: ip as *mut u8, +- inline_context: 0, +- }; +- cx.idx += 1; +- } ++ cx.frames[cx.idx] = Frame { ++ symbol_addr: symaddr as *mut u8, ++ exact_position: ip as *mut u8, ++ inline_context: 0, ++ }; ++ cx.idx += 1; + + uw::_URC_NO_REASON + } +-- +2.17.1 + diff --git a/rust-52760-test_loading_atoi.patch b/rust-52760-test_loading_atoi.patch deleted file mode 100644 index 77ddf13..0000000 --- a/rust-52760-test_loading_atoi.patch +++ /dev/null @@ -1,62 +0,0 @@ -From efa11da26a882aaf57f7eae747e48d128c474bf3 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 26 Jul 2018 17:20:02 -0700 -Subject: [PATCH] rustc_metadata: test loading atoi instead of cos - -Some platforms don't actually have `libm` already linked in the test -infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would -fail to find the "cos" symbol. Every platform running this test should -have `libc` and "atoi" though, so try to use that symbol instead. - -Fixes #45410. ---- - src/librustc_metadata/dynamic_lib.rs | 25 ++++++++++++------------- - 1 file changed, 12 insertions(+), 13 deletions(-) - -diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs -index d7da0d00012e..182a071277ec 100644 ---- a/src/librustc_metadata/dynamic_lib.rs -+++ b/src/librustc_metadata/dynamic_lib.rs -@@ -90,30 +90,29 @@ mod tests { - use std::mem; - - #[test] -- fn test_loading_cosine() { -+ fn test_loading_atoi() { - if cfg!(windows) { - return - } - -- // The math library does not need to be loaded since it is already -- // statically linked in -- let libm = match DynamicLibrary::open(None) { -+ // The C library does not need to be loaded since it is already linked in -+ let lib = match DynamicLibrary::open(None) { - Err(error) => panic!("Could not load self as module: {}", error), -- Ok(libm) => libm -+ Ok(lib) => lib - }; - -- let cosine: extern fn(libc::c_double) -> libc::c_double = unsafe { -- match libm.symbol("cos") { -- Err(error) => panic!("Could not load function cos: {}", error), -- Ok(cosine) => mem::transmute::<*mut u8, _>(cosine) -+ let atoi: extern fn(*const libc::c_char) -> libc::c_int = unsafe { -+ match lib.symbol("atoi") { -+ Err(error) => panic!("Could not load function atoi: {}", error), -+ Ok(atoi) => mem::transmute::<*mut u8, _>(atoi) - } - }; - -- let argument = 0.0; -- let expected_result = 1.0; -- let result = cosine(argument); -+ let argument = CString::new("1383428980").unwrap(); -+ let expected_result = 0x52757374; -+ let result = atoi(argument.as_ptr()); - if result != expected_result { -- panic!("cos({}) != {} but equaled {} instead", argument, -+ panic!("atoi({:?}) != {} but equaled {} instead", argument, - expected_result, result) - } - } diff --git a/rust.spec b/rust.spec index e537606..d8c8d8a 100644 --- a/rust.spec +++ b/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.27.2 -%global bootstrap_cargo 1.27.0 +%global bootstrap_rust 1.28.0 +%global bootstrap_cargo 1.28.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-07-20 +%global bootstrap_date 2018-08-02 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -21,7 +21,7 @@ %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 3.9+. +# is insufficient. Rust currently requires LLVM 5.0+. %if 0%{?rhel} && !0%{?epel} %bcond_without bundled_llvm %else @@ -34,6 +34,12 @@ # So, tread carefully if you toggle this... %bcond_without bundled_libgit2 +%if 0%{?rhel} +%bcond_without bundled_libssh2 +%else +%bcond_with bundled_libssh2 +%endif + # LLDB only works on some architectures %ifarch %{arm} aarch64 %{ix86} x86_64 # LLDB isn't available everywhere... @@ -49,14 +55,15 @@ # Some sub-packages are versioned independently of the rust compiler and runtime itself. # Also beware that if any of these are not changed in a version bump, then the release # number should still increase, not be reset to 1! -%global rustc_version 1.28.0 -%global cargo_version 1.28.0 -%global rustfmt_version 0.8.2 -%global rls_version 0.128.0 +%global rustc_version 1.29.0 +%global cargo_version 1.29.0 +%global rustfmt_version 0.99.1 +%global rls_version 0.130.0 +%global clippy_version 0.0.212 Name: rust Version: %{rustc_version} -Release: 3%{?dist} +Release: 0.1.beta.4%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -70,11 +77,22 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/52760 -Patch1: rust-52760-test_loading_atoi.patch - # https://github.com/rust-lang/rust/pull/52876 -Patch2: rust-52876-const-endianess.patch +Patch1: rust-52876-const-endianess.patch + +# https://github.com/rust-lang/rust/pull/53239 +Patch2: 0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch + +# https://github.com/alexcrichton/backtrace-rs/pull/122 +# https://github.com/rust-lang/rust/pull/53377 +Patch3: 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch +Patch4: 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch + +# https://github.com/rust-lang/rust/pull/53436 +Patch5: 0001-std-stop-backtracing-when-the-frames-are-full.patch + +# https://github.com/rust-lang/rust/pull/53437 +Patch6: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -135,10 +153,18 @@ BuildRequires: ncurses-devel BuildRequires: curl BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(liblzma) -BuildRequires: pkgconfig(libssh2) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) +%if %without bundled_libgit2 +BuildRequires: pkgconfig(libgit2) >= 0.27 +%endif + +%if %without bundled_libssh2 +# needs libssh2_userauth_publickey_frommemory +BuildRequires: pkgconfig(libssh2) >= 1.6.0 +%endif + %if 0%{?rhel} && 0%{?rhel} <= 7 %global python python2 %else @@ -148,22 +174,19 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 6.0 +Provides: bundled(llvm) = 7.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} %global llvm llvm5.0 %endif -%if 0%{?fedora} >= 29 -%global llvm llvm6.0 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 3.9 +BuildRequires: %{llvm}-devel >= 5.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -193,7 +216,7 @@ Requires: %{name}-std-static%{?_isa} = %{rustc_version}-%{release} Requires: /usr/bin/cc # ALL Rust libraries are private, because they don't keep an ABI. -%global _privatelibs lib(.*-[[:xdigit:]]*|rustc.*)[.]so.* +%global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.* %global __provides_exclude ^(%{_privatelibs})$ %global __requires_exclude ^(%{_privatelibs})$ %global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$ @@ -289,8 +312,9 @@ Summary: Rust's package manager and build tool Version: %{cargo_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 -%else -BuildRequires: pkgconfig(libgit2) >= 0.27 +%endif +%if %with bundled_libssh2 +Provides: bundled(libssh2) = 1.8.1 %endif # For tests: BuildRequires: git @@ -335,6 +359,9 @@ Provides: rls = %{rls_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 %endif +%if %with bundled_libssh2 +Provides: bundled(libssh2) = 1.8.1 +%endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs Requires: %{name}%{?_isa} = %{rustc_version}-%{release} @@ -346,6 +373,19 @@ It supports functionality such as 'goto definition', symbol search, reformatting, and code completion, and enables renaming and refactorings. +%package -n clippy-preview +Summary: Lints to catch common mistakes and improve your Rust code +Version: %{clippy_version} +License: MPLv2.0 +Provides: clippy = %{clippy_version} +Requires: cargo +# /usr/bin/clippy-driver is dynamically linked against internal rustc libs +Requires: %{name}%{?_isa} = %{rustc_version}-%{release} + +%description -n clippy-preview +A collection of lints to catch common mistakes and improve your Rust code. + + %package src Summary: Sources for the Rust standard library BuildArch: noarch @@ -379,6 +419,12 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 %patch2 -p1 +pushd src/vendor/backtrace-sys +%patch3 -p2 +popd +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -430,6 +476,11 @@ find src/vendor -name .cargo-checksum.json \ export LIBGIT2_SYS_USE_PKG_CONFIG=1 %endif +%if %without bundled_libssh2 +# convince libssh2-sys to use the distro libssh2 +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}"} @@ -506,6 +557,7 @@ find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+' # Remove unwanted documentation files (we already package them) rm -f %{buildroot}%{_docdir}/%{name}/README.md rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT +rm -f %{buildroot}%{_docdir}/%{name}/LICENSE rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY @@ -554,6 +606,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* # The results are not stable on koji, so mask errors and just log it. %{python} ./x.py test --no-fail-fast || : %{python} ./x.py test --no-fail-fast cargo || : +%{python} ./x.py test --no-fail-fast clippy || : %{python} ./x.py test --no-fail-fast rls || : %{python} ./x.py test --no-fail-fast rustfmt || : @@ -643,6 +696,13 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %license src/tools/rls/LICENSE-{APACHE,MIT} +%files -n clippy-preview +%{_bindir}/cargo-clippy +%{_bindir}/clippy-driver +%doc src/tools/clippy/{README.md,CHANGELOG.md} +%license src/tools/clippy/LICENSE + + %files src %dir %{rustlibdir} %{rustlibdir}/src @@ -653,6 +713,10 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Aug 16 2018 Josh Stone - 1.29.0-0.1.beta.4 +- beta test +- Add a clippy-preview subpackage + * Mon Aug 13 2018 Josh Stone - 1.28.0-3 - Use llvm6.0 instead of llvm-7 for now From 7826701957fbb6aeb25e3cfdeaabe315f0abbc27 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 31 Aug 2018 11:52:04 -0700 Subject: [PATCH 32/59] beta test --- 0001-rustbuild-fix-local_rebuild.patch | 30 ++++++++ ...vm-Restore-the-closure-env-alloca-ha.patch | 74 ------------------- rust.spec | 48 +++++------- 3 files changed, 48 insertions(+), 104 deletions(-) create mode 100644 0001-rustbuild-fix-local_rebuild.patch delete mode 100644 0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch diff --git a/0001-rustbuild-fix-local_rebuild.patch b/0001-rustbuild-fix-local_rebuild.patch new file mode 100644 index 0000000..4102511 --- /dev/null +++ b/0001-rustbuild-fix-local_rebuild.patch @@ -0,0 +1,30 @@ +From 66a47182d10542b68773d8a1cb9230a4918a5068 Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Thu, 2 Aug 2018 08:49:36 +0200 +Subject: [PATCH] rustbuild: fix local_rebuild + +If we detect a local rebuild (e.g. bootstrap compiler is the same version as target compiler), we set stage to 1. +When trying to build e.g. UnstableBook, we use Mode::ToolBootstrap and stage is 1. +Just allow Mode::ToolBootstrap and stagge != 0 if we are in a local_rebuild + +Signed-off-by: Marc-Antoine Perennou +--- + src/bootstrap/builder.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 724d3b741903..dc0b0aaf0bb3 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -777,7 +777,7 @@ impl<'a> Builder<'a> { + // compiler, but for tools we just use the precompiled libraries that + // we've downloaded + let use_snapshot = mode == Mode::ToolBootstrap; +- assert!(!use_snapshot || stage == 0); ++ assert!(!use_snapshot || stage == 0 || self.local_rebuild); + + let maybe_sysroot = self.sysroot(compiler); + let sysroot = if use_snapshot { +-- +2.17.1 + diff --git a/0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch b/0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch deleted file mode 100644 index c9dee47..0000000 --- a/0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 763e72110a913c7aab396a0f687e2ebd3c9e572a Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 9 Aug 2018 16:35:25 -0700 -Subject: [PATCH] rustc_codegen_llvm: Restore the closure env alloca hack for - LLVM 5. - -This hack was removed in #50949, but without it I found that building -`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment` -errors, then die `LLVM ERROR: Failed to strip malformed debug info`. - -It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack -just for older LLVM. - -This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb. -Fixes #53204. -r? @eddyb ---- - src/librustc_codegen_llvm/mir/mod.rs | 26 ++++++++++++++++++++++++-- - 1 file changed, 24 insertions(+), 2 deletions(-) - -diff --git a/src/librustc_codegen_llvm/mir/mod.rs b/src/librustc_codegen_llvm/mir/mod.rs -index 8fdb67f5930c..8bb049be3054 100644 ---- a/src/librustc_codegen_llvm/mir/mod.rs -+++ b/src/librustc_codegen_llvm/mir/mod.rs -@@ -574,6 +574,25 @@ fn arg_local_refs( - }; - let upvar_tys = upvar_substs.upvar_tys(def_id, tcx); - -+ // Store the pointer to closure data in an alloca for debuginfo -+ // because that's what the llvm.dbg.declare intrinsic expects. -+ -+ // FIXME(eddyb) this shouldn't be necessary but SROA seems to -+ // mishandle DW_OP_plus not preceded by DW_OP_deref, i.e. it -+ // doesn't actually strip the offset when splitting the closure -+ // environment into its components so it ends up out of bounds. -+ // (cuviper) It seems to be fine without the alloca on LLVM 6 and later. -+ let env_alloca = !env_ref && unsafe { llvm::LLVMRustVersionMajor() < 6 }; -+ let env_ptr = if env_alloca { -+ let scratch = PlaceRef::alloca(bx, -+ bx.cx.layout_of(tcx.mk_mut_ptr(arg.layout.ty)), -+ "__debuginfo_env_ptr"); -+ bx.store(place.llval, scratch.llval, scratch.align); -+ scratch.llval -+ } else { -+ place.llval -+ }; -+ - for (i, (decl, ty)) in mir.upvar_decls.iter().zip(upvar_tys).enumerate() { - let byte_offset_of_var_in_env = closure_layout.fields.offset(i).bytes(); - -@@ -585,7 +604,10 @@ fn arg_local_refs( - }; - - // The environment and the capture can each be indirect. -- let mut ops = if env_ref { &ops[..] } else { &ops[1..] }; -+ -+ // FIXME(eddyb) see above why we sometimes have to keep -+ // a pointer in an alloca for debuginfo atm. -+ let mut ops = if env_ref || env_alloca { &ops[..] } else { &ops[1..] }; - - let ty = if let (true, &ty::TyRef(_, ty, _)) = (decl.by_ref, &ty.sty) { - ty -@@ -595,7 +617,7 @@ fn arg_local_refs( - }; - - let variable_access = VariableAccess::IndirectVariable { -- alloca: place.llval, -+ alloca: env_ptr, - address_operations: &ops - }; - declare_local( --- -2.17.1 - diff --git a/rust.spec b/rust.spec index d8c8d8a..e624d92 100644 --- a/rust.spec +++ b/rust.spec @@ -63,7 +63,7 @@ Name: rust Version: %{rustc_version} -Release: 0.1.beta.4%{?dist} +Release: 0.1.beta.7%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -80,19 +80,19 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/rust/pull/52876 Patch1: rust-52876-const-endianess.patch -# https://github.com/rust-lang/rust/pull/53239 -Patch2: 0001-rustc_codegen_llvm-Restore-the-closure-env-alloca-ha.patch - # https://github.com/alexcrichton/backtrace-rs/pull/122 # https://github.com/rust-lang/rust/pull/53377 -Patch3: 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch -Patch4: 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch +Patch2: 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch +Patch3: 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch # https://github.com/rust-lang/rust/pull/53436 -Patch5: 0001-std-stop-backtracing-when-the-frames-are-full.patch +Patch4: 0001-std-stop-backtracing-when-the-frames-are-full.patch # https://github.com/rust-lang/rust/pull/53437 -Patch6: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch +Patch5: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch + +# https://github.com/rust-lang/rust/pull/52969 +Patch6: 0001-rustbuild-fix-local_rebuild.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -332,7 +332,7 @@ Version: %{cargo_version} BuildArch: noarch # Cargo no longer builds its own documentation # https://github.com/rust-lang/cargo/pull/4904 -Requires: rust-doc +Requires: rust-doc = %{rustc_version}-%{release} %description -n cargo-doc This package includes HTML documentation for Cargo. @@ -418,10 +418,10 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -%patch2 -p1 pushd src/vendor/backtrace-sys -%patch3 -p2 +%patch2 -p2 popd +%patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 @@ -572,25 +572,8 @@ mkdir -p %{buildroot}%{_datadir}/cargo/registry # Cargo no longer builds its own documentation # https://github.com/rust-lang/cargo/pull/4904 -mkdir -p %{buildroot}%{_docdir}/cargo/html -cat < %{buildroot}%{_docdir}/cargo/html/index.html - - - - - - - cargo-doc redirection - - - Cargo documentation has been moved to the rust-doc package. - If you are not redirected automatically, please follow this - link. - - -EOF +mkdir -p %{buildroot}%{_docdir}/cargo +ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html %if %without lldb rm -f %{buildroot}%{_bindir}/rust-lldb @@ -680,6 +663,8 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files -n cargo-doc +%docdir %{_docdir}/cargo +%dir %{_docdir}/cargo %{_docdir}/cargo/html @@ -713,6 +698,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Aug 30 2018 Josh Stone - 1.29.0-0.1.beta.7 +- beta test + * Thu Aug 16 2018 Josh Stone - 1.29.0-0.1.beta.4 - beta test - Add a clippy-preview subpackage From 9d2418db769befbca439bb20d13a5ade2dc22feb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 5 Sep 2018 16:13:10 -0700 Subject: [PATCH 33/59] beta test --- ...e-target_pointer_width-for-BACKTRACE.patch | 36 ------------------ 0001-rustbuild-fix-local_rebuild.patch | 30 --------------- ...pointer_width-for-BACKTRACE_ELF_SIZE.patch | 37 ------------------- rust.spec | 24 ++++-------- 4 files changed, 7 insertions(+), 120 deletions(-) delete mode 100644 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch delete mode 100644 0001-rustbuild-fix-local_rebuild.patch delete mode 100644 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch diff --git a/0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch b/0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch deleted file mode 100644 index aaad0c8..0000000 --- a/0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8af0dbaf90a3ce7cdbc96552f31f8aec45cc3084 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 14 Aug 2018 17:17:58 -0700 -Subject: [PATCH] backtrace-sys: Use target_pointer_width for - BACKTRACE_ELF_SIZE - -The former code used `target.contains("64")` to detect Elf64 targets, -but this is inaccurate in a few cases: - -- `s390x-unknown-linux-gnu` is 64-bit -- `sparcv9-sun-solaris` is 64-bit -- `x86_64-unknown-linux-gnux32` is 32-bit - -Instead the build script can use `CARGO_CFG_TARGET_POINTER_WIDTH` to -reliably detect 64-bit targets. ---- - backtrace-sys/build.rs | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/backtrace-sys/build.rs b/backtrace-sys/build.rs -index a423aade4116..10486d1f850c 100644 ---- a/backtrace-sys/build.rs -+++ b/backtrace-sys/build.rs -@@ -40,7 +40,8 @@ fn main() { - build.flag("-fvisibility=hidden"); - build.file("src/libbacktrace/elf.c"); - -- if target.contains("64") { -+ let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); -+ if pointer_width == "64" { - build.define("BACKTRACE_ELF_SIZE", "64"); - } else { - build.define("BACKTRACE_ELF_SIZE", "32"); --- -2.17.1 - diff --git a/0001-rustbuild-fix-local_rebuild.patch b/0001-rustbuild-fix-local_rebuild.patch deleted file mode 100644 index 4102511..0000000 --- a/0001-rustbuild-fix-local_rebuild.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 66a47182d10542b68773d8a1cb9230a4918a5068 Mon Sep 17 00:00:00 2001 -From: Marc-Antoine Perennou -Date: Thu, 2 Aug 2018 08:49:36 +0200 -Subject: [PATCH] rustbuild: fix local_rebuild - -If we detect a local rebuild (e.g. bootstrap compiler is the same version as target compiler), we set stage to 1. -When trying to build e.g. UnstableBook, we use Mode::ToolBootstrap and stage is 1. -Just allow Mode::ToolBootstrap and stagge != 0 if we are in a local_rebuild - -Signed-off-by: Marc-Antoine Perennou ---- - src/bootstrap/builder.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 724d3b741903..dc0b0aaf0bb3 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -777,7 +777,7 @@ impl<'a> Builder<'a> { - // compiler, but for tools we just use the precompiled libraries that - // we've downloaded - let use_snapshot = mode == Mode::ToolBootstrap; -- assert!(!use_snapshot || stage == 0); -+ assert!(!use_snapshot || stage == 0 || self.local_rebuild); - - let maybe_sysroot = self.sysroot(compiler); - let sysroot = if use_snapshot { --- -2.17.1 - diff --git a/0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch b/0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch deleted file mode 100644 index b4ed87d..0000000 --- a/0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e0d8364dadd404a37bc344ef089926745cfdbe20 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 14 Aug 2018 21:08:42 -0700 -Subject: [PATCH] std: Use target_pointer_width for BACKTRACE_ELF_SIZE - -The former code used `target.contains("64")` to detect Elf64 targets, -but this is inaccurate in a few cases: - -- `s390x-unknown-linux-gnu` is 64-bit -- `sparcv9-sun-solaris` is 64-bit -- `x86_64-unknown-linux-gnux32` is 32-bit - -Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH` -to reliably detect 64-bit targets for libbacktrace. - -Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122. ---- - src/libstd/build.rs | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/libstd/build.rs b/src/libstd/build.rs -index 26d93f97e69f..016e7adb4c91 100644 ---- a/src/libstd/build.rs -+++ b/src/libstd/build.rs -@@ -104,7 +104,8 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> { - } else { - build.file("../libbacktrace/elf.c"); - -- if target.contains("64") { -+ let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); -+ if pointer_width == "64" { - build.define("BACKTRACE_ELF_SIZE", "64"); - } else { - build.define("BACKTRACE_ELF_SIZE", "32"); --- -2.17.1 - diff --git a/rust.spec b/rust.spec index e624d92..f7a4f46 100644 --- a/rust.spec +++ b/rust.spec @@ -63,7 +63,7 @@ Name: rust Version: %{rustc_version} -Release: 0.1.beta.7%{?dist} +Release: 0.1.beta.12%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -80,19 +80,11 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz # https://github.com/rust-lang/rust/pull/52876 Patch1: rust-52876-const-endianess.patch -# https://github.com/alexcrichton/backtrace-rs/pull/122 -# https://github.com/rust-lang/rust/pull/53377 -Patch2: 0001-backtrace-sys-Use-target_pointer_width-for-BACKTRACE.patch -Patch3: 0001-std-Use-target_pointer_width-for-BACKTRACE_ELF_SIZE.patch - # https://github.com/rust-lang/rust/pull/53436 -Patch4: 0001-std-stop-backtracing-when-the-frames-are-full.patch +Patch2: 0001-std-stop-backtracing-when-the-frames-are-full.patch # https://github.com/rust-lang/rust/pull/53437 -Patch5: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch - -# https://github.com/rust-lang/rust/pull/52969 -Patch6: 0001-rustbuild-fix-local_rebuild.patch +Patch3: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -418,13 +410,8 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} %patch1 -p1 -pushd src/vendor/backtrace-sys -%patch2 -p2 -popd +%patch2 -p1 %patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -698,6 +685,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed Sep 05 2018 Josh Stone - 1.29.0-0.1.beta.12 +- beta test + * Thu Aug 30 2018 Josh Stone - 1.29.0-0.1.beta.7 - beta test From aa84a97bfc78ee1eb2219b375ae6d44fe801a232 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 10 Sep 2018 16:52:37 -0700 Subject: [PATCH 34/59] beta test --- rust.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust.spec b/rust.spec index f7a4f46..19cb19a 100644 --- a/rust.spec +++ b/rust.spec @@ -63,7 +63,7 @@ Name: rust Version: %{rustc_version} -Release: 0.1.beta.12%{?dist} +Release: 0.1.beta.14%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -685,6 +685,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Mon Sep 10 2018 Josh Stone - 1.29.0-0.1.beta.14 +- beta test + * Wed Sep 05 2018 Josh Stone - 1.29.0-0.1.beta.12 - beta test From 7472b1ea49279e36b212e82a8e9374389fa484dc Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 20 Sep 2018 13:36:37 -0700 Subject: [PATCH 35/59] beta test --- ...m-function-attributes-for-__rust_try.patch | 186 ------------------ ...backtracing-when-the-frames-are-full.patch | 122 ------------ rust-52876-const-endianess.patch | 26 --- rust.spec | 42 ++-- 4 files changed, 16 insertions(+), 360 deletions(-) delete mode 100644 0001-Set-more-llvm-function-attributes-for-__rust_try.patch delete mode 100644 0001-std-stop-backtracing-when-the-frames-are-full.patch delete mode 100644 rust-52876-const-endianess.patch diff --git a/0001-Set-more-llvm-function-attributes-for-__rust_try.patch b/0001-Set-more-llvm-function-attributes-for-__rust_try.patch deleted file mode 100644 index 36bb15c..0000000 --- a/0001-Set-more-llvm-function-attributes-for-__rust_try.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 4b95b1a4fd035a73998dc21b265ce4594e35f8ae Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Thu, 16 Aug 2018 13:19:04 -0700 -Subject: [PATCH] Set more llvm function attributes for __rust_try - -This shim is generated elsewhere in the compiler so this commit adds support to -ensure it goes through similar paths as the rest of the compiler to set llvm -function attributes like target features. - -cc #53372 ---- - src/librustc_codegen_llvm/attributes.rs | 52 +++++++++++++++++++------ - src/librustc_codegen_llvm/base.rs | 21 ---------- - src/librustc_codegen_llvm/callee.rs | 2 +- - src/librustc_codegen_llvm/intrinsic.rs | 2 + - src/librustc_codegen_llvm/mono_item.rs | 2 +- - 5 files changed, 44 insertions(+), 35 deletions(-) - -diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs -index 3b5f927d52f0..2a79ce2f2285 100644 ---- a/src/librustc_codegen_llvm/attributes.rs -+++ b/src/librustc_codegen_llvm/attributes.rs -@@ -11,7 +11,7 @@ - - use std::ffi::{CStr, CString}; - --use rustc::hir::CodegenFnAttrFlags; -+use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs}; - use rustc::hir::def_id::{DefId, LOCAL_CRATE}; - use rustc::session::Session; - use rustc::session::config::Sanitizer; -@@ -123,11 +123,37 @@ pub fn llvm_target_features(sess: &Session) -> impl Iterator { - - /// Composite function which sets LLVM attributes for function depending on its AST (#[attribute]) - /// attributes. --pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) { -- let codegen_fn_attrs = cx.tcx.codegen_fn_attrs(id); -+pub fn from_fn_attrs( -+ cx: &CodegenCx, -+ llfn: ValueRef, -+ id: Option, -+) { -+ let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id)) -+ .unwrap_or(CodegenFnAttrs::new()); - - inline(llfn, codegen_fn_attrs.inline); - -+ // The `uwtable` attribute according to LLVM is: -+ // -+ // This attribute indicates that the ABI being targeted requires that an -+ // unwind table entry be produced for this function even if we can show -+ // that no exceptions passes by it. This is normally the case for the -+ // ELF x86-64 abi, but it can be disabled for some compilation units. -+ // -+ // Typically when we're compiling with `-C panic=abort` (which implies this -+ // `no_landing_pads` check) we don't need `uwtable` because we can't -+ // generate any exceptions! On Windows, however, exceptions include other -+ // events such as illegal instructions, segfaults, etc. This means that on -+ // Windows we end up still needing the `uwtable` attribute even if the `-C -+ // panic=abort` flag is passed. -+ // -+ // You can also find more info on why Windows is whitelisted here in: -+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 -+ if !cx.sess().no_landing_pads() || -+ cx.sess().target.target.options.requires_uwtable { -+ attributes::emit_uwtable(llfn, true); -+ } -+ - set_frame_pointer_elimination(cx, llfn); - set_probestack(cx, llfn); - -@@ -151,7 +177,7 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) { - // *in Rust code* may unwind. Foreign items like `extern "C" { - // fn foo(); }` are assumed not to unwind **unless** they have - // a `#[unwind]` attribute. -- } else if !cx.tcx.is_foreign_item(id) { -+ } else if id.map(|id| !cx.tcx.is_foreign_item(id)).unwrap_or(false) { - Some(true) - } else { - None -@@ -188,14 +214,16 @@ pub fn from_fn_attrs(cx: &CodegenCx, llfn: ValueRef, id: DefId) { - // Note that currently the `wasm-import-module` doesn't do anything, but - // eventually LLVM 7 should read this and ferry the appropriate import - // module to the output file. -- if cx.tcx.sess.target.target.arch == "wasm32" { -- if let Some(module) = wasm_import_module(cx.tcx, id) { -- llvm::AddFunctionAttrStringValue( -- llfn, -- llvm::AttributePlace::Function, -- cstr("wasm-import-module\0"), -- &module, -- ); -+ if let Some(id) = id { -+ if cx.tcx.sess.target.target.arch == "wasm32" { -+ if let Some(module) = wasm_import_module(cx.tcx, id) { -+ llvm::AddFunctionAttrStringValue( -+ llfn, -+ llvm::AttributePlace::Function, -+ cstr("wasm-import-module\0"), -+ &module, -+ ); -+ } - } - } - } -diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs -index 223c04f420f3..b0461582ddcb 100644 ---- a/src/librustc_codegen_llvm/base.rs -+++ b/src/librustc_codegen_llvm/base.rs -@@ -486,27 +486,6 @@ pub fn codegen_instance<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, instance: Instance<' - - cx.stats.borrow_mut().n_closures += 1; - -- // The `uwtable` attribute according to LLVM is: -- // -- // This attribute indicates that the ABI being targeted requires that an -- // unwind table entry be produced for this function even if we can show -- // that no exceptions passes by it. This is normally the case for the -- // ELF x86-64 abi, but it can be disabled for some compilation units. -- // -- // Typically when we're compiling with `-C panic=abort` (which implies this -- // `no_landing_pads` check) we don't need `uwtable` because we can't -- // generate any exceptions! On Windows, however, exceptions include other -- // events such as illegal instructions, segfaults, etc. This means that on -- // Windows we end up still needing the `uwtable` attribute even if the `-C -- // panic=abort` flag is passed. -- // -- // You can also find more info on why Windows is whitelisted here in: -- // https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 -- if !cx.sess().no_landing_pads() || -- cx.sess().target.target.options.requires_uwtable { -- attributes::emit_uwtable(lldecl, true); -- } -- - let mir = cx.tcx.instance_mir(instance.def); - mir::codegen_mir(cx, lldecl, &mir, instance, sig); - } -diff --git a/src/librustc_codegen_llvm/callee.rs b/src/librustc_codegen_llvm/callee.rs -index 2c01bd42cc77..97f07792ede8 100644 ---- a/src/librustc_codegen_llvm/callee.rs -+++ b/src/librustc_codegen_llvm/callee.rs -@@ -97,7 +97,7 @@ pub fn get_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, - if instance.def.is_inline(tcx) { - attributes::inline(llfn, attributes::InlineAttr::Hint); - } -- attributes::from_fn_attrs(cx, llfn, instance.def.def_id()); -+ attributes::from_fn_attrs(cx, llfn, Some(instance.def.def_id())); - - let instance_def_id = instance.def_id(); - -diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs -index 9c5c0f730c16..f69fce15dc55 100644 ---- a/src/librustc_codegen_llvm/intrinsic.rs -+++ b/src/librustc_codegen_llvm/intrinsic.rs -@@ -10,6 +10,7 @@ - - #![allow(non_upper_case_globals)] - -+use attributes; - use intrinsics::{self, Intrinsic}; - use llvm; - use llvm::{ValueRef}; -@@ -936,6 +937,7 @@ fn gen_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, - Abi::Rust - ))); - let llfn = declare::define_internal_fn(cx, name, rust_fn_ty); -+ attributes::from_fn_attrs(cx, llfn, None); - let bx = Builder::new_block(cx, llfn, "entry-block"); - codegen(bx); - llfn -diff --git a/src/librustc_codegen_llvm/mono_item.rs b/src/librustc_codegen_llvm/mono_item.rs -index a528008e3b4b..32d8b24e3c15 100644 ---- a/src/librustc_codegen_llvm/mono_item.rs -+++ b/src/librustc_codegen_llvm/mono_item.rs -@@ -183,7 +183,7 @@ fn predefine_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, - if instance.def.is_inline(cx.tcx) { - attributes::inline(lldecl, attributes::InlineAttr::Hint); - } -- attributes::from_fn_attrs(cx, lldecl, instance.def.def_id()); -+ attributes::from_fn_attrs(cx, lldecl, Some(instance.def.def_id())); - - cx.instances.borrow_mut().insert(instance, lldecl); - } --- -2.17.1 - diff --git a/0001-std-stop-backtracing-when-the-frames-are-full.patch b/0001-std-stop-backtracing-when-the-frames-are-full.patch deleted file mode 100644 index aa1b9a5..0000000 --- a/0001-std-stop-backtracing-when-the-frames-are-full.patch +++ /dev/null @@ -1,122 +0,0 @@ -From f4e8d57b6ad6f599de54c020ba185db83cb011a3 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 16 Aug 2018 11:26:27 -0700 -Subject: [PATCH] std: stop backtracing when the frames are full - ---- - src/libstd/sys/cloudabi/backtrace.rs | 18 ++++++++++-------- - src/libstd/sys/redox/backtrace/tracing.rs | 18 ++++++++++-------- - src/libstd/sys/unix/backtrace/tracing/gcc_s.rs | 18 ++++++++++-------- - 3 files changed, 30 insertions(+), 24 deletions(-) - -diff --git a/src/libstd/sys/cloudabi/backtrace.rs b/src/libstd/sys/cloudabi/backtrace.rs -index 1b970187558c..2c43b5937ce5 100644 ---- a/src/libstd/sys/cloudabi/backtrace.rs -+++ b/src/libstd/sys/cloudabi/backtrace.rs -@@ -64,6 +64,10 @@ extern "C" fn trace_fn( - arg: *mut libc::c_void, - ) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; -+ if cx.idx >= cx.frames.len() { -+ return uw::_URC_NORMAL_STOP; -+ } -+ - let mut ip_before_insn = 0; - let mut ip = unsafe { uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void }; - if !ip.is_null() && ip_before_insn == 0 { -@@ -73,14 +77,12 @@ extern "C" fn trace_fn( - } - - let symaddr = unsafe { uw::_Unwind_FindEnclosingFunction(ip) }; -- if cx.idx < cx.frames.len() { -- cx.frames[cx.idx] = Frame { -- symbol_addr: symaddr as *mut u8, -- exact_position: ip as *mut u8, -- inline_context: 0, -- }; -- cx.idx += 1; -- } -+ cx.frames[cx.idx] = Frame { -+ symbol_addr: symaddr as *mut u8, -+ exact_position: ip as *mut u8, -+ inline_context: 0, -+ }; -+ cx.idx += 1; - - uw::_URC_NO_REASON - } -diff --git a/src/libstd/sys/redox/backtrace/tracing.rs b/src/libstd/sys/redox/backtrace/tracing.rs -index bb70ca360370..c0414b78f8d6 100644 ---- a/src/libstd/sys/redox/backtrace/tracing.rs -+++ b/src/libstd/sys/redox/backtrace/tracing.rs -@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame]) - extern fn trace_fn(ctx: *mut uw::_Unwind_Context, - arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; -+ if cx.idx >= cx.frames.len() { -+ return uw::_URC_NORMAL_STOP; -+ } -+ - let mut ip_before_insn = 0; - let mut ip = unsafe { - uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void -@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context, - unsafe { uw::_Unwind_FindEnclosingFunction(ip) } - }; - -- if cx.idx < cx.frames.len() { -- cx.frames[cx.idx] = Frame { -- symbol_addr: symaddr as *mut u8, -- exact_position: ip as *mut u8, -- inline_context: 0, -- }; -- cx.idx += 1; -- } -+ cx.frames[cx.idx] = Frame { -+ symbol_addr: symaddr as *mut u8, -+ exact_position: ip as *mut u8, -+ inline_context: 0, -+ }; -+ cx.idx += 1; - - uw::_URC_NO_REASON - } -diff --git a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs -index 1b92fc0e6ad0..6e8415686792 100644 ---- a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs -+++ b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs -@@ -68,6 +68,10 @@ pub fn unwind_backtrace(frames: &mut [Frame]) - extern fn trace_fn(ctx: *mut uw::_Unwind_Context, - arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; -+ if cx.idx >= cx.frames.len() { -+ return uw::_URC_NORMAL_STOP; -+ } -+ - let mut ip_before_insn = 0; - let mut ip = unsafe { - uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void -@@ -94,14 +98,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context, - unsafe { uw::_Unwind_FindEnclosingFunction(ip) } - }; - -- if cx.idx < cx.frames.len() { -- cx.frames[cx.idx] = Frame { -- symbol_addr: symaddr as *mut u8, -- exact_position: ip as *mut u8, -- inline_context: 0, -- }; -- cx.idx += 1; -- } -+ cx.frames[cx.idx] = Frame { -+ symbol_addr: symaddr as *mut u8, -+ exact_position: ip as *mut u8, -+ inline_context: 0, -+ }; -+ cx.idx += 1; - - uw::_URC_NO_REASON - } --- -2.17.1 - diff --git a/rust-52876-const-endianess.patch b/rust-52876-const-endianess.patch deleted file mode 100644 index 1e844e8..0000000 --- a/rust-52876-const-endianess.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 1ea2765918d1212a07e1359537470c477d82a681 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Mon, 30 Jul 2018 13:08:56 -0700 -Subject: [PATCH] run-pass/const-endianness: negate before to_le() - -`const LE_I128` needs parentheses to negate the value *before* calling -`to_le()`, otherwise it doesn't match the operations performed in the -black-boxed part of the test. This only makes a tangible difference on -big-endian targets. ---- - src/test/run-pass/const-endianess.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/test/run-pass/const-endianess.rs b/src/test/run-pass/const-endianess.rs -index fa34b49210a6..95c738d3ec49 100644 ---- a/src/test/run-pass/const-endianess.rs -+++ b/src/test/run-pass/const-endianess.rs -@@ -25,7 +25,7 @@ fn main() { - #[cfg(not(target_arch = "asmjs"))] - { - const BE_U128: u128 = 999999u128.to_be(); -- const LE_I128: i128 = -999999i128.to_le(); -+ const LE_I128: i128 = (-999999i128).to_le(); - assert_eq!(BE_U128, b(999999u128).to_be()); - assert_eq!(LE_I128, b(-999999i128).to_le()); - } diff --git a/rust.spec b/rust.spec index 627007d..ac9af88 100644 --- a/rust.spec +++ b/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.28.0 -%global bootstrap_cargo 1.28.0 +%global bootstrap_rust 1.29.0 +%global bootstrap_cargo 1.29.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-08-02 +%global bootstrap_date 2018-09-13 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -55,15 +55,15 @@ # Some sub-packages are versioned independently of the rust compiler and runtime itself. # Also beware that if any of these are not changed in a version bump, then the release # number should still increase, not be reset to 1! -%global rustc_version 1.29.0 -%global cargo_version 1.29.0 -%global rustfmt_version 0.99.1 -%global rls_version 0.130.0 +%global rustc_version 1.30.0 +%global cargo_version 1.30.0 +%global rustfmt_version 0.99.4 +%global rls_version 0.130.5 %global clippy_version 0.0.212 Name: rust Version: %{rustc_version} -Release: 0.1.beta.14%{?dist} +Release: 0.1.beta.2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -77,15 +77,6 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/52876 -Patch1: rust-52876-const-endianess.patch - -# https://github.com/rust-lang/rust/pull/53436 -Patch2: 0001-std-stop-backtracing-when-the-frames-are-full.patch - -# https://github.com/rust-lang/rust/pull/53437 -Patch3: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch - # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -409,10 +400,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 - %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure %endif @@ -427,15 +414,15 @@ rm -rf src/llvm/ # 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 + # extract bundled licenses for packaging sed -e '/*\//q' src/libbacktrace/backtrace.h \ >src/libbacktrace/LICENSE-libbacktrace -# This tests a problem of exponential growth, which seems to be less-reliably -# fixed when running on older LLVM and/or some arches. Just skip it for now. -sed -i.ignore -e '1i // ignore-test may still be exponential...' \ - src/test/run-pass/issue-41696.rs - %if %{with bundled_llvm} && 0%{?epel} mkdir -p cmake-bin ln -s /usr/bin/cmake3 cmake-bin/cmake @@ -689,6 +676,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Sep 20 2018 Josh Stone - 1.30.0-0.1.beta.2 +- beta test + * Thu Sep 13 2018 Josh Stone - 1.29.0-1 - Update to 1.29.0. - Add a clippy-preview subpackage From 6af1fde79bbdc69b1ff5242bac4491153fbcfad7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 3 Dec 2018 14:58:10 -0800 Subject: [PATCH 36/59] beta test --- rust.spec | 34 +++++++++++++++++--------- rustfmt-bytecount-no-simd.patch | 43 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 11 deletions(-) create mode 100644 rustfmt-bytecount-no-simd.patch diff --git a/rust.spec b/rust.spec index f0bb431..4c38330 100644 --- a/rust.spec +++ b/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.29.2 -%global bootstrap_cargo 1.29.0 +%global bootstrap_rust 1.30.0 +%global bootstrap_cargo 1.30.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-10-12 +%global bootstrap_date 2018-10-25 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -55,15 +55,15 @@ # Some sub-packages are versioned independently of the rust compiler and runtime itself. # Also beware that if any of these are not changed in a version bump, then the release # number should still increase, not be reset to 1! -%global rustc_version 1.30.1 -%global cargo_version 1.30.0 -%global rustfmt_version 0.99.4 -%global rls_version 0.130.5 +%global rustc_version 1.31.0 +%global cargo_version 1.31.0 +%global rustfmt_version 1.0.0 +%global rls_version 1.31.6 %global clippy_version 0.0.212 Name: rust Version: %{rustc_version} -Release: 7%{?dist} +Release: 0.1.beta.17%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -77,6 +77,10 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# rustfmt->bytecount->simd only works on i686, x86_64, and aarch64 +# https://github.com/rust-lang/rust/issues/56261 +Patch1: rustfmt-bytecount-no-simd.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -157,7 +161,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 7.0 +Provides: bundled(llvm) = 8.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} @@ -359,7 +363,6 @@ reformatting, and code completion, and enables renaming and refactorings. %package -n clippy-preview Summary: Lints to catch common mistakes and improve your Rust code Version: %{clippy_version} -License: MPLv2.0 Provides: clippy = %{clippy_version} Requires: cargo # /usr/bin/clippy-driver is dynamically linked against internal rustc libs @@ -400,6 +403,12 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} +# rustfmt->bytecount->simd only works on i686, x86_64, and aarch64 +# https://github.com/rust-lang/rust/issues/56261 +%ifnarch i686 x86_64 aarch64 +%patch1 -p0 +%endif + %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure %endif @@ -669,7 +678,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %{_bindir}/cargo-clippy %{_bindir}/clippy-driver %doc src/tools/clippy/{README.md,CHANGELOG.md} -%license src/tools/clippy/LICENSE +%license src/tools/clippy/LICENSE-{APACHE,MIT} %files src @@ -682,6 +691,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Sat Nov 17 2018 Josh Stone - 1.31.0-0.1.beta.13 +- beta test + * Thu Nov 08 2018 Josh Stone - 1.30.1-7 - Update to 1.30.1. diff --git a/rustfmt-bytecount-no-simd.patch b/rustfmt-bytecount-no-simd.patch new file mode 100644 index 0000000..7f215c9 --- /dev/null +++ b/rustfmt-bytecount-no-simd.patch @@ -0,0 +1,43 @@ +--- src/tools/rustfmt/Cargo.toml 2018-11-25 01:44:10.000000000 -0800 ++++ src/tools/rustfmt/Cargo.toml 2018-11-26 14:57:07.921495841 -0800 +@@ -51,7 +51,7 @@ + rustc-ap-syntax = "297.0.0" + rustc-ap-syntax_pos = "297.0.0" + failure = "0.1.1" +-bytecount = { version = "0.3", features = ["simd-accel"] } ++bytecount = { version = "0.3", features = [] } + + # A noop dependency that changes in the Rust repository, it's a bit of a hack. + # See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` +--- src/Cargo.lock 2018-11-25 01:42:12.000000000 -0800 ++++ src/Cargo.lock 2018-11-26 15:21:01.917516541 -0800 +@@ -182,9 +182,6 @@ + name = "bytecount" + version = "0.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "simd 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +-] + + [[package]] + name = "byteorder" +@@ -2651,11 +2648,6 @@ + source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] +-name = "simd" +-version = "0.2.3" +-source = "registry+https://github.com/rust-lang/crates.io-index" +- +-[[package]] + name = "siphasher" + version = "0.2.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -3396,7 +3388,6 @@ + "checksum serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "bb47a3d5c84320222f66d7db21157c4a7407755de41798f9b4c1c40593397b1a" + "checksum shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9" + "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" +-"checksum simd 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0048b17eb9577ac545c61d85c3559b41dfb4cbea41c9bd9ca6a4f73ff05fda84" + "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" + "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" + "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" From d201a25c9405c2614c3ef460d268935b6ee30b8f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 9 Jan 2019 17:11:56 -0800 Subject: [PATCH 37/59] beta test --- ...Deal-with-EINTR-in-net-timeout-tests.patch | 118 ------------------ ...-the-target-triple-from-rustc-itself.patch | 90 +++++++++++++ rust.spec | 29 +++-- 3 files changed, 104 insertions(+), 133 deletions(-) delete mode 100644 0001-Deal-with-EINTR-in-net-timeout-tests.patch create mode 100644 0001-Try-to-get-the-target-triple-from-rustc-itself.patch diff --git a/0001-Deal-with-EINTR-in-net-timeout-tests.patch b/0001-Deal-with-EINTR-in-net-timeout-tests.patch deleted file mode 100644 index 7e49746..0000000 --- a/0001-Deal-with-EINTR-in-net-timeout-tests.patch +++ /dev/null @@ -1,118 +0,0 @@ -From f107514aef0b25b0d959941df1e45b18a478151b Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 30 Nov 2018 15:33:40 -0800 -Subject: [PATCH] Deal with EINTR in net timeout tests - -We've seen sporadic QE failures in the timeout tests on this assertion: - - assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); - -So there's an error, but not either of the expected kinds. Adding a -format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). - -For the cases that were using `read`, we can just use `read_exact` to -keep trying after interruption. For those using `recv_from`, we have to -manually loop until we get a non-interrupted result. ---- - src/libstd/net/tcp.rs | 10 ++++++---- - src/libstd/net/udp.rs | 20 ++++++++++++++++---- - src/libstd/sys/unix/ext/net.rs | 10 ++++++---- - 3 files changed, 28 insertions(+), 12 deletions(-) - -diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs -index ad212a547579..be797803233a 100644 ---- a/src/libstd/net/tcp.rs -+++ b/src/libstd/net/tcp.rs -@@ -1548,8 +1548,9 @@ mod tests { - - let mut buf = [0; 10]; - let start = Instant::now(); -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - assert!(start.elapsed() > Duration::from_millis(400)); - drop(listener); - } -@@ -1570,8 +1571,9 @@ mod tests { - assert_eq!(b"hello world", &buf[..]); - - let start = Instant::now(); -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - assert!(start.elapsed() > Duration::from_millis(400)); - drop(listener); - } -diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs -index 0ebe3284b4f0..fc68abae05a0 100644 ---- a/src/libstd/net/udp.rs -+++ b/src/libstd/net/udp.rs -@@ -1030,8 +1030,14 @@ mod tests { - let mut buf = [0; 10]; - - let start = Instant::now(); -- let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ loop { -+ let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -+ if kind != ErrorKind::Interrupted { -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); -+ break; -+ } -+ } - assert!(start.elapsed() > Duration::from_millis(400)); - } - -@@ -1049,8 +1055,14 @@ mod tests { - assert_eq!(b"hello world", &buf[..]); - - let start = Instant::now(); -- let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -- assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); -+ loop { -+ let kind = stream.recv_from(&mut buf).err().expect("expected error").kind(); -+ if kind != ErrorKind::Interrupted { -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); -+ break; -+ } -+ } - assert!(start.elapsed() > Duration::from_millis(400)); - } - -diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs -index 55f43ccd7db4..737437c76b7c 100644 ---- a/src/libstd/sys/unix/ext/net.rs -+++ b/src/libstd/sys/unix/ext/net.rs -@@ -1654,8 +1654,9 @@ mod test { - or_panic!(stream.set_read_timeout(Some(Duration::from_millis(1000)))); - - let mut buf = [0; 10]; -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - } - - #[test] -@@ -1675,8 +1676,9 @@ mod test { - or_panic!(stream.read(&mut buf)); - assert_eq!(b"hello world", &buf[..]); - -- let kind = stream.read(&mut buf).err().expect("expected error").kind(); -- assert!(kind == io::ErrorKind::WouldBlock || kind == io::ErrorKind::TimedOut); -+ let kind = stream.read_exact(&mut buf).err().expect("expected error").kind(); -+ assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut, -+ "unexpected_error: {:?}", kind); - } - - // Ensure the `set_read_timeout` and `set_write_timeout` calls return errors --- -2.19.1 - diff --git a/0001-Try-to-get-the-target-triple-from-rustc-itself.patch b/0001-Try-to-get-the-target-triple-from-rustc-itself.patch new file mode 100644 index 0000000..90f3115 --- /dev/null +++ b/0001-Try-to-get-the-target-triple-from-rustc-itself.patch @@ -0,0 +1,90 @@ +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/rust.spec b/rust.spec index 49c145f..aca3acb 100644 --- a/rust.spec +++ b/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.30.0 -%global bootstrap_cargo 1.30.0 +%global bootstrap_rust 1.31.1 +%global bootstrap_cargo 1.31.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-10-25 +%global bootstrap_date 2018-12-20 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -55,15 +55,15 @@ # Some sub-packages are versioned independently of the rust compiler and runtime itself. # Also beware that if any of these are not changed in a version bump, then the release # number should still increase, not be reset to 1! -%global rustc_version 1.31.1 -%global cargo_version 1.31.0 +%global rustc_version 1.32.0 +%global cargo_version 1.32.0 %global rustfmt_version 1.0.0 %global rls_version 1.31.7 %global clippy_version 0.0.212 Name: rust Version: %{rustc_version} -Release: 9%{?dist} +Release: 0.1.beta.12%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -77,8 +77,8 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/56394 -Patch1: 0001-Deal-with-EINTR-in-net-timeout-tests.patch +# https://github.com/rust-dev-tools/rls-analysis/pull/160 +Patch1: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -345,7 +345,6 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration Version: %{rls_version} -Provides: rls = %{rls_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 %endif @@ -370,7 +369,6 @@ reformatting, and code completion, and enables renaming and refactorings. %package -n clippy Summary: Lints to catch common mistakes and improve your Rust code Version: %{clippy_version} -Provides: clippy = %{clippy_version} Requires: cargo # /usr/bin/clippy-driver is dynamically linked against internal rustc libs Requires: %{name}%{?_isa} = %{rustc_version}-%{release} @@ -414,15 +412,14 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} +pushd vendor/rls-analysis %patch1 -p1 +popd %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure %endif -# We're disabling jemalloc, but rust-src still wants it. -# rm -rf src/jemalloc/ - %if %without bundled_llvm rm -rf src/llvm/ %endif @@ -455,7 +452,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ # The configure macro will modify some autoconf-related files, which upsets # cargo when it tries to verify checksums in those files. If we just truncate # that file list, cargo won't have anything to complain about. -find src/vendor -name .cargo-checksum.json \ +find vendor -name .cargo-checksum.json \ -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' @@ -501,7 +498,6 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ %{!?llvm_has_filecheck: --disable-codegen-tests} \ %{!?with_llvm_static: --enable-llvm-link-shared } } \ - --disable-jemalloc \ --disable-rpath \ %{enable_debuginfo} \ --enable-extended \ @@ -699,6 +695,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed Jan 09 2019 Josh Stone - 1.32.0-0.1.beta.12 +- beta test + * Mon Jan 07 2019 Josh Stone - 1.31.1-9 - Update to 1.31.1 for RLS fixes. From cab102f808b1427b2fa78845f0896960e7d8a0d5 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 16 Jan 2019 14:05:18 -0800 Subject: [PATCH 38/59] Drop the subpackage versions --- rust.spec | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/rust.spec b/rust.spec index aca3acb..44dae55 100644 --- a/rust.spec +++ b/rust.spec @@ -52,17 +52,8 @@ %bcond_with lldb %endif -# Some sub-packages are versioned independently of the rust compiler and runtime itself. -# Also beware that if any of these are not changed in a version bump, then the release -# number should still increase, not be reset to 1! -%global rustc_version 1.32.0 -%global cargo_version 1.32.0 -%global rustfmt_version 1.0.0 -%global rls_version 1.31.7 -%global clippy_version 0.0.212 - Name: rust -Version: %{rustc_version} +Version: 1.32.0 Release: 0.1.beta.12%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -71,7 +62,7 @@ URL: https://www.rust-lang.org ExclusiveArch: %{rust_arches} %if "%{channel}" == "stable" -%global rustc_package rustc-%{rustc_version}-src +%global rustc_package rustc-%{version}-src %else %global rustc_package rustc-%{channel}-src %endif @@ -124,10 +115,10 @@ Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} %else BuildRequires: cargo >= %{bootstrap_cargo} %if 0%{?fedora} >= 27 -BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{rustc_version}) +BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) %else BuildRequires: %{name} >= %{bootstrap_rust} -BuildConflicts: %{name} > %{rustc_version} +BuildConflicts: %{name} > %{version} %endif %global local_rust_root %{_prefix} %endif @@ -190,11 +181,11 @@ Provides: bundled(libbacktrace) = 8.1.0 Provides: bundled(miniz) = 1.16~beta+r1 # Virtual provides for folks who attempt "dnf install rustc" -Provides: rustc = %{rustc_version}-%{release} -Provides: rustc%{?_isa} = %{rustc_version}-%{release} +Provides: rustc = %{version}-%{release} +Provides: rustc%{?_isa} = %{version}-%{release} # Always require our exact standard library -Requires: %{name}-std-static%{?_isa} = %{rustc_version}-%{release} +Requires: %{name}-std-static%{?_isa} = %{version}-%{release} # The C compiler is needed at runtime just for linking. Someday rustc might # invoke the linker directly, and then we'll only need binutils. @@ -260,7 +251,7 @@ This package includes the common functionality for %{name}-gdb and %{name}-lldb. Summary: GDB pretty printers for Rust BuildArch: noarch Requires: gdb -Requires: %{name}-debugger-common = %{rustc_version}-%{release} +Requires: %{name}-debugger-common = %{version}-%{release} %description gdb This package includes the rust-gdb script, which allows easier debugging of Rust @@ -277,7 +268,7 @@ Summary: LLDB pretty printers for Rust Requires: lldb Requires: python2-lldb -Requires: %{name}-debugger-common = %{rustc_version}-%{release} +Requires: %{name}-debugger-common = %{version}-%{release} %description lldb This package includes the rust-lldb script, which allows easier debugging of Rust @@ -300,7 +291,6 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool -Version: %{cargo_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 %endif @@ -319,11 +309,10 @@ and ensure that you'll always get a repeatable build. %package -n cargo-doc Summary: Documentation for Cargo -Version: %{cargo_version} BuildArch: noarch # Cargo no longer builds its own documentation # https://github.com/rust-lang/cargo/pull/4904 -Requires: rust-doc = %{rustc_version}-%{release} +Requires: rust-doc = %{version}-%{release} %description -n cargo-doc This package includes HTML documentation for Cargo. @@ -331,12 +320,11 @@ This package includes HTML documentation for Cargo. %package -n rustfmt Summary: Tool to find and fix Rust formatting issues -Version: %{rustfmt_version} Requires: cargo # The component/package was rustfmt-preview until Rust 1.31. Obsoletes: rustfmt-preview < 1.0.0 -Provides: rustfmt-preview = %{rustfmt_version}-%{release} +Provides: rustfmt-preview = %{version}-%{release} %description -n rustfmt A tool for formatting Rust code according to style guidelines. @@ -344,7 +332,6 @@ A tool for formatting Rust code according to style guidelines. %package -n rls Summary: Rust Language Server for IDE integration -Version: %{rls_version} %if %with bundled_libgit2 Provides: bundled(libgit2) = 0.27 %endif @@ -353,11 +340,11 @@ Provides: bundled(libssh2) = 1.8.1~dev %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs -Requires: %{name}%{?_isa} = %{rustc_version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} # The component/package was rls-preview until Rust 1.31. Obsoletes: rls-preview < 1.31.6 -Provides: rls-preview = %{rls_version}-%{release} +Provides: rls-preview = %{version}-%{release} %description -n rls The Rust Language Server provides a server that runs in the background, @@ -368,14 +355,13 @@ reformatting, and code completion, and enables renaming and refactorings. %package -n clippy Summary: Lints to catch common mistakes and improve your Rust code -Version: %{clippy_version} Requires: cargo # /usr/bin/clippy-driver is dynamically linked against internal rustc libs -Requires: %{name}%{?_isa} = %{rustc_version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} # The component/package was clippy-preview until Rust 1.31. Obsoletes: clippy-preview <= 0.0.212 -Provides: clippy-preview = %{clippy_version}-%{release} +Provides: clippy-preview = %{version}-%{release} %description -n clippy A collection of lints to catch common mistakes and improve your Rust code. @@ -392,7 +378,7 @@ useful as a reference for code completion tools in various editors. %package analysis Summary: Compiler analysis data for the Rust standard library -Requires: rust-std-static%{?_isa} = %{rustc_version}-%{release} +Requires: rust-std-static%{?_isa} = %{version}-%{release} %description analysis This package contains analysis data files produced with rustc's -Zsave-analysis From 4d9af19061b5c1b1c50561fd9cc9dfa74c45af56 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 26 Feb 2019 09:33:55 -0800 Subject: [PATCH 39/59] beta test --- ...e.py-try-import-_thread-for-Python-3.patch | 33 ------------------ ...rust-gdb-relax-the-GDB-version-regex.patch | 30 ++++++++++++++++ rust-pr57840-llvm7-debuginfo-variants.patch | 32 +++++++++++++++++ rust.spec | 34 ++++++++++++------- 4 files changed, 83 insertions(+), 46 deletions(-) delete mode 100644 0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch create mode 100644 0001-rust-gdb-relax-the-GDB-version-regex.patch create mode 100644 rust-pr57840-llvm7-debuginfo-variants.patch diff --git a/0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch b/0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch deleted file mode 100644 index 78b84c2..0000000 --- a/0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d9ddc39052c91568936427e3dee087b608140cf4 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Tue, 8 Jan 2019 13:19:50 -0800 -Subject: [PATCH] lldb_batchmode.py: try `import _thread` for Python 3 - ---- - src/etc/lldb_batchmode.py | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/src/etc/lldb_batchmode.py b/src/etc/lldb_batchmode.py -index 6b4c44806740..537b419b3279 100644 ---- a/src/etc/lldb_batchmode.py -+++ b/src/etc/lldb_batchmode.py -@@ -18,10 +18,15 @@ import lldb - import os - import sys - import threading --import thread - import re - import time - -+try: -+ import thread -+except ModuleNotFoundError: -+ # The `thread` module was renamed to `_thread` in Python 3. -+ import _thread as thread -+ - # Set this to True for additional output - DEBUG_OUTPUT = False - --- -2.20.1 - diff --git a/0001-rust-gdb-relax-the-GDB-version-regex.patch b/0001-rust-gdb-relax-the-GDB-version-regex.patch new file mode 100644 index 0000000..6905230 --- /dev/null +++ b/0001-rust-gdb-relax-the-GDB-version-regex.patch @@ -0,0 +1,30 @@ +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/rust-pr57840-llvm7-debuginfo-variants.patch b/rust-pr57840-llvm7-debuginfo-variants.patch new file mode 100644 index 0000000..71996bc --- /dev/null +++ b/rust-pr57840-llvm7-debuginfo-variants.patch @@ -0,0 +1,32 @@ +commit ab998a2eeb2bcdc69ce70c814af97f0d1302a404 (from d17f62d857c70508efbf60be41135880bcd2e062) +Merge: d17f62d857c7 9452a8dfa3ba +Author: Mazdak Farrokhzad +Date: Thu Jan 24 00:20:00 2019 +0100 + + Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic + + Fix issue 57762 + + against a stock LLVM 7. LLVM 7 was released without a necessary fix + for a bug in the DWARF discriminant code. + + This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. + + Closes #57762 + +diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs +index 6deedd0b5ea3..9f63038c3623 100644 +--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs ++++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs +@@ -1164,7 +1164,10 @@ 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. + return cx.sess().target.target.options.is_like_msvc +- || llvm_util::get_major_version() < 7; ++ // LLVM version 7 did not release with an important bug fix; ++ // but the required patch is in the LLVM 8. Rust LLVM reports ++ // 8 as well. ++ || llvm_util::get_major_version() < 8; + } + + // Describes the members of an enum value: An enum is described as a union of diff --git a/rust.spec b/rust.spec index e6ff826..25173c7 100644 --- a/rust.spec +++ b/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.31.1 -%global bootstrap_cargo 1.31.0 +%global bootstrap_rust 1.32.0 +%global bootstrap_cargo 1.32.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2018-12-20 +%global bootstrap_date 2019-01-17 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -53,8 +53,8 @@ %endif Name: rust -Version: 1.32.0 -Release: 2%{?dist} +Version: 1.33.0 +Release: 0.1.beta.9%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -71,8 +71,12 @@ 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/57453 -Patch2: 0001-lldb_batchmode.py-try-import-_thread-for-Python-3.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 # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -166,7 +170,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 5.0 +BuildRequires: %{llvm}-devel >= 6.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -181,7 +185,7 @@ BuildRequires: gdb # TODO: work on unbundling these! Provides: bundled(libbacktrace) = 8.1.0 -Provides: bundled(miniz) = 1.16~beta+r1 +Provides: bundled(miniz) = 2.0.7 # Virtual provides for folks who attempt "dnf install rustc" Provides: rustc = %{version}-%{release} @@ -405,6 +409,7 @@ pushd vendor/rls-analysis %patch1 -p1 popd %patch2 -p1 +%patch3 -p1 -R %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -422,9 +427,8 @@ rm -rf src/tools/clang rm -rf src/tools/lld rm -rf src/tools/lldb -# extract bundled licenses for packaging -sed -e '/*\//q' src/libbacktrace/backtrace.h \ - >src/libbacktrace/LICENSE-libbacktrace +# rename bundled license for packaging +cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} %if %{with bundled_llvm} && 0%{?epel} mkdir -p cmake-bin @@ -586,7 +590,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files %license COPYRIGHT LICENSE-APACHE LICENSE-MIT -%license src/libbacktrace/LICENSE-libbacktrace +%license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace %doc README.md %{_bindir}/rustc %{_bindir}/rustdoc @@ -598,6 +602,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so %{rustlibdir}/%{rust_triple}/codegen-backends/ +%exclude %{_bindir}/{cargo-,}miri %files std-static @@ -685,6 +690,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Thu Feb 21 2019 Josh Stone - 1.33.0-0.1.beta.9 +- beta test + * Sat Feb 02 2019 Fedora Release Engineering - 1.32.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From a103b2abf4cf7d9e6d9d5230b2c8cebb17de9854 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 6 Mar 2019 16:00:17 -0800 Subject: [PATCH 40/59] beta test --- ...eprecation-fixes-from-commit-b7f030e.patch | 57 ------------ ...-the-target-triple-from-rustc-itself.patch | 90 ------------------- ...rust-gdb-relax-the-GDB-version-regex.patch | 30 ------- rust.spec | 37 +++----- 4 files changed, 14 insertions(+), 200 deletions(-) delete mode 100644 0001-Backport-deprecation-fixes-from-commit-b7f030e.patch delete mode 100644 0001-Try-to-get-the-target-triple-from-rustc-itself.patch delete mode 100644 0001-rust-gdb-relax-the-GDB-version-regex.patch diff --git a/0001-Backport-deprecation-fixes-from-commit-b7f030e.patch b/0001-Backport-deprecation-fixes-from-commit-b7f030e.patch deleted file mode 100644 index 6e51ef3..0000000 --- a/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/0001-Try-to-get-the-target-triple-from-rustc-itself.patch b/0001-Try-to-get-the-target-triple-from-rustc-itself.patch deleted file mode 100644 index 90f3115..0000000 --- a/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/0001-rust-gdb-relax-the-GDB-version-regex.patch b/0001-rust-gdb-relax-the-GDB-version-regex.patch deleted file mode 100644 index 6905230..0000000 --- a/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/rust.spec b/rust.spec index daa8057..40d68ee 100644 --- a/rust.spec +++ b/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-25 # 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.0 +Release: 0.1.beta.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,9 @@ 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 - -# https://github.com/rust-lang/rust/issues/58845 -Patch4: 0001-Backport-deprecation-fixes-from-commit-b7f030e.patch +Patch1: rust-pr57840-llvm7-debuginfo-variants.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -164,8 +155,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 @@ -409,12 +399,7 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -pushd vendor/rls-analysis -%patch1 -p1 -popd -%patch2 -p1 -%patch3 -p1 -R -%patch4 -p1 +%patch1 -p1 -R %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -626,6 +611,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %files gdb %{_bindir}/rust-gdb %{rustlibdir}/etc/gdb_*.py* +%exclude %{_bindir}/rust-gdbgui %if %with lldb @@ -642,7 +628,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 @@ -695,6 +683,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed Mar 06 2019 Josh Stone - 1.34.0-0.1.beta.1 +- beta test + * Fri Mar 01 2019 Josh Stone - 1.33.0-2 - Fix deprecations for self-rebuild From 6ca00007e8c72114641317fabe452cdafaa657df Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 18 Mar 2019 22:14:43 -0700 Subject: [PATCH 41/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 40d68ee..04abb62 100644 --- a/rust.spec +++ b/rust.spec @@ -54,7 +54,7 @@ Name: rust Version: 1.34.0 -Release: 0.1.beta.1%{?dist} +Release: 0.1.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -683,7 +683,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Wed Mar 06 2019 Josh Stone - 1.34.0-0.1.beta.1 +* Mon Mar 18 2019 Josh Stone - 1.34.0-0.1.beta.3 - beta test * Fri Mar 01 2019 Josh Stone - 1.33.0-2 From 595faa187452cb2241d66484fa22e4383838f741 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 20 Mar 2019 10:10:26 -0700 Subject: [PATCH 42/59] beta test --- rust.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust.spec b/rust.spec index 04abb62..5accee1 100644 --- a/rust.spec +++ b/rust.spec @@ -12,7 +12,7 @@ %global bootstrap_rust 1.33.0 %global bootstrap_cargo 1.33.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2019-02-25 +%global bootstrap_date 2019-02-28 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -54,7 +54,7 @@ Name: rust Version: 1.34.0 -Release: 0.1.beta.3%{?dist} +Release: 0.1.beta.5%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -683,7 +683,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Mon Mar 18 2019 Josh Stone - 1.34.0-0.1.beta.3 +* Wed Mar 20 2019 Josh Stone - 1.34.0-0.1.beta.5 - beta test * Fri Mar 01 2019 Josh Stone - 1.33.0-2 From f1d7be8f389cc926e0c8de8207a8b105564bd3cb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 26 Mar 2019 14:49:35 -0700 Subject: [PATCH 43/59] bundled LLVM is in src/llvm-project/ now --- rust.spec | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rust.spec b/rust.spec index b9846e9..731bf3e 100644 --- a/rust.spec +++ b/rust.spec @@ -402,17 +402,12 @@ sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./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} From 755e253f6318ad112074cd5af256df48f7b0ef15 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 29 Mar 2019 14:33:55 -0700 Subject: [PATCH 44/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 731bf3e..bbb3588 100644 --- a/rust.spec +++ b/rust.spec @@ -54,7 +54,7 @@ Name: rust Version: 1.34.0 -Release: 0.1.beta.5%{?dist} +Release: 0.1.beta.6%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -671,7 +671,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog -* Wed Mar 20 2019 Josh Stone - 1.34.0-0.1.beta.5 +* Fri Mar 29 2019 Josh Stone - 1.34.0-0.1.beta.6 - beta test * Fri Mar 01 2019 Josh Stone - 1.33.0-2 From 1963761c96308983e46d00a71cc6eaa30e8f4867 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 15 May 2019 16:05:50 -0700 Subject: [PATCH 45/59] beta test --- rust.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rust.spec b/rust.spec index 89d60aa..d44f49e 100644 --- a/rust.spec +++ b/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.33.0 -%global bootstrap_cargo 1.33.0 +%global bootstrap_rust 1.34.0 +%global bootstrap_cargo 1.34.0 %global bootstrap_channel %{bootstrap_rust} -%global bootstrap_date 2019-02-28 +%global bootstrap_date 2019-04-08 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -53,8 +53,8 @@ %endif Name: rust -Version: 1.34.2 -Release: 1 +Version: 1.35.0 +Release: 0.1.beta.7%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -676,6 +676,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Wed May 15 2019 Josh Stone - 1.35.0-0.1.beta.7 +- beta test + * Tue May 14 2019 Josh Stone - 1.34.2-1 - Update to 1.34.2 -- fixes CVE-2019-12083. From c454924baf1ea0092295ef6a85029c565d7b7742 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 12 Aug 2019 16:34:40 -0700 Subject: [PATCH 46/59] beta test --- rust.spec | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/rust.spec b/rust.spec index 893a83f..1ffd774 100644 --- a/rust.spec +++ b/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.35.0 -%global bootstrap_cargo 1.35.0 -%global bootstrap_channel 1.35.0 -%global bootstrap_date 2019-05-23 +%global bootstrap_rust 1.36.0 +%global bootstrap_cargo 1.36.0 +%global bootstrap_channel 1.36.0 +%global bootstrap_date 2019-07-04 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.36.0 -Release: 1%{?dist} +Version: 1.37.0 +Release: 0.1.beta.9%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -285,7 +285,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 0.27 +Provides: bundled(libgit2) = 0.28.2 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.8.1~dev @@ -295,6 +295,11 @@ BuildRequires: git # Cargo is not much use without Rust Requires: rust +# "cargo vendor" is a builtin command starting with 1.37. The Obsoletes and +# Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too +Obsoletes: cargo-vendor <= 0.1.23 +Provides: cargo-vendor = %{version}-%{release} + %description -n cargo Cargo is a tool that allows Rust projects to declare their various dependencies and ensure that you'll always get a repeatable build. @@ -326,7 +331,7 @@ 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.27 +Provides: bundled(libgit2) = 0.28.2 %endif %if %with bundled_libssh2 Provides: bundled(libssh2) = 1.8.1~dev @@ -404,6 +409,24 @@ rm -rf src/llvm-project/ # We never enable emscripten. rm -rf src/llvm-emscripten/ +# Remove other unused vendored libraries +rm -rf vendor/curl-sys/curl/ +rm -rf vendor/jemalloc-sys/jemalloc/ +rm -rf vendor/libz-sys/src/zlib/ +rm -rf vendor/lzma-sys/xz-*/ +rm -rf vendor/openssl-src/openssl/ + +%if %without bundled_libgit2 +rm -rf vendor/libgit2-sys/libgit2/ +%endif + +%if %without bundled_libssh2 +rm -rf vendor/libssh2-sys/libssh2/ +%endif + +# This only affects the transient rust-installer, but let it use our dynamic xz-libs +sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs + # rename bundled license for packaging cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} @@ -453,12 +476,12 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7) # Older rpmbuild didn't work with partial debuginfo coverage. %global debug_package %{nil} -%define enable_debuginfo --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines +%define enable_debuginfo --debuginfo-level=0 %else -%define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines +%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2 %endif %else -%define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines +%define enable_debuginfo --debuginfo-level=2 %endif # We want the best optimization for std, but it caused problems for rpm-ostree @@ -471,6 +494,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ + --python=%{python} \ --local-rust-root=%{local_rust_root} \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ %{!?llvm_has_filecheck: --disable-codegen-tests} \ @@ -676,6 +700,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Mon Aug 12 2019 Josh Stone - 1.37.0-0.1.beta.9 +- beta test + * Thu Jul 04 2019 Josh Stone - 1.36.0-1 - Update to 1.36.0. From 8ee38f78205d973c35aa1cc883ffe496d9f95c4c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 20 Sep 2019 09:59:17 -0700 Subject: [PATCH 47/59] beta test --- rust.spec | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/rust.spec b/rust.spec index 5ad3c1f..130bfa5 100644 --- a/rust.spec +++ b/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.36.0 -%global bootstrap_cargo 1.36.0 -%global bootstrap_channel 1.36.0 -%global bootstrap_date 2019-07-04 +%global bootstrap_rust 1.37.0 +%global bootstrap_cargo 1.37.0 +%global bootstrap_channel 1.37.0 +%global bootstrap_date 2019-08-15 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.37.0 -Release: 1%{?dist} +Version: 1.38.0 +Release: 0.1.beta.6%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -449,6 +449,10 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ find vendor -name .cargo-checksum.json \ -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' +# Sometimes Rust sources start with #![...] attributes, and "smart" editors think +# it's a shebang and make them executable. Then brp-mangle-shebangs gets upset... +find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' + %build @@ -700,6 +704,9 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Fri Sep 20 2019 Josh Stone - 1.38.0-0.1.beta.6 +- beta test + * Thu Aug 15 2019 Josh Stone - 1.37.0-1 - Update to 1.37.0. From 475b17168746852d8eaa8783a648bc55e3592d3d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 6 Nov 2019 13:51:31 -0800 Subject: [PATCH 48/59] beta test --- ...-WIP-minimize-the-rust-std-component.patch | 74 --- rust-pr65474-split-rustc-dev.patch | 479 ++++++++++++++++++ rust.spec | 20 +- rustc-1.38.0-rebuild-bootstrap.patch | 10 - 4 files changed, 487 insertions(+), 96 deletions(-) delete mode 100644 0001-WIP-minimize-the-rust-std-component.patch create mode 100644 rust-pr65474-split-rustc-dev.patch delete mode 100644 rustc-1.38.0-rebuild-bootstrap.patch diff --git a/0001-WIP-minimize-the-rust-std-component.patch b/0001-WIP-minimize-the-rust-std-component.patch deleted file mode 100644 index 04be717..0000000 --- a/0001-WIP-minimize-the-rust-std-component.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 2bf05f208272cd58c57f4d7d8d0e10fdb22e8719 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Fri, 27 Sep 2019 12:33:08 -0700 -Subject: [PATCH] [WIP] minimize the rust-std component - ---- - src/bootstrap/dist.rs | 45 +++++++++++++++---------------------------- - 1 file changed, 16 insertions(+), 29 deletions(-) - -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index 552965863d10..76fbd07f9fb5 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -667,41 +667,28 @@ impl Step for Std { - return distdir(builder).join(format!("{}-{}.tar.gz", name, target)); - } - -- // 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 { -- if builder.no_std(target) == Some(true) { -- // the `test` doesn't compile for no-std targets -- builder.ensure(compile::Std { compiler, target }); -- } else { -- builder.ensure(compile::Test { compiler, target }); -- } -- } -+ builder.ensure(compile::Std { compiler, target }); -+ builder.ensure(compile::Test { 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); -+ let dst = image.join("lib/rustlib").join(target).join("lib"); - 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 -- } -+ -+ let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); -+ let stamp = dbg!(compile::libstd_stamp(builder, compiler_to_use, target)); -+ for (path, host) in builder.read_stamp_file(&stamp) { -+ if !host { -+ builder.copy(&path, &dst.join(path.file_name().unwrap())); - } -- true -- }); -+ } -+ let stamp = dbg!(compile::libtest_stamp(builder, compiler_to_use, target)); -+ for (path, host) in builder.read_stamp_file(&stamp) { -+ if !host { -+ builder.copy(&path, &dst.join(path.file_name().unwrap())); -+ } -+ } - - let mut cmd = rust_installer(builder); - cmd.arg("generate") --- -2.21.0 - diff --git a/rust-pr65474-split-rustc-dev.patch b/rust-pr65474-split-rustc-dev.patch new file mode 100644 index 0000000..7e1c57a --- /dev/null +++ b/rust-pr65474-split-rustc-dev.patch @@ -0,0 +1,479 @@ +From 8e0007f829661e57d008d2e908c95f6e84b04b25 Mon Sep 17 00:00:00 2001 +From: bors +Date: Thu, 24 Oct 2019 07:27:00 +0000 +Subject: [PATCH] Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, + r=pietroalbini + +Split the rustc target libraries into separate rustc-dev component + +This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR. + +The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case. + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index b8071b98f707..2748903f2d47 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/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 5074b035789a..da8d43ed49b7 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 +@@ -306,7 +314,7 @@ pub struct StartupObjects { + } + + impl Step for StartupObjects { +- type Output = (); ++ type Output = Vec; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/rtstartup") +@@ -325,13 +333,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); +@@ -350,7 +360,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() { +@@ -358,8 +370,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 + } + } + +@@ -437,6 +453,7 @@ impl Step for Rustc { + cargo, + vec![], + &librustc_stamp(builder, compiler, target), ++ vec![], + false); + + builder.ensure(RustcLink { +@@ -585,7 +602,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; + } +@@ -941,6 +958,7 @@ pub fn run_cargo(builder: &Builder<'_>, + cargo: Cargo, + tail_args: Vec, + stamp: &Path, ++ additional_target_deps: Vec, + is_check: bool) + -> Vec + { +@@ -1057,6 +1075,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/dist.rs b/src/bootstrap/dist.rs +index 514ad1144491..93143570b0fe 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/bootstrap/lib.rs b/src/bootstrap/lib.rs +index a182405f3b2d..d1cf1cbca784 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -1137,6 +1137,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/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs +index f41e7dd17ede..c0d2deab2f8b 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); +@@ -426,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) { +@@ -481,6 +489,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 +515,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 +@@ -534,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, diff --git a/rust.spec b/rust.spec index 7052322..27005af 100644 --- a/rust.spec +++ b/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.37.0 -%global bootstrap_cargo 1.37.0 -%global bootstrap_channel 1.37.0 -%global bootstrap_date 2019-08-15 +%global bootstrap_rust 1.38.0 +%global bootstrap_cargo 1.38.0 +%global bootstrap_channel 1.38.0 +%global bootstrap_date 2019-09-26 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.38.0 -Release: 2%{?dist} +Version: 1.39.0 +Release: 0.1.beta.8%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,12 +67,9 @@ 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 -# Mask a warning-as-error when rebuilding 1.38 with 1.38 -Patch2: rustc-1.38.0-rebuild-bootstrap.patch - # Reduce the size of rust-std -# https://github.com/rust-lang/rust/pull/64823 -Patch3: 0001-WIP-minimize-the-rust-std-component.patch +# https://github.com/rust-lang/rust/pull/65474 +Patch2: rust-pr65474-split-rustc-dev.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -405,7 +402,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 -%patch3 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure diff --git a/rustc-1.38.0-rebuild-bootstrap.patch b/rustc-1.38.0-rebuild-bootstrap.patch deleted file mode 100644 index 07f59a0..0000000 --- a/rustc-1.38.0-rebuild-bootstrap.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- rustc-1.38.0-src/src/bootstrap/builder.rs 2019-09-23 14:15:52.000000000 -0700 -+++ rustc-1.38.0-src/src/bootstrap/builder.rs 2019-09-26 10:45:49.663995011 -0700 -@@ -140,6 +140,7 @@ - - impl StepDescription { - fn from() -> StepDescription { -+ #[allow(unused_unsafe)] // for rebuild bootstrapping - StepDescription { - default: S::DEFAULT, - only_hosts: S::ONLY_HOSTS, From 1e2b9b291670c1bf335f8b7abfef8540469706cb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 12 Dec 2019 15:56:21 -0800 Subject: [PATCH 49/59] beta test --- 0001-Hopefully-fix-rustdoc-build.patch | 38 -- ...-67242-ignore-arm-foreign-exceptions.patch | 10 + rust-pr65474-split-rustc-dev.patch | 479 ------------------ rust.spec | 30 +- 4 files changed, 21 insertions(+), 536 deletions(-) delete mode 100644 0001-Hopefully-fix-rustdoc-build.patch create mode 100644 rust-issue-67242-ignore-arm-foreign-exceptions.patch delete mode 100644 rust-pr65474-split-rustc-dev.patch diff --git a/0001-Hopefully-fix-rustdoc-build.patch b/0001-Hopefully-fix-rustdoc-build.patch deleted file mode 100644 index 06ca58e..0000000 --- a/0001-Hopefully-fix-rustdoc-build.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 73369f32621f6a844a80a8513ae3ded901e4a406 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Tue, 5 Nov 2019 11:16:46 -0500 -Subject: [PATCH] Hopefully fix rustdoc build - -It's super unclear why this broke when we switched to beta but not -previously -- but at least it's hopefully fixed now. ---- - src/bootstrap/builder.rs | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 2748903f2d47..2edcef203ad2 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -886,7 +886,18 @@ impl<'a> Builder<'a> { - // things still build right, please do! - match mode { - Mode::Std => metadata.push_str("std"), -- _ => {}, -+ // When we're building rustc tools, they're built with a search path -+ // that contains things built during the rustc build. For example, -+ // bitflags is built during the rustc build, and is a dependency of -+ // rustdoc as well. We're building rustdoc in a different target -+ // directory, though, which means that Cargo will rebuild the -+ // dependency. When we go on to build rustdoc, we'll look for -+ // bitflags, and find two different copies: one built during the -+ // rustc step and one that we just built. This isn't always a -+ // problem, somehow -- not really clear why -- but we know that this -+ // fixes things. -+ Mode::ToolRustc => metadata.push_str("tool-rustc"), -+ _ => {} - } - cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); - --- -2.23.0 - diff --git a/rust-issue-67242-ignore-arm-foreign-exceptions.patch b/rust-issue-67242-ignore-arm-foreign-exceptions.patch new file mode 100644 index 0000000..127c435 --- /dev/null +++ b/rust-issue-67242-ignore-arm-foreign-exceptions.patch @@ -0,0 +1,10 @@ +--- rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile.orig 2019-12-07 18:36:56.000000000 -0800 ++++ rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile 2019-12-12 15:49:24.655515206 -0800 +@@ -1,3 +1,7 @@ ++# ignore-arm ++# ignore-armeb ++# https://github.com/rust-lang/rust/issues/67242 ++ + -include ../tools.mk + + all: foo diff --git a/rust-pr65474-split-rustc-dev.patch b/rust-pr65474-split-rustc-dev.patch deleted file mode 100644 index 7e1c57a..0000000 --- a/rust-pr65474-split-rustc-dev.patch +++ /dev/null @@ -1,479 +0,0 @@ -From 8e0007f829661e57d008d2e908c95f6e84b04b25 Mon Sep 17 00:00:00 2001 -From: bors -Date: Thu, 24 Oct 2019 07:27:00 +0000 -Subject: [PATCH] Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, - r=pietroalbini - -Split the rustc target libraries into separate rustc-dev component - -This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR. - -The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case. - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index b8071b98f707..2748903f2d47 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/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 5074b035789a..da8d43ed49b7 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 -@@ -306,7 +314,7 @@ pub struct StartupObjects { - } - - impl Step for StartupObjects { -- type Output = (); -+ type Output = Vec; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/rtstartup") -@@ -325,13 +333,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); -@@ -350,7 +360,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() { -@@ -358,8 +370,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 - } - } - -@@ -437,6 +453,7 @@ impl Step for Rustc { - cargo, - vec![], - &librustc_stamp(builder, compiler, target), -+ vec![], - false); - - builder.ensure(RustcLink { -@@ -585,7 +602,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; - } -@@ -941,6 +958,7 @@ pub fn run_cargo(builder: &Builder<'_>, - cargo: Cargo, - tail_args: Vec, - stamp: &Path, -+ additional_target_deps: Vec, - is_check: bool) - -> Vec - { -@@ -1057,6 +1075,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/dist.rs b/src/bootstrap/dist.rs -index 514ad1144491..93143570b0fe 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/bootstrap/lib.rs b/src/bootstrap/lib.rs -index a182405f3b2d..d1cf1cbca784 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -1137,6 +1137,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/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs -index f41e7dd17ede..c0d2deab2f8b 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); -@@ -426,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) { -@@ -481,6 +489,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 +515,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 -@@ -534,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, diff --git a/rust.spec b/rust.spec index ab548d7..2a55a97 100644 --- a/rust.spec +++ b/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.38.0 -%global bootstrap_cargo 1.38.0 -%global bootstrap_channel 1.38.0 -%global bootstrap_date 2019-09-26 +%global bootstrap_rust 1.39.0 +%global bootstrap_cargo 1.39.0 +%global bootstrap_channel 1.39.0 +%global bootstrap_date 2019-11-07 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.39.0 -Release: 2%{?dist} +Version: 1.40.0 +Release: 0.1.beta.5%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,17 +67,13 @@ 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 -# Reduce the size of rust-std -# https://github.com/rust-lang/rust/pull/65474 -Patch2: rust-pr65474-split-rustc-dev.patch - -# Fix conflicting libraries of rustc tools -# https://github.com/rust-lang/rust/commit/73369f32621f6a844a80a8513ae3ded901e4a406 -Patch3: 0001-Hopefully-fix-rustdoc-build.patch - # Fix the bindir used by rustdoc to find rustc # https://github.com/rust-lang/rust/pull/66317 -Patch4: rust-pr66317-bindir-relative.patch +Patch2: rust-pr66317-bindir-relative.patch + +# ARM loops when C++ tries to catch and rethrow a Rust exception +# https://github.com/rust-lang/rust/issues/67242 +Patch3: rust-issue-67242-ignore-arm-foreign-exceptions.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -411,7 +407,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 %patch3 -p1 -%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -421,9 +416,6 @@ sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure rm -rf src/llvm-project/ %endif -# We never enable emscripten. -rm -rf src/llvm-emscripten/ - # Remove other unused vendored libraries rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ From f3956f2ed348caba7e51cfb09766a1f6b8d81c3d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 24 Jan 2020 12:14:24 -0800 Subject: [PATCH 50/59] beta test --- ...est-bump-to-stage0-bootstrap-libtest.patch | 32 --------------- ...compiletest-fallout-from-stage0-bump.patch | 24 ++++++++++++ rust-pr57840-llvm7-debuginfo-variants.patch | 2 +- rust-pr66317-bindir-relative.patch | 39 ------------------- rust.spec | 32 +++++++-------- 5 files changed, 38 insertions(+), 91 deletions(-) delete mode 100644 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch create mode 100644 0001-Fix-compiletest-fallout-from-stage0-bump.patch delete mode 100644 rust-pr66317-bindir-relative.patch diff --git a/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch b/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch deleted file mode 100644 index c8062bf..0000000 --- a/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f6832adadb84364ce0c81fa02910b3706f441abc Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Wed, 6 Nov 2019 15:17:02 -0500 -Subject: [PATCH] Compiletest bump to stage0 bootstrap libtest - ---- - src/tools/compiletest/src/main.rs | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs -index 34435819a2c4..b115539b4af3 100644 ---- a/src/tools/compiletest/src/main.rs -+++ b/src/tools/compiletest/src/main.rs -@@ -568,6 +568,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { - skip: vec![], - list: false, - options: test::Options::new(), -+ time_options: None, - } - } - -@@ -703,6 +704,7 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec +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/rust-pr57840-llvm7-debuginfo-variants.patch b/rust-pr57840-llvm7-debuginfo-variants.patch index 71996bc..b1fd427 100644 --- a/rust-pr57840-llvm7-debuginfo-variants.patch +++ b/rust-pr57840-llvm7-debuginfo-variants.patch @@ -29,4 +29,4 @@ index 6deedd0b5ea3..9f63038c3623 100644 + || llvm_util::get_major_version() < 8; } - // Describes the members of an enum value: An enum is described as a union of + // FIXME(eddyb) maybe precompute this? Right now it's computed once diff --git a/rust-pr66317-bindir-relative.patch b/rust-pr66317-bindir-relative.patch deleted file mode 100644 index 71d3b0c..0000000 --- a/rust-pr66317-bindir-relative.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index 2748903f2d47..10d02d6db829 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -1231,7 +1231,8 @@ impl<'a> Builder<'a> { - cargo.arg("--frozen"); - } - -- cargo.env("RUSTC_INSTALL_BINDIR", &self.config.bindir); -+ // Try to use a sysroot-relative bindir, in case it was configured absolutely. -+ cargo.env("RUSTC_INSTALL_BINDIR", self.config.bindir_relative()); - - self.ci_env.force_coloring_in_ci(&mut cargo); - -diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index d1bdfa0a7676..0c03b95c7b25 100644 ---- a/src/bootstrap/config.rs -+++ b/src/bootstrap/config.rs -@@ -647,6 +647,20 @@ impl Config { - config - } - -+ /// Try to find the relative path of `bindir`, otherwise return it in full. -+ pub fn bindir_relative(&self) -> &Path { -+ let bindir = &self.bindir; -+ if bindir.is_absolute() { -+ // Try to make it relative to the prefix. -+ if let Some(prefix) = &self.prefix { -+ if let Ok(stripped) = bindir.strip_prefix(prefix) { -+ return stripped; -+ } -+ } -+ } -+ bindir -+ } -+ - /// Try to find the relative path of `libdir`. - pub fn libdir_relative(&self) -> Option<&Path> { - let libdir = self.libdir.as_ref()?; diff --git a/rust.spec b/rust.spec index a4385bb..0770dd2 100644 --- a/rust.spec +++ b/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.39.0 -%global bootstrap_cargo 1.39.0 -%global bootstrap_channel 1.39.0 -%global bootstrap_date 2019-11-07 +%global bootstrap_rust 1.40.0 +%global bootstrap_cargo 1.40.0 +%global bootstrap_channel 1.40.0 +%global bootstrap_date 2019-12-16 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -21,7 +21,7 @@ %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 6.0+. +# is insufficient. Rust currently requires LLVM 7.0+. %if 0%{?rhel} && !0%{?epel} %bcond_without bundled_llvm %else @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.40.0 -Release: 3%{?dist} +Version: 1.41.0 +Release: 0.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,19 +67,15 @@ 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 the bindir used by rustdoc to find rustc -# https://github.com/rust-lang/rust/pull/66317 -Patch2: rust-pr66317-bindir-relative.patch - # Fix compiletest with newer (local-rebuild) libtest -# https://github.com/rust-lang/rust/pull/66156/commits/f6832adadb84364ce0c81fa02910b3706f441abc -Patch3: 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch +# 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 -Patch4: rust-pr68019-in-tree-compiletest.patch +Patch3: rust-pr68019-in-tree-compiletest.patch # Fix ARM unwinding for foreign-exceptions # https://github.com/rust-lang/rust/pull/67779 -Patch5: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch +Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -161,7 +157,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 8.0.0 +Provides: bundled(llvm) = 9.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} @@ -173,7 +169,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 6.0 +BuildRequires: %{llvm}-devel >= 7.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -414,7 +410,6 @@ test -f '%{local_rust_root}/bin/rustc' %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -628,7 +623,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so -%{rustlibdir}/%{rust_triple}/codegen-backends/ %exclude %{_bindir}/*miri From c60dd26567b672b0f7964df12d2843bb4b2ba112 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 21 Apr 2020 09:41:59 -0700 Subject: [PATCH 51/59] beta test --- 0001-Drop-cfg-bootstrap-code.patch | 25 --- ...0123-ensure-llvm-is-in-the-link-path.patch | 210 ++++++++++++++++++ ...-pr70163-prepare-for-llvm-10-upgrade.patch | 175 +++++++++++++++ ...0591-ensure-llvm-is-in-the-link-path.patch | 40 ++++ rust.spec | 41 ++-- 5 files changed, 445 insertions(+), 46 deletions(-) delete mode 100644 0001-Drop-cfg-bootstrap-code.patch create mode 100644 rust-pr70123-ensure-llvm-is-in-the-link-path.patch create mode 100644 rust-pr70163-prepare-for-llvm-10-upgrade.patch create mode 100644 rust-pr70591-ensure-llvm-is-in-the-link-path.patch diff --git a/0001-Drop-cfg-bootstrap-code.patch b/0001-Drop-cfg-bootstrap-code.patch deleted file mode 100644 index 3d8f202..0000000 --- a/0001-Drop-cfg-bootstrap-code.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 31dcdc9e13c324d33a18db3aed7f4b3208ff3744 Mon Sep 17 00:00:00 2001 -From: Mark Rousskov -Date: Fri, 31 Jan 2020 12:30:17 -0500 -Subject: [PATCH] Drop cfg(bootstrap) code - ---- - src/bootstrap/lib.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 1fee3fd9ac1d..637323331f58 100644 ---- a/src/bootstrap/lib.rs -+++ b/src/bootstrap/lib.rs -@@ -1026,7 +1026,7 @@ impl Build { - } - - fn llvm_link_tools_dynamically(&self, target: Interned) -> bool { -- (target.contains("linux-gnu") || target.contains("apple-darwin")) -+ target.contains("linux-gnu") || target.contains("apple-darwin") - } - - /// Returns the `version` string associated with this compiler for Rust --- -2.24.1 - diff --git a/rust-pr70123-ensure-llvm-is-in-the-link-path.patch b/rust-pr70123-ensure-llvm-is-in-the-link-path.patch new file mode 100644 index 0000000..d076d35 --- /dev/null +++ b/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/rust-pr70163-prepare-for-llvm-10-upgrade.patch b/rust-pr70163-prepare-for-llvm-10-upgrade.patch new file mode 100644 index 0000000..765c2e9 --- /dev/null +++ b/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/rust-pr70591-ensure-llvm-is-in-the-link-path.patch b/rust-pr70591-ensure-llvm-is-in-the-link-path.patch new file mode 100644 index 0000000..9f5722b --- /dev/null +++ b/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/rust.spec b/rust.spec index 9e19e62..b764416 100644 --- a/rust.spec +++ b/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.41.0 -%global bootstrap_cargo 1.41.0 -%global bootstrap_channel 1.41.1 -%global bootstrap_date 2020-02-27 +%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} @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.42.0 -Release: 1%{?dist} +Version: 1.43.0 +Release: 0.1.beta.5%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -67,9 +67,16 @@ 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 1.42 bootstrapping itself -# https://github.com/rust-lang/rust/issues/69953 -Patch2: 0001-Drop-cfg-bootstrap-code.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 + +# Prepare for LLVM 10 upgrade +# https://github.com/rust-lang/rust/pull/70163 +# NOTE: removed a test change that doesn't apply in 1.42, in src/tools/compiletest/src/header/tests.rs +Patch4: rust-pr70163-prepare-for-llvm-10-upgrade.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -157,9 +164,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 @@ -220,10 +224,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 @@ -295,7 +295,7 @@ 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.9.0~dev @@ -341,7 +341,7 @@ 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.9.0~dev @@ -408,6 +408,8 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -475,7 +477,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 @@ -526,7 +527,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 @@ -597,7 +597,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. From 09f0f09852ff381c77e6c615e16b662f1ca57fcc Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 10 Jul 2020 13:42:55 -0700 Subject: [PATCH 52/59] beta test --- ...pr71782-Use-a-non-existent-test-path.patch | 56 ------------------- rust.spec | 23 +++----- 2 files changed, 9 insertions(+), 70 deletions(-) delete mode 100644 rust-pr71782-Use-a-non-existent-test-path.patch diff --git a/rust-pr71782-Use-a-non-existent-test-path.patch b/rust-pr71782-Use-a-non-existent-test-path.patch deleted file mode 100644 index 463cb61..0000000 --- a/rust-pr71782-Use-a-non-existent-test-path.patch +++ /dev/null @@ -1,56 +0,0 @@ -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; 1 warning emitted - --- -2.26.2 - diff --git a/rust.spec b/rust.spec index e771315..432f1ac 100644 --- a/rust.spec +++ b/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.43.1 -%global bootstrap_cargo 1.43.1 -%global bootstrap_channel 1.43.1 -%global bootstrap_date 2020-05-07 +%global bootstrap_rust 1.44.0 +%global bootstrap_cargo 1.44.0 +%global bootstrap_channel 1.44.0 +%global bootstrap_date 2020-06-04 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -21,7 +21,7 @@ %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 7.0+. +# is insufficient. Rust currently requires LLVM 8.0+. %if 0%{?rhel} && !0%{?epel} %bcond_without bundled_llvm %else @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.44.1 -Release: 2%{?dist} +Version: 1.46.0 +Release: 0.1.beta.3%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -63,9 +63,6 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz -# https://github.com/rust-lang/rust/pull/71782 -Patch1: rust-pr71782-Use-a-non-existent-test-path.patch - # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -146,7 +143,7 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 9.0.1 +Provides: bundled(llvm) = 10.0.1 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} @@ -394,8 +391,6 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} -%patch1 -p1 - %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure %endif @@ -506,6 +501,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 --disable-rpath \ %{enable_debuginfo} \ --enable-extended \ + --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ %{?codegen_units_std} \ @@ -613,7 +609,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.so -%exclude %{_bindir}/*miri %files std-static From 44fe1090f9854aad2e084368fe169861a5e2a5c0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 14 Jul 2020 09:42:00 -0700 Subject: [PATCH 53/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index 432f1ac..0f2d79a 100644 --- a/rust.spec +++ b/rust.spec @@ -48,8 +48,8 @@ %endif Name: rust -Version: 1.46.0 -Release: 0.1.beta.3%{?dist} +Version: 1.45.0 +Release: 0.1.beta.4%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) From 6732b6b7fbbf4c249a71139b508bac8885ea27ac Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 9 Mar 2021 10:54:54 -0800 Subject: [PATCH 54/59] beta test --- rust.spec | 23 ++++++++++++------- ....patch => rustc-1.51.0-disable-http2.patch | 22 +++++++++--------- ...patch => rustc-1.51.0-no-default-pie.patch | 9 ++++---- 3 files changed, 31 insertions(+), 23 deletions(-) rename rustc-1.49.0-disable-http2.patch => rustc-1.51.0-disable-http2.patch (72%) rename rustc-1.48.0-no-default-pie.patch => rustc-1.51.0-no-default-pie.patch (75%) diff --git a/rust.spec b/rust.spec index 1a7b984..b8662d5 100644 --- a/rust.spec +++ b/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.49.0 -%global bootstrap_cargo 1.49.0 -%global bootstrap_channel 1.49.0 -%global bootstrap_date 2020-12-31 +%global bootstrap_rust 1.50.0 +%global bootstrap_cargo 1.50.0 +%global bootstrap_channel 1.50.0 +%global bootstrap_date 2021-02-11 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -52,7 +52,7 @@ %endif Name: rust -Version: 1.50.0 +Version: 1.51.0~beta.4 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -78,11 +78,11 @@ Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.49.0-disable-http2.patch +Patch101: rustc-1.51.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.48.0-no-default-pie.patch +Patch102: rustc-1.51.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -165,12 +165,16 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.4.3 -Provides: bundled(llvm) = 11.0.0 +Provides: bundled(llvm) = 11.0.1 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm9.0 %endif +%if 0%{?fedora} >= 34 +# we're not ready for llvm-12 yet +%global llvm llvm11 +%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -731,6 +735,9 @@ export %{rust_env} %changelog +* Tue Mar 09 2021 Josh Stone - 1.51.0~beta.4-1 +- beta test + * Thu Feb 11 2021 Josh Stone - 1.50.0-1 - Update to 1.50.0. diff --git a/rustc-1.49.0-disable-http2.patch b/rustc-1.51.0-disable-http2.patch similarity index 72% rename from rustc-1.49.0-disable-http2.patch rename to rustc-1.51.0-disable-http2.patch index d6c6aa7..2517a34 100644 --- a/rustc-1.49.0-disable-http2.patch +++ b/rustc-1.51.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.49.0-src/Cargo.lock.orig 2021-01-05 12:45:10.456414612 -0800 -+++ rustc-1.49.0-src/Cargo.lock 2021-01-05 12:45:10.458414575 -0800 -@@ -882,7 +882,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2021-03-09 10:30:08.626424998 -0800 ++++ rustc-beta-src/Cargo.lock 2021-03-09 10:32:38.096207704 -0800 +@@ -899,7 +899,6 @@ dependencies = [ "cc", "libc", @@ -8,7 +8,7 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1728,16 +1727,6 @@ +@@ -1860,16 +1859,6 @@ ] [[package]] @@ -25,10 +25,10 @@ name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.49.0-src/src/tools/cargo/Cargo.toml.orig 2021-01-05 12:45:10.458414575 -0800 -+++ rustc-1.49.0-src/src/tools/cargo/Cargo.toml 2021-01-05 12:47:25.966928554 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-03-05 08:34:15.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-03-09 10:32:38.096207704 -0800 @@ -25,7 +25,7 @@ - crates-io = { path = "crates/crates-io", version = "0.31.1" } + crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" crypto-hash = "0.3.1" -curl = { version = "0.4.23", features = ["http2"] } @@ -36,9 +36,9 @@ curl-sys = "0.4.22" env_logger = "0.8.1" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2020-12-28 19:03:25.000000000 -0800 -+++ rustc-1.49.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-01-05 12:45:10.458414575 -0800 -@@ -408,14 +408,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-03-05 08:34:15.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-03-09 10:32:38.096207704 -0800 +@@ -412,14 +412,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -584,7 +578,7 @@ +@@ -592,7 +586,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; diff --git a/rustc-1.48.0-no-default-pie.patch b/rustc-1.51.0-no-default-pie.patch similarity index 75% rename from rustc-1.48.0-no-default-pie.patch rename to rustc-1.51.0-no-default-pie.patch index bb6b3d1..d24cc75 100644 --- a/rustc-1.48.0-no-default-pie.patch +++ b/rustc-1.51.0-no-default-pie.patch @@ -1,14 +1,15 @@ ---- rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2020-11-16 06:01:53.000000000 -0800 -+++ rustc-1.48.0-src/compiler/rustc_codegen_ssa/src/back/link.rs 2020-11-16 09:37:15.779516797 -0800 -@@ -1185,10 +1185,12 @@ +--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800 ++++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800 +@@ -1279,11 +1279,13 @@ } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { -- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, + // Only use PIE if explicity specified. + let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { + (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, +- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, - (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, From 519c6a98529c68fe3874afa0159c43c011463cc6 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 23 Mar 2021 16:12:48 -0700 Subject: [PATCH 55/59] beta test --- rust.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust.spec b/rust.spec index b8662d5..c3f5c31 100644 --- a/rust.spec +++ b/rust.spec @@ -52,7 +52,7 @@ %endif Name: rust -Version: 1.51.0~beta.4 +Version: 1.51.0~beta.8 Release: 1%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) @@ -735,7 +735,7 @@ export %{rust_env} %changelog -* Tue Mar 09 2021 Josh Stone - 1.51.0~beta.4-1 +* Fri Mar 19 2021 Josh Stone - 1.51.0~beta.8-1 - beta test * Thu Feb 11 2021 Josh Stone - 1.50.0-1 From 6ce0ca56b0b1805ca25ae9f60039838a07259048 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 4 Jun 2021 16:11:18 -0700 Subject: [PATCH 56/59] beta test --- ...-Use-lld-provided-by-system-for-wasm.patch | 14 +++++----- rust.spec | 23 +++++++++------- ....patch => rustc-1.53.0-disable-http2.patch | 26 +++++++++---------- 3 files changed, 33 insertions(+), 30 deletions(-) rename rustc-1.51.0-disable-http2.patch => rustc-1.53.0-disable-http2.patch (72%) diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch index ff126cc..4dcb322 100644 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -1,17 +1,17 @@ -From 1a6307bbf7972aa2ce89a213bad6f26b6325a59c Mon Sep 17 00:00:00 2001 +From 3582a262d27fd5a2f8705bad6018241eaca8aadd Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sun, 8 Dec 2019 17:23:08 +0500 Subject: [PATCH] Use lld provided by system for wasm --- - compiler/rustc_target/src/spec/wasm32_base.rs | 3 +-- + compiler/rustc_target/src/spec/wasm_base.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -diff --git a/compiler/rustc_target/src/spec/wasm32_base.rs b/compiler/rustc_target/src/spec/wasm32_base.rs -index bfef3d37228f..0ecb29248fe2 100644 ---- a/compiler/rustc_target/src/spec/wasm32_base.rs -+++ b/compiler/rustc_target/src/spec/wasm32_base.rs -@@ -97,8 +97,7 @@ pub fn options() -> TargetOptions { +diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs +index b208eb92f8ff..94a701a11c8b 100644 +--- a/compiler/rustc_target/src/spec/wasm_base.rs ++++ b/compiler/rustc_target/src/spec/wasm_base.rs +@@ -98,8 +98,7 @@ pub fn options() -> TargetOptions { // arguments just yet limit_rdylib_exports: false, diff --git a/rust.spec b/rust.spec index 999b8cf..32df758 100644 --- a/rust.spec +++ b/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.51.0 -%global bootstrap_cargo 1.51.0 -%global bootstrap_channel 1.51.0 -%global bootstrap_date 2021-03-25 +%global bootstrap_rust 1.52.0 +%global bootstrap_cargo 1.52.0 +%global bootstrap_channel 1.52.0 +%global bootstrap_date 2021-05-06 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -30,7 +30,7 @@ %bcond_with llvm_static # We can also choose to just use Rust's bundled LLVM, in case the system LLVM -# is insufficient. Rust currently requires LLVM 9.0+. +# is insufficient. Rust currently requires LLVM 10.0+. %bcond_with bundled_llvm # Requires stable libgit2 1.1 @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.52.1 -Release: 2%{?dist} +Version: 1.53.0~beta.3 +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) @@ -90,7 +90,7 @@ Patch100: rustc-1.48.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.51.0-disable-http2.patch +Patch101: rustc-1.53.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) @@ -181,7 +181,7 @@ Provides: bundled(llvm) = 12.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 -%global llvm llvm9.0 +%global llvm llvm11.0 %endif %if 0%{?fedora} == 34 # aarch64 is hanging with LLVM 12-rc1, but it's fine with 12-final on rawhide. @@ -194,7 +194,7 @@ BuildRequires: cmake >= 2.8.11 %global llvm llvm %global llvm_root %{_prefix} %endif -BuildRequires: %{llvm}-devel >= 9.0 +BuildRequires: %{llvm}-devel >= 10.0 %if %with llvm_static BuildRequires: %{llvm}-static BuildRequires: libffi-devel @@ -809,6 +809,9 @@ end} %changelog +* Fri Jun 04 2021 Josh Stone - 1.53.0~beta.3-1 +- beta test + * Wed Jun 02 2021 Josh Stone - 1.52.1-2 - Set rust.codegen-units-std=1 for all targets again. - Add rust-std-static-wasm32-unknown-unknown. diff --git a/rustc-1.51.0-disable-http2.patch b/rustc-1.53.0-disable-http2.patch similarity index 72% rename from rustc-1.51.0-disable-http2.patch rename to rustc-1.53.0-disable-http2.patch index 2517a34..94040b3 100644 --- a/rustc-1.51.0-disable-http2.patch +++ b/rustc-1.53.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-beta-src/Cargo.lock.orig 2021-03-09 10:30:08.626424998 -0800 -+++ rustc-beta-src/Cargo.lock 2021-03-09 10:32:38.096207704 -0800 -@@ -899,7 +899,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2021-06-04 15:56:04.141227630 -0700 ++++ rustc-beta-src/Cargo.lock 2021-06-04 16:03:04.461396826 -0700 +@@ -885,7 +885,6 @@ dependencies = [ "cc", "libc", @@ -8,8 +8,8 @@ "libz-sys", "openssl-sys", "pkg-config", -@@ -1860,16 +1859,6 @@ - ] +@@ -1904,16 +1903,6 @@ + checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] -name = "libnghttp2-sys" @@ -25,20 +25,20 @@ name = "libz-sys" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-03-05 08:34:15.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-03-09 10:32:38.096207704 -0800 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-06-04 15:56:04.143227587 -0700 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-06-04 15:57:56.931857927 -0700 @@ -25,7 +25,7 @@ + cargo-util = { path = "crates/cargo-util", version = "0.1.0" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" - crypto-hash = "0.3.1" -curl = { version = "0.4.23", features = ["http2"] } +curl = { version = "0.4.23", features = [] } curl-sys = "0.4.22" env_logger = "0.8.1" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-03-05 08:34:15.000000000 -0800 -+++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-03-09 10:32:38.096207704 -0800 -@@ -412,14 +412,8 @@ +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-05-22 15:22:31.000000000 -0700 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-06-04 16:00:03.903190293 -0700 +@@ -416,14 +416,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP // proxies. @@ -46,7 +46,7 @@ - let multiplexing = config.http_config()?.multiplexing.unwrap_or(true); - multi - .pipelining(false, multiplexing) -- .chain_err(|| "failed to enable multiplexing/pipelining in curl")?; +- .with_context(|| "failed to enable multiplexing/pipelining in curl")?; - - // let's not flood crates.io with connections - multi.set_max_host_connections(2)?; @@ -55,7 +55,7 @@ Ok(PackageSet { packages: package_ids -@@ -592,7 +586,7 @@ +@@ -596,7 +590,7 @@ macro_rules! try_old_curl { ($e:expr, $msg:expr) => { let result = $e; From 1b715fd222de4b9c70854deb15e6e3b23f7f7b8c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 21 Jul 2021 13:48:53 -0700 Subject: [PATCH 57/59] beta test --- 0001-Use-lld-provided-by-system-for-wasm.patch | 8 ++++---- rust.spec | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/0001-Use-lld-provided-by-system-for-wasm.patch b/0001-Use-lld-provided-by-system-for-wasm.patch index 4dcb322..681b21a 100644 --- a/0001-Use-lld-provided-by-system-for-wasm.patch +++ b/0001-Use-lld-provided-by-system-for-wasm.patch @@ -1,4 +1,4 @@ -From 3582a262d27fd5a2f8705bad6018241eaca8aadd Mon Sep 17 00:00:00 2001 +From 9ac837c237568a6c1c5f0e979fcce208cd9c926a Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sun, 8 Dec 2019 17:23:08 +0500 Subject: [PATCH] Use lld provided by system for wasm @@ -8,10 +8,10 @@ Subject: [PATCH] Use lld provided by system for wasm 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs -index b208eb92f8ff..94a701a11c8b 100644 +index 4c954a1e567c..15c4f1bda5eb 100644 --- a/compiler/rustc_target/src/spec/wasm_base.rs +++ b/compiler/rustc_target/src/spec/wasm_base.rs -@@ -98,8 +98,7 @@ pub fn options() -> TargetOptions { +@@ -99,8 +99,7 @@ pub fn options() -> TargetOptions { // arguments just yet limit_rdylib_exports: false, @@ -19,8 +19,8 @@ index b208eb92f8ff..94a701a11c8b 100644 - linker: Some("rust-lld".to_owned()), + linker: Some("lld".to_owned()), lld_flavor: LldFlavor::Wasm, + linker_is_gnu: false, - // No need for indirection here, simd types can always be passed by -- 2.31.1 diff --git a/rust.spec b/rust.spec index bd589d3..dc33479 100644 --- a/rust.spec +++ b/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.52.0 -%global bootstrap_cargo 1.52.0 -%global bootstrap_channel 1.52.0 -%global bootstrap_date 2021-05-06 +%global bootstrap_rust 1.53.0 +%global bootstrap_cargo 1.53.0 +%global bootstrap_channel 1.53.0 +%global bootstrap_date 2021-06-17 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.53.0 -Release: 2%{?dist} +Version: 1.54.0~beta.3 +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) @@ -823,6 +823,9 @@ end} %changelog +* Wed Jul 21 2021 Josh Stone - 1.54.0~beta.3-1 +- beta test + * Thu Jul 08 2021 Josh Stone - 1.53.0-2 - Exclude wasm on s390x for lack of lld From d9cbb77b8b844fc24f77718acc995e9a360109df Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 11 Oct 2021 11:26:33 -0700 Subject: [PATCH 58/59] beta test --- rust.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rust.spec b/rust.spec index f717f34..f6a1c2c 100644 --- a/rust.spec +++ b/rust.spec @@ -61,8 +61,8 @@ %endif Name: rust -Version: 1.55.0 -Release: 2%{?dist} +Version: 1.56.0~beta.3 +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) @@ -177,14 +177,15 @@ BuildRequires: %{python} %if %with bundled_llvm BuildRequires: cmake3 >= 3.13.4 -Provides: bundled(llvm) = 12.0.1 +BuildRequires: ninja-build +Provides: bundled(llvm) = 13.0.0 %else BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm11 %endif # Rust isn't ready for LLVM 13 yet -%if 0%{?fedora} >= 35 +%if 0 && 0%{?fedora} >= 35 %global llvm llvm12 %endif %if %defined llvm @@ -831,6 +832,9 @@ end} %changelog +* Mon Sep 20 2021 Josh Stone - 1.56.0~beta.3-1 +- beta test + * Tue Sep 14 2021 Sahana Prasad - 1.55.0-2 - Rebuilt with OpenSSL 3.0.0 From e6f129e10117ab4b72f32a930c964b869834568a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 30 Nov 2021 11:53:11 -0800 Subject: [PATCH 59/59] beta test --- 0001-Revert-Auto-merge-of-79547.patch | 102 --------------- rust-pr91070.patch | 94 ++++++++++++++ rust.spec | 121 ++++++++++++------ ....patch => rustc-1.57.0-disable-http2.patch | 20 +-- ...patch => rustc-1.57.0-no-default-pie.patch | 17 ++- 5 files changed, 197 insertions(+), 157 deletions(-) delete mode 100644 0001-Revert-Auto-merge-of-79547.patch create mode 100644 rust-pr91070.patch rename rustc-1.56.0-disable-http2.patch => rustc-1.57.0-disable-http2.patch (73%) rename rustc-1.51.0-no-default-pie.patch => rustc-1.57.0-no-default-pie.patch (66%) diff --git a/0001-Revert-Auto-merge-of-79547.patch b/0001-Revert-Auto-merge-of-79547.patch deleted file mode 100644 index b2e58a1..0000000 --- a/0001-Revert-Auto-merge-of-79547.patch +++ /dev/null @@ -1,102 +0,0 @@ -From eaf7ea1fc339e1ff348ed941ed2e8c4d66f3e458 Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Thu, 18 Feb 2021 19:14:58 -0800 -Subject: [PATCH] Revert "Auto merge of #79547 - erikdesjardins:byval, - r=nagisa" - -This reverts commit a094ff9590b83c8f94d898f92c2964a5803ded06, reversing -changes made to d37afad0cc87bf709ad10c85319296ac53030f03. ---- - compiler/rustc_middle/src/ty/layout.rs | 12 ++++++------ - ...return-value-in-reg.rs => return-value-in-reg.rs} | 4 ++-- - src/test/codegen/union-abi.rs | 11 +++-------- - 3 files changed, 11 insertions(+), 16 deletions(-) - rename src/test/codegen/{arg-return-value-in-reg.rs => return-value-in-reg.rs} (74%) - -diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs -index b545b92c9252..545f6aee1a21 100644 ---- a/compiler/rustc_middle/src/ty/layout.rs -+++ b/compiler/rustc_middle/src/ty/layout.rs -@@ -2849,7 +2849,7 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { - || abi == SpecAbi::RustIntrinsic - || abi == SpecAbi::PlatformIntrinsic - { -- let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| { -+ let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| { - if arg.is_ignore() { - return; - } -@@ -2887,9 +2887,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { - _ => return, - } - -- // Pass and return structures up to 2 pointers in size by value, matching `ScalarPair`. -- // LLVM will usually pass these in 2 registers, which is more efficient than by-ref. -- let max_by_val_size = Pointer.size(cx) * 2; -+ // Return structures up to 2 pointers in size by value, matching `ScalarPair`. LLVM -+ // will usually return these in 2 registers, which is more efficient than by-ref. -+ let max_by_val_size = if is_ret { Pointer.size(cx) * 2 } else { Pointer.size(cx) }; - let size = arg.layout.size; - - if arg.layout.is_unsized() || size > max_by_val_size { -@@ -2901,9 +2901,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) { - arg.cast_to(Reg { kind: RegKind::Integer, size }); - } - }; -- fixup(&mut self.ret); -+ fixup(&mut self.ret, true); - for arg in &mut self.args { -- fixup(arg); -+ fixup(arg, false); - } - return; - } -diff --git a/src/test/codegen/arg-return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs -similarity index 74% -rename from src/test/codegen/arg-return-value-in-reg.rs -rename to src/test/codegen/return-value-in-reg.rs -index a69291d47821..4bc0136c5e32 100644 ---- a/src/test/codegen/arg-return-value-in-reg.rs -+++ b/src/test/codegen/return-value-in-reg.rs -@@ -1,4 +1,4 @@ --//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer. -+//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer. - - // compile-flags: -C no-prepopulate-passes -O - // only-x86_64 -@@ -11,7 +11,7 @@ pub struct S { - c: u32, - } - --// CHECK: define i128 @modify(i128{{( %0)?}}) -+// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s) - #[no_mangle] - pub fn modify(s: S) -> S { - S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c } -diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs -index f282fd237054..afea01e9a2d0 100644 ---- a/src/test/codegen/union-abi.rs -+++ b/src/test/codegen/union-abi.rs -@@ -63,16 +63,11 @@ pub union UnionU128{a:u128} - #[no_mangle] - pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} } - --pub union UnionU128x2{a:(u128, u128)} --// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1) --#[no_mangle] --pub fn test_UnionU128x2(_: UnionU128x2) { loop {} } -- - #[repr(C)] --pub union CUnionU128x2{a:(u128, u128)} --// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1) -+pub union CUnionU128{a:u128} -+// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1) - #[no_mangle] --pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} } -+pub fn test_CUnionU128(_: CUnionU128) { loop {} } - - pub union UnionBool { b:bool } - // CHECK: define zeroext i1 @test_UnionBool(i8 %b) --- -2.29.2 - diff --git a/rust-pr91070.patch b/rust-pr91070.patch new file mode 100644 index 0000000..1b4f052 --- /dev/null +++ b/rust-pr91070.patch @@ -0,0 +1,94 @@ +diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +index e77d29bed712..f3d8eb2602a3 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +@@ -124,8 +124,18 @@ extern "C" LLVMValueRef LLVMRustGetOrInsertFunction(LLVMModuleRef M, + + extern "C" LLVMValueRef + LLVMRustGetOrInsertGlobal(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef Ty) { ++ Module *Mod = unwrap(M); + StringRef NameRef(Name, NameLen); +- return wrap(unwrap(M)->getOrInsertGlobal(NameRef, unwrap(Ty))); ++ ++ // We don't use Module::getOrInsertGlobal because that returns a Constant*, ++ // which may either be the real GlobalVariable*, or a constant bitcast of it ++ // if our type doesn't match the original declaration. We always want the ++ // GlobalVariable* so we can access linkage, visibility, etc. ++ GlobalVariable *GV = Mod->getGlobalVariable(NameRef, true); ++ if (!GV) ++ GV = new GlobalVariable(*Mod, unwrap(Ty), false, ++ GlobalValue::ExternalLinkage, nullptr, NameRef); ++ return wrap(GV); + } + + extern "C" LLVMValueRef +diff --git a/src/test/ui/statics/issue-91050-1.rs b/src/test/ui/statics/issue-91050-1.rs +new file mode 100644 +index 000000000000..403a41462ef1 +--- /dev/null ++++ b/src/test/ui/statics/issue-91050-1.rs +@@ -0,0 +1,34 @@ ++// build-pass ++// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes ++ ++// This test declares globals by the same name with different types, which ++// caused problems because Module::getOrInsertGlobal would return a Constant* ++// bitcast instead of a GlobalVariable* that could access linkage/visibility. ++// In alt builds with LLVM assertions this would fail: ++// ++// rustc: /checkout/src/llvm-project/llvm/include/llvm/Support/Casting.h:269: ++// typename cast_retty::ret_type llvm::cast(Y *) [X = llvm::GlobalValue, Y = llvm::Value]: ++// Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. ++// ++// In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!" ++ ++pub mod before { ++ #[no_mangle] ++ pub static GLOBAL1: [u8; 1] = [1]; ++} ++ ++pub mod inner { ++ extern "C" { ++ pub static GLOBAL1: u8; ++ pub static GLOBAL2: u8; ++ } ++ ++ pub fn call() { ++ drop(unsafe { (GLOBAL1, GLOBAL2) }); ++ } ++} ++ ++pub mod after { ++ #[no_mangle] ++ pub static GLOBAL2: [u8; 1] = [2]; ++} +diff --git a/src/test/ui/statics/issue-91050-2.rs b/src/test/ui/statics/issue-91050-2.rs +new file mode 100644 +index 000000000000..2ff954d15cab +--- /dev/null ++++ b/src/test/ui/statics/issue-91050-2.rs +@@ -0,0 +1,24 @@ ++// build-pass ++// compile-flags: --crate-type=rlib --emit=llvm-ir -Cno-prepopulate-passes ++ ++// This is a variant of issue-91050-1.rs -- see there for an explanation. ++ ++pub mod before { ++ extern "C" { ++ pub static GLOBAL1: [u8; 1]; ++ } ++ ++ pub unsafe fn do_something_with_array() -> u8 { ++ GLOBAL1[0] ++ } ++} ++ ++pub mod inner { ++ extern "C" { ++ pub static GLOBAL1: u8; ++ } ++ ++ pub unsafe fn call() -> u8 { ++ GLOBAL1 + 42 ++ } ++} diff --git a/rust.spec b/rust.spec index 7c79063..abe8acf 100644 --- a/rust.spec +++ b/rust.spec @@ -1,6 +1,6 @@ # Only x86_64 and i686 are Tier 1 platforms at this time. # https://doc.rust-lang.org/nightly/rustc/platform-support.html -%global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x +%global rust_arches x86_64 i686 armv7hl aarch64 ppc64le s390x # The channel can be stable, beta, or nightly %{!?channel: %global channel beta} @@ -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.55.0 -%global bootstrap_cargo 1.55.0 -%global bootstrap_channel 1.55.0 -%global bootstrap_date 2021-09-09 +%global bootstrap_rust 1.56.1 +%global bootstrap_cargo 1.56.1 +%global bootstrap_channel 1.56.1 +%global bootstrap_date 2021-11-01 # Only the specified arches will use bootstrap binaries. #global bootstrap_arches %%{rust_arches} @@ -22,10 +22,18 @@ # reproducible between hosts, so only x86_64 actually builds it. %ifarch x86_64 %if 0%{?fedora} -%global cross_targets wasm32-unknown-unknown +%global cross_targets wasm32-unknown-unknown wasm32-wasi %endif %endif +# We need CRT files for *-wasi targets +%global forgeurl1 https://github.com/WebAssembly/wasi-libc +%global commit1 ad5133410f66b93a2381db5b542aad5e0964db96 +%forgemeta -z 1 +%undefine distprefix1 +%global wasi_libc_source %{forgesource1} +%global wasi_libc_dir %{_builddir}/%{extractdir1} + # Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. %bcond_with llvm_static @@ -33,8 +41,8 @@ # is insufficient. Rust currently requires LLVM 10.0+. %bcond_with bundled_llvm -# Requires stable libgit2 1.1 -%if 0%{?fedora} >= 34 +# Requires stable libgit2 1.3 +%if 0%{?fedora} >= 36 %bcond_with bundled_libgit2 %else %bcond_without bundled_libgit2 @@ -61,8 +69,8 @@ %endif Name: rust -Version: 1.56.1 -Release: 3%{?dist} +Version: 1.57.0~beta.8 +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) @@ -75,11 +83,12 @@ ExclusiveArch: %{rust_arches} %global rustc_package rustc-%{channel}-src %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +Source1: %{wasi_libc_source} +# Sources for bootstrap_arches are inserted by lua below -# An internal rust-abi change broke s390x, but it's fixed in LLVM 12.0.1. -# We'll revert the change on Fedora 33 that has an unpatched LLVM 11. -# https://github.com/rust-lang/rust/issues/80810#issuecomment-781784032 -Patch1: 0001-Revert-Auto-merge-of-79547.patch +# Fix a bad typecast for LLVM globals, rhbz#1990657 +# https://github.com/rust-lang/rust/pull/91070 +Patch1: rust-pr91070.patch # By default, rust tries to use "rust-lld" as a linker for WebAssembly. Patch2: 0001-Use-lld-provided-by-system-for-wasm.patch @@ -91,11 +100,11 @@ Patch100: rustc-1.56.0-disable-libssh2.patch # libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys # will try to build it statically -- instead we turn off the feature. -Patch101: rustc-1.56.0-disable-http2.patch +Patch101: rustc-1.57.0-disable-http2.patch # kernel rh1410097 causes too-small stacks for PIE. # (affects RHEL6 kernels when building for RHEL7) -Patch102: rustc-1.51.0-no-default-pie.patch +Patch102: rustc-1.57.0-no-default-pie.patch # Get the Rust triple for any arch. @@ -128,6 +137,7 @@ end} .."/rust-%{bootstrap_channel}") local target_arch = rpm.expand("%{_target_cpu}") for i, arch in ipairs(bootstrap_arches) do + i = 100 + i print(string.format("Source%d: %s-%s.tar.xz\n", i, base, rust_triple(arch))) if arch == target_arch then @@ -165,7 +175,7 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %if %{without bundled_libgit2} -BuildRequires: pkgconfig(libgit2) >= 1.1.0 +BuildRequires: pkgconfig(libgit2) >= 1.3.0 %endif %if %{without disabled_libssh2} @@ -185,10 +195,6 @@ BuildRequires: cmake >= 2.8.11 %if 0%{?epel} == 7 %global llvm llvm11 %endif -%if 0%{?fedora} == 35 -# f35 still only has 13.0.0~rc1 -%global llvm llvm12 -%endif %if %defined llvm %global llvm_root %{_libdir}/%{llvm} %else @@ -262,6 +268,7 @@ BuildRequires: %{devtoolset_name}-gcc-c++ %global rustlibdir %{common_libdir}/rustlib %if %defined cross_targets +BuildRequires: clang # brp-strip-static-archive breaks the archive index for wasm %global __os_install_post \ %__os_install_post \ @@ -286,23 +293,29 @@ written in Rust. %if %defined cross_targets %{lua: do for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do - local requires = rpm.expand("Requires: rust = %{version}-%{release}") - if string.sub(triple, 1, 4) == "wasm" then - requires = requires .. "\nRequires: lld >= 8.0" - end local subs = { triple = triple, - requires = requires, + verrel = rpm.expand("%{version}-%{release}"), + wasm = string.sub(triple, 1, 4) == "wasm" and 1 or 0, + wasi = string.find(triple, "-wasi") and 1 or 0, } local s = string.gsub([[ + %package std-static-{{triple}} Summary: Standard library for Rust BuildArch: noarch -{{requires}} +Requires: rust = {{verrel}} +%if {{wasm}} +Requires: lld >= 8.0 +%endif +%if {{wasi}} +Provides: bundled(wasi-libc) +%endif %description std-static-{{triple}} This package includes the standard libraries for building applications written in Rust for the {{triple}} target. + ]], "{{(%w+)}}", subs) print(s) end @@ -360,7 +373,7 @@ its standard library. %package -n cargo Summary: Rust's package manager and build tool %if %with bundled_libgit2 -Provides: bundled(libgit2) = 1.1.0 +Provides: bundled(libgit2) = 1.3.0 %endif # For tests: BuildRequires: git @@ -403,7 +416,7 @@ 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) = 1.1.0 +Provides: bundled(libgit2) = 1.3.0 %endif Requires: rust-analysis # /usr/bin/rls is dynamically linked against internal rustc libs @@ -463,13 +476,13 @@ test -f '%{local_rust_root}/bin/cargo' test -f '%{local_rust_root}/bin/rustc' %endif -%setup -q -n %{rustc_package} - -%if 0%{?fedora} == 33 -# revert only for LLVM 11 -%patch1 -p1 +%if %defined cross_targets +%forgesetup -z 1 %endif +%setup -q -n %{rustc_package} + +%patch1 -p1 %patch2 -p1 %if %with disabled_libssh2 @@ -543,10 +556,6 @@ find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+' %if 0%{?cmake_path:1} %global rust_env %{rust_env} PATH="%{cmake_path}:$PATH" %endif -%if %without bundled_libgit2 -# convince libgit2-sys to use the distro libgit2 -%global rust_env %{rust_env} LIBGIT2_SYS_USE_PKG_CONFIG=1 -%endif %if %without disabled_libssh2 # convince libssh2-sys to use the distro libssh2 %global rust_env %{rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1 @@ -578,6 +587,22 @@ if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then ncpus="$max_cpus" fi +%if %defined cross_targets +%make_build -C %{wasi_libc_dir} +%{lua: do + local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot" + local set_wasi_root = "" + for triple in string.gmatch(rpm.expand("%{cross_targets}"), "%S+") do + if string.find(triple, "-wasi") then + set_wasi_root = set_wasi_root .. " --set target." .. triple .. ".wasi-root=" .. wasi_root + end + end + if wasi_root ~= "" then + rpm.define("set_wasi_root "..set_wasi_root) + end +end} +%endif + %configure --disable-option-checking \ --libdir=%{common_libdir} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ @@ -596,7 +621,7 @@ fi --tools=analysis,cargo,clippy,rls,rustfmt,src \ --enable-vendor \ --enable-verbose-tests \ - %{?codegen_units_std} \ + %{?set_wasi_root} \ --dist-compression-formats=gz \ --release-channel=%{channel} \ --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}" @@ -694,6 +719,12 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll* %check export %{rust_env} +# Sanity-check the installed binaries, debuginfo-stripped and all. +%{buildroot}%{_bindir}/cargo new build/hello-world +env RUSTC=%{buildroot}%{_bindir}/rustc \ + LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ + %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml + # The results are not stable on koji, so mask errors and just log it. # Some of the larger test artifacts are manually cleaned to save space. %{python} ./x.py test --no-fail-fast --stage 2 || : @@ -740,13 +771,20 @@ env RLS_TEST_WAIT_FOR_AGES=1 \ local subs = { triple = triple, rustlibdir = rpm.expand("%{rustlibdir}"), + wasi = string.find(triple, "-wasi") and 1 or 0, } local s = string.gsub([[ + %files std-static-{{triple}} %dir {{rustlibdir}} %dir {{rustlibdir}}/{{triple}} %dir {{rustlibdir}}/{{triple}}/lib {{rustlibdir}}/{{triple}}/lib/*.rlib +%if {{wasi}} +%dir {{rustlibdir}}/{{triple}}/lib/self-contained +{{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o +%endif + ]], "{{(%w+)}}", subs) print(s) end @@ -837,6 +875,11 @@ end} %changelog +* Mon Nov 29 2021 Josh Stone - 1.57.0~beta.8-1 +- beta test +- Backport rust#91070, fixes rhbz#1990657 +- Add rust-std-static-wasm32-wasi + * Sun Nov 28 2021 Igor Raits - 1.56.1-3 - De-bootstrap (libgit2) diff --git a/rustc-1.56.0-disable-http2.patch b/rustc-1.57.0-disable-http2.patch similarity index 73% rename from rustc-1.56.0-disable-http2.patch rename to rustc-1.57.0-disable-http2.patch index 3b3d0c8..6723dc6 100644 --- a/rustc-1.56.0-disable-http2.patch +++ b/rustc-1.57.0-disable-http2.patch @@ -1,6 +1,6 @@ ---- rustc-1.56.0-src/Cargo.lock.orig 2021-10-19 18:03:53.928187581 -0700 -+++ rustc-1.56.0-src/Cargo.lock 2021-10-19 18:05:41.443522980 -0700 -@@ -877,7 +877,6 @@ +--- rustc-beta-src/Cargo.lock.orig 2021-11-29 10:37:40.665228216 -0800 ++++ rustc-beta-src/Cargo.lock 2021-11-29 10:37:40.667228175 -0800 +@@ -889,7 +889,6 @@ dependencies = [ "cc", "libc", @@ -25,19 +25,19 @@ name = "libz-sys" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" ---- rustc-1.56.0-src/src/tools/cargo/Cargo.toml.orig 2021-10-19 18:03:53.930187532 -0700 -+++ rustc-1.56.0-src/src/tools/cargo/Cargo.toml 2021-10-19 18:05:13.663211469 -0700 +--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2021-11-29 10:37:40.667228175 -0800 ++++ rustc-beta-src/src/tools/cargo/Cargo.toml 2021-11-29 10:38:41.291987733 -0800 @@ -25,7 +25,7 @@ cargo-util = { path = "crates/cargo-util", version = "0.1.1" } crates-io = { path = "crates/crates-io", version = "0.33.0" } crossbeam-utils = "0.8" --curl = { version = "0.4.38", features = ["http2"] } -+curl = { version = "0.4.38", features = [] } - curl-sys = "0.4.48" +-curl = { version = "0.4.39", features = ["http2"] } ++curl = { version = "0.4.39", features = [] } + curl-sys = "0.4.49" env_logger = "0.9.0" pretty_env_logger = { version = "0.4", optional = true } ---- rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-10-18 02:52:56.000000000 -0700 -+++ rustc-1.56.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-10-19 18:03:53.931187507 -0700 +--- rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-11-27 09:38:17.000000000 -0800 ++++ rustc-beta-src/src/tools/cargo/src/cargo/core/package.rs 2021-11-29 10:37:40.667228175 -0800 @@ -417,14 +417,8 @@ // Also note that pipelining is disabled as curl authors have indicated // that it's buggy, and we've empirically seen that it's buggy with HTTP diff --git a/rustc-1.51.0-no-default-pie.patch b/rustc-1.57.0-no-default-pie.patch similarity index 66% rename from rustc-1.51.0-no-default-pie.patch rename to rustc-1.57.0-no-default-pie.patch index d24cc75..c9c8693 100644 --- a/rustc-1.51.0-no-default-pie.patch +++ b/rustc-1.57.0-no-default-pie.patch @@ -1,18 +1,23 @@ ---- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800 -+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800 -@@ -1279,11 +1279,13 @@ +--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-11-29 10:41:02.380100917 -0800 ++++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-11-29 10:53:31.014783112 -0800 +@@ -1485,15 +1485,14 @@ } fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { - let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { + // Only use PIE if explicity specified. -+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic)); ++ let explicit_pic = ++ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie)); + let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) { (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, -- (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, +- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { +- LinkOutputKind::DynamicPicExe +- } + (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe, (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, -- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, +- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { +- LinkOutputKind::StaticPicExe +- } + (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe, (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, (_, true, _) => LinkOutputKind::StaticDylib,