Update to 1.14.0.

Rewrite bootstrap logic to target specific arches.
Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!)
This commit is contained in:
Josh Stone 2016-12-22 22:08:39 -08:00
parent e11f49f736
commit df7f61c253
6 changed files with 100 additions and 145 deletions

9
.gitignore vendored
View File

@ -16,3 +16,12 @@
/rustc-1.12.1-armv7-unknown-linux-gnueabihf.tar.gz /rustc-1.12.1-armv7-unknown-linux-gnueabihf.tar.gz
/rustc-1.12.1-i686-unknown-linux-gnu.tar.gz /rustc-1.12.1-i686-unknown-linux-gnu.tar.gz
/rustc-1.12.1-x86_64-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
/rustc-1.14.0-src.tar.gz

View File

@ -1,48 +0,0 @@
commit 3bc0272cab9fdcfc2ef4df9625ec3c9d5909db79 (from ecd2b1f6d689d5afbf5debe8afb3739337323852)
Merge: ecd2b1f6d689 8250bd0ac50b
Author: Alex Crichton <alex@alexcrichton.com>
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;

View File

@ -1,30 +0,0 @@
commit 1a4192804518199623fb88bf43bde69d6b0203cb (from a5dac7a2af3ee444817eb7bfbba3539be8c06cf1)
Merge: a5dac7a2af3e 4625642211b9
Author: bors <bors@rust-lang.org>
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

141
rust.spec
View File

@ -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 # The channel can be stable, beta, or nightly
%{!?channel: %global channel stable} %{!?channel: %global channel stable}
# To bootstrap from scratch, set the channel and date from src/stage0.txt # 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 # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24
# or nightly wants some beta-YYYY-MM-DD # or nightly wants some beta-YYYY-MM-DD
%bcond_with bootstrap %global bootstrap_channel 1.13.0
%global bootstrap_channel 1.12.1 %global bootstrap_date 2016-11-08
%global bootstrap_date 2016-10-20
# 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 # 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. # make us link statically. But we can opt in, e.g. to aid LLVM rebases.
@ -16,23 +23,14 @@
%bcond_with llvm_static %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 Name: rust
Version: 1.13.0 Version: 1.14.0
Release: 1%{?dist} Release: 1%{?dist}
Summary: The Rust Programming Language 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 ISC and MIT)
# ^ written as: (rust itself) and (bundled libraries) # ^ written as: (rust itself) and (bundled libraries)
URL: https://www.rust-lang.org URL: https://www.rust-lang.org
ExclusiveArch: %{rust_arches}
%if "%{channel}" == "stable" %if "%{channel}" == "stable"
%global rustc_package rustc-%{version} %global rustc_package rustc-%{version}
@ -41,32 +39,53 @@ URL: https://www.rust-lang.org
%endif %endif
Source0: https://static.rust-lang.org/dist/%{rustc_package}-src.tar.gz Source0: https://static.rust-lang.org/dist/%{rustc_package}-src.tar.gz
%if %with bootstrap # Get the Rust triple for any arch.
%global bootstrap_base https://static.rust-lang.org/dist/%{bootstrap_date}/rustc-%{bootstrap_channel} %{lua: function rust_triple(arch)
Source1: %{bootstrap_base}-x86_64-unknown-linux-gnu.tar.gz local abi = "gnu"
Source2: %{bootstrap_base}-i686-unknown-linux-gnu.tar.gz if arch == "armv7hl" then
Source3: %{bootstrap_base}-armv7-unknown-linux-gnueabihf.tar.gz arch = "armv7"
Source4: %{bootstrap_base}-aarch64-unknown-linux-gnu.tar.gz 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 = 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",
i, base, rust_triple(arch)))
if arch == target_arch then
rpm.define("bootstrap_source "..i)
end
end
end}
%endif %endif
# Only x86_64 and i686 are Tier 1 platforms at this time. %ifarch %{bootstrap_arches}
# https://doc.rust-lang.org/stable/book/getting-started.html#tier-1 %global bootstrap_root rustc-%{bootstrap_channel}-%{rust_triple}
ExclusiveArch: x86_64 i686 armv7hl aarch64 %global local_rust_root %{_builddir}/%{bootstrap_root}/rustc
%ifarch armv7hl Provides: bundled(%{name}-bootstrap) = %{bootstrap_channel}
%global rust_triple armv7-unknown-linux-gnueabihf
%else %else
%global rust_triple %{_target_cpu}-unknown-linux-gnu BuildRequires: %{name} <= %{version}
BuildRequires: %{name} >= %{bootstrap_channel}
%global local_rust_root %{_prefix}
%endif %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: make
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
@ -85,16 +104,6 @@ BuildRequires: libffi-devel
BuildConflicts: llvm-static BuildConflicts: llvm-static
%endif %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 # make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs
BuildRequires: procps-ng BuildRequires: procps-ng
@ -121,6 +130,16 @@ Requires: gcc
%global __provides_exclude ^(%{_privatelibs})$ %global __provides_exclude ^(%{_privatelibs})$
%global __requires_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 %description
Rust is a systems programming language that runs blazingly fast, prevents Rust is a systems programming language that runs blazingly fast, prevents
segfaults, and guarantees thread safety. segfaults, and guarantees thread safety.
@ -159,15 +178,13 @@ its standard library.
%prep %prep
%setup -q -n %{rustc_package}
%if %with bootstrap %ifarch %{bootstrap_arches}
find %{sources} -name '%{bootstrap_root}.tar.gz' -exec tar -xvzf '{}' ';' %setup -q -n %{bootstrap_root} -T -b %{bootstrap_source}
test -f '%{local_rust_root}/bin/rustc' test -f '%{local_rust_root}/bin/rustc'
%endif %endif
%patch1 -p1 -b .less-neon %setup -q -n %{rustc_package}
%patch2 -p1 -d src/compiler-rt -b .arm-cc
# unbundle # unbundle
rm -rf src/jemalloc/ rm -rf src/jemalloc/
@ -179,19 +196,12 @@ sed -e '/*\//q' src/libbacktrace/backtrace.h \
>src/libbacktrace/LICENSE-libbacktrace >src/libbacktrace/LICENSE-libbacktrace
# These tests assume that alloc_jemalloc is present # 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' \ sed -i.jemalloc -e '1i // ignore-test jemalloc is disabled' \
src/test/compile-fail/allocator-dylib-is-system.rs \ src/test/compile-fail/allocator-dylib-is-system.rs \
src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs \ src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs \
src/test/run-pass/allocator-default.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 %if %with llvm_static
# Static linking to distro LLVM needs to add -lffi # Static linking to distro LLVM needs to add -lffi
# https://github.com/rust-lang/rust/issues/34486 # https://github.com/rust-lang/rust/issues/34486
@ -203,7 +213,7 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
%build %build
%ifarch aarch64 %{mips} %{power64} %ifarch aarch64 %{mips} %{power64}
%if %with bootstrap %ifarch %{bootstrap_arches}
# Upstream binaries have a 4k-paged jemalloc, which breaks with Fedora 64k pages. # Upstream binaries have a 4k-paged jemalloc, which breaks with Fedora 64k pages.
# See https://github.com/rust-lang/rust/issues/36994 # See https://github.com/rust-lang/rust/issues/36994
# Fixed by https://github.com/rust-lang/rust/issues/37392 # Fixed by https://github.com/rust-lang/rust/issues/37392
@ -213,10 +223,12 @@ export MALLOC_CONF=lg_dirty_mult:-1
%endif %endif
# Use hardening ldflags. # 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, # We're going to override --libdir when configuring to get rustlib into a
# but shared libs will be fixed during install. # 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 \ %configure --disable-option-checking \
--libdir=%{common_libdir} \ --libdir=%{common_libdir} \
@ -319,6 +331,11 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || :
%changelog %changelog
* Thu Dec 22 2016 Josh Stone <jistone@redhat.com> - 1.14.0-1
- Update to 1.14.0.
- Rewrite bootstrap logic to target specific arches.
- Bootstrap ppc64, ppc64le, s390x. (thanks to Sinny Kumari for testing!)
* Thu Nov 10 2016 Josh Stone <jistone@redhat.com> - 1.13.0-1 * Thu Nov 10 2016 Josh Stone <jistone@redhat.com> - 1.13.0-1
- Update to 1.13.0. - Update to 1.13.0.
- Use hardening flags for linking. - Use hardening flags for linking.

