Update to 1.13.0.

- Use hardening flags for linking.
- Split the standard library into its own package
- Centralize rustlib/ under /usr/lib/ for multilib integration.
This commit is contained in:
Josh Stone 2016-11-11 23:34:00 -08:00
parent 1a280df726
commit e11f49f736
5 changed files with 128 additions and 72 deletions

5
.gitignore vendored
View File

@ -11,3 +11,8 @@
/rustc-1.11.0-x86_64-unknown-linux-gnu.tar.gz /rustc-1.11.0-x86_64-unknown-linux-gnu.tar.gz
/rustc-1.12.0-src.tar.gz /rustc-1.12.0-src.tar.gz
/rustc-1.12.1-src.tar.gz /rustc-1.12.1-src.tar.gz
/rustc-1.13.0-src.tar.gz
/rustc-1.12.1-aarch64-unknown-linux-gnu.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-x86_64-unknown-linux-gnu.tar.gz

View File

@ -0,0 +1,48 @@
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,32 +0,0 @@
commit f5499a001d9cbde6a672f9d393d9c80c63745f00 (from 0ccd5c802b94fc9206e4ce27a9fbd4bebc66a771)
Merge: 0ccd5c802b94 1cf510d1decf
Author: bors <bors@rust-lang.org>
Date: Wed Aug 24 23:05:47 2016 -0700
Auto merge of #35814 - alexcrichton:armv7-no-neon, r=brson
rustc: Don't enable NEON by default on armv7 Linux
One of the primary platforms for the `armv7-unknown-linux-gnueabihf` target,
Linux distributions, do not enable NEON extensions by default. This PR disables
that feature by defualt but enables the `d16` feature which enables VFP3D16 that
distributions do enable.
Closes #35590
diff --git a/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs b/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs
index 52269f0cd4a0..7e0306a03e2f 100644
--- a/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs
+++ b/src/librustc_back/target/armv7_unknown_linux_gnueabihf.rs
@@ -23,8 +23,9 @@ pub fn target() -> TargetResult {
target_vendor: "unknown".to_string(),
options: TargetOptions {
- features: "+v7,+vfp3,+neon".to_string(),
- cpu: "cortex-a8".to_string(),
+ // Info about features at https://wiki.debian.org/ArmHardFloatPort
+ features: "+v7,+vfp3,+d16,+thumb2".to_string(),
+ cpu: "generic".to_string(),
max_atomic_width: 64,
.. base
}

105
rust.spec
View File

@ -5,11 +5,14 @@
# 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 %bcond_with bootstrap
%global bootstrap_channel 1.11.0 %global bootstrap_channel 1.12.1
%global bootstrap_date 2016-08-16 %global bootstrap_date 2016-10-20
# 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.
# 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
%bcond_with llvm_static %bcond_with llvm_static
@ -24,7 +27,7 @@
%endif %endif
Name: rust Name: rust
Version: 1.12.1 Version: 1.13.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)
@ -55,11 +58,14 @@ ExclusiveArch: x86_64 i686 armv7hl aarch64
%global rust_triple %{_target_cpu}-unknown-linux-gnu %global rust_triple %{_target_cpu}-unknown-linux-gnu
%endif %endif
# merged for 1.13.0 # We're going to override --libdir when configuring to get rustlib into a
Patch1: rust-pr35814-armv7-no-neon.patch # 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 # merged for 1.14.0
Patch2: rust-pr36933-less-neon-again.patch Patch1: rust-pr36933-less-neon-again.patch
Patch2: rust-compiler-rt-pr26-arm-cc.patch
BuildRequires: make BuildRequires: make
BuildRequires: cmake BuildRequires: cmake
@ -98,6 +104,13 @@ Provides: bundled(jquery) = 2.1.4
Provides: bundled(libbacktrace) = 6.1.0 Provides: bundled(libbacktrace) = 6.1.0
Provides: bundled(miniz) = 1.14 Provides: bundled(miniz) = 1.14
# Virtual provides for folks who attempt "dnf install rustc"
Provides: rustc = %{version}-%{release}
Provides: rustc%{?_isa} = %{version}-%{release}
# Always require our exact standard library
Requires: %{name}-std-static%{?_isa} = %{version}-%{release}
# The C compiler is needed at runtime just for linking. Someday rustc might # The C compiler is needed at runtime just for linking. Someday rustc might
# invoke the linker directly, and then we'll only need binutils. # invoke the linker directly, and then we'll only need binutils.
# https://github.com/rust-lang/rust/issues/11937 # https://github.com/rust-lang/rust/issues/11937
@ -112,8 +125,15 @@ Requires: gcc
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.
This package includes the Rust compiler, standard library, and documentation This package includes the Rust compiler and documentation generator.
generator.
%package std-static
Summary: Standard library for Rust
%description std-static
This package includes the standard libraries for building applications
written in Rust.
%package gdb %package gdb
@ -138,10 +158,6 @@ This package includes HTML documentation for the Rust programming language and
its standard library. its standard library.
# TODO: consider a rust-std package containing .../rustlib/$target
# This might allow multilib cross-compilation to work naturally.
%prep %prep
%setup -q -n %{rustc_package} %setup -q -n %{rustc_package}
@ -150,8 +166,8 @@ find %{sources} -name '%{bootstrap_root}.tar.gz' -exec tar -xvzf '{}' ';'
test -f '%{local_rust_root}/bin/rustc' test -f '%{local_rust_root}/bin/rustc'
%endif %endif
%patch1 -p1 -b .no-neon %patch1 -p1 -b .less-neon
%patch2 -p1 -b .less-neon %patch2 -p1 -d src/compiler-rt -b .arm-cc
# unbundle # unbundle
rm -rf src/jemalloc/ rm -rf src/jemalloc/
@ -162,24 +178,18 @@ cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
sed -e '/*\//q' src/libbacktrace/backtrace.h \ sed -e '/*\//q' src/libbacktrace/backtrace.h \
>src/libbacktrace/LICENSE-libbacktrace >src/libbacktrace/LICENSE-libbacktrace
# rust-gdb has hardcoded SYSROOT/lib -- let's make it noarch
sed -i.noarch -e 's#DIRECTORY=".*"#DIRECTORY="%{_datadir}/%{name}/etc"#' \
src/etc/rust-gdb
# These tests assume that alloc_jemalloc is present # These tests assume that alloc_jemalloc is present
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
# Fedora's LLVM doesn't support any mips targets -- see "llc -version".
# Fixed properly by Rust PR36344, which should be released in 1.13.
sed -i.nomips -e '/target=mips/,+1s/^/# unsupported /' \
src/test/run-make/atomic-lock-free/Makefile
%if %without bootstrap %if %without bootstrap
# The hardcoded stage0 "lib" is inappropriate when using Fedora's own rustc # The hardcoded stage0 "lib" is inappropriate when using Fedora's own rustc
sed -i.libdir -e '/^HLIB_RELATIVE/s/lib$/$$(CFG_LIBDIR_RELATIVE)/' mk/main.mk # ... 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 %endif
%if %with llvm_static %if %with llvm_static
@ -192,15 +202,24 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
%build %build
%ifarch aarch64 %ifarch aarch64 %{mips} %{power64}
%if %with bootstrap %if %with bootstrap
# 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.
# 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
# So we can remove this when bootstrap reaches Rust 1.14.0.
export MALLOC_CONF=lg_dirty_mult:-1 export MALLOC_CONF=lg_dirty_mult:-1
%endif %endif
%endif %endif
# Use hardening ldflags.
export RUSTFLAGS="-Clink-args=-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.
%configure --disable-option-checking \ %configure --disable-option-checking \
--libdir=%{common_libdir} \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
--enable-local-rust --local-rust-root=%{local_rust_root} \ --enable-local-rust --local-rust-root=%{local_rust_root} \
--llvm-root=%{_prefix} --disable-codegen-tests \ --llvm-root=%{_prefix} --disable-codegen-tests \
@ -215,11 +234,18 @@ export MALLOC_CONF=lg_dirty_mult:-1
%install %install
%make_install VERBOSE=1 %make_install VERBOSE=1
%if "%{common_libdir}" != "%{_libdir}"
# Fix the installed location of shared libraries.
# (should perhaps use a subdir and ld.so.conf script?)
mkdir -p %{buildroot}/%{_libdir}
mv -v -t %{buildroot}/%{_libdir} %{buildroot}/%{common_libdir}/*.so
%endif
# Remove installer artifacts (manifests, uninstall scripts, etc.) # Remove installer artifacts (manifests, uninstall scripts, etc.)
find %{buildroot}/%{_libdir}/rustlib/ -maxdepth 1 -type f -exec rm -v '{}' '+' find %{buildroot}/%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
# We don't want to ship the target shared libraries for lack of any Rust ABI. # We don't want to ship the target shared libraries for lack of any Rust ABI.
find %{buildroot}/%{_libdir}/rustlib/ -type f -name '*.so' -exec rm -v '{}' '+' find %{buildroot}/%{rustlibdir} -type f -name '*.so' -exec rm -v '{}' '+'
# The remaining shared libraries should be executable for debuginfo extraction. # The remaining shared libraries should be executable for debuginfo extraction.
find %{buildroot}/%{_libdir}/ -type f -name '*.so' -exec chmod -v +x '{}' '+' find %{buildroot}/%{_libdir}/ -type f -name '*.so' -exec chmod -v +x '{}' '+'
@ -243,10 +269,6 @@ rm -f %{buildroot}/%{_docdir}/%{name}/LICENSE-MIT
find %{buildroot}/%{_docdir}/%{name}/html -empty -delete find %{buildroot}/%{_docdir}/%{name}/html -empty -delete
find %{buildroot}/%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' find %{buildroot}/%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
# Move rust-gdb's python scripts so they're noarch
mkdir -p %{buildroot}/%{_datadir}/%{name}
mv -v %{buildroot}/%{_libdir}/rustlib/etc %{buildroot}/%{_datadir}/%{name}/
%check %check
# Note, many of the tests execute in parallel threads, # Note, many of the tests execute in parallel threads,
@ -269,13 +291,20 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || :
%{_mandir}/man1/rustc.1* %{_mandir}/man1/rustc.1*
%{_mandir}/man1/rustdoc.1* %{_mandir}/man1/rustdoc.1*
%{_libdir}/lib* %{_libdir}/lib*
%dir %{_libdir}/rustlib
%{_libdir}/rustlib/%{rust_triple}
%files std-static
%dir %{rustlibdir}
%dir %{rustlibdir}/%{rust_triple}
%dir %{rustlibdir}/%{rust_triple}/lib
%{rustlibdir}/%{rust_triple}/lib/*.rlib
%files gdb %files gdb
%{_bindir}/rust-gdb %{_bindir}/rust-gdb
%{_datadir}/%{name} %dir %{rustlibdir}
%dir %{rustlibdir}/etc
%{rustlibdir}/etc/*.py*
%files doc %files doc
@ -290,6 +319,12 @@ make check-lite VERBOSE=1 -k || python2 src/etc/check-summary.py tmp/*.log || :
%changelog %changelog
* Thu Nov 10 2016 Josh Stone <jistone@redhat.com> - 1.13.0-1
- Update to 1.13.0.
- Use hardening flags for linking.
- Split the standard library into its own package
- Centralize rustlib/ under /usr/lib/ for multilib integration.
* Thu Oct 20 2016 Josh Stone <jistone@redhat.com> - 1.12.1-1 * Thu Oct 20 2016 Josh Stone <jistone@redhat.com> - 1.12.1-1
- Update to 1.12.1. - Update to 1.12.1.

10
sources
View File

@ -1,5 +1,5 @@
2beae9a9bd441553e979e10464829a97 rustc-1.11.0-aarch64-unknown-linux-gnu.tar.gz 23290b9d78356223a29cf37913c3a1c6 rustc-1.13.0-src.tar.gz
7386f1fae4b9e9ef95e281ea27f1446a rustc-1.11.0-armv7-unknown-linux-gnueabihf.tar.gz 199eb41add634e002fbc2b20a2b33e27 rustc-1.12.1-aarch64-unknown-linux-gnu.tar.gz
932c698c242238a68530c2c15fd0b810 rustc-1.11.0-i686-unknown-linux-gnu.tar.gz 60a4a099b166481fe96c165b39441995 rustc-1.12.1-armv7-unknown-linux-gnueabihf.tar.gz
b83d7a1a90c2d80bef97a518022948c8 rustc-1.11.0-x86_64-unknown-linux-gnu.tar.gz f1c1b3c6cd6195e4fbc386a7ab49e64d rustc-1.12.1-i686-unknown-linux-gnu.tar.gz
82db5a9cb9a051bf8ece2f5174cb273b rustc-1.12.1-src.tar.gz a03bdb0111e3b68a3626237d2ec7cb95 rustc-1.12.1-x86_64-unknown-linux-gnu.tar.gz