From d59c1edc2b3ea6f2fdb3bf7413288d1542bd9456 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 17 Nov 2016 22:21:09 -0800 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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