View File

@ -1,5 +1,4 @@
23290b9d78356223a29cf37913c3a1c6 rustc-1.13.0-src.tar.gz SHA512 (rustc-1.14.0-src.tar.gz) = 3d7ea4ed29ade247a40e586b1966752af508f2d93fb6695027189f4fe012af910dc2ad554acf3a661134a4371c9699fc0e04fae1dcf8f2f49691797b5c9ed356
199eb41add634e002fbc2b20a2b33e27 rustc-1.12.1-aarch64-unknown-linux-gnu.tar.gz SHA512 (rustc-1.13.0-powerpc64le-unknown-linux-gnu.tar.gz) = 8f0da5280c15404153ad94fde5a56b3e5a46726901d808a4115d5b1cec1010c19b788df7ba3af991958cb75174cb2628ae4c5e2d0c17011e250c373445f22cf1
60a4a099b166481fe96c165b39441995 rustc-1.12.1-armv7-unknown-linux-gnueabihf.tar.gz SHA512 (rustc-1.13.0-powerpc64-unknown-linux-gnu.tar.gz) = 7ce759eaf889478f441c84f78ccb00766ac1b202eb498dcb87fcedb71f7fda3c6605135ad271aa3f6edc86d9b9508fa597a2dbcd9d086288acb7bbc023c1fd62
f1c1b3c6cd6195e4fbc386a7ab49e64d rustc-1.12.1-i686-unknown-linux-gnu.tar.gz SHA512 (rustc-1.13.0-s390x-unknown-linux-gnu.tar.gz) = 0d5b1523a51cae36f0da906505f3b930839006297b91edfb9b27d2bc85474cc68d0fcb92b99776e4ea3ad1f4445e331b46f4a2fc01b54dc72910dd6c2a77ba99
a03bdb0111e3b68a3626237d2ec7cb95 rustc-1.12.1-x86_64-unknown-linux-gnu.tar.gz

8
sources-bootstrap Normal file
View File

@ -0,0 +1,8 @@
SHA512 (rustc-1.14.0-src.tar.gz) = 3d7ea4ed29ade247a40e586b1966752af508f2d93fb6695027189f4fe012af910dc2ad554acf3a661134a4371c9699fc0e04fae1dcf8f2f49691797b5c9ed356
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