From e70d943ba981d1df4b3f9eeea7979031d33589cc Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 30 Sep 2016 22:04:29 -0700 Subject: [PATCH] Update to 1.12.0. - Always use --local-rust-root, even for bootstrap binaries. - Remove the rebuild conditional - the build system now figures it out. - Let minidebuginfo do its thing, since metadata is no longer a note. - Let rust build its own compiler-rt builtins again. --- .gitignore | 5 ++ rust-1.11.0-no-bootstrap-download.patch | 14 ---- rust.spec | 87 +++++++++---------------- sources | 9 +-- 4 files changed, 42 insertions(+), 73 deletions(-) delete mode 100644 rust-1.11.0-no-bootstrap-download.patch diff --git a/.gitignore b/.gitignore index 26590cf..ce23abb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ /rustc-1.10.0-i686-unknown-linux-gnu.tar.gz /rustc-1.10.0-x86_64-unknown-linux-gnu.tar.gz /rustc-1.10.0-armv7-unknown-linux-gnueabihf.tar.gz +/rustc-1.11.0-aarch64-unknown-linux-gnu.tar.gz +/rustc-1.11.0-armv7-unknown-linux-gnueabihf.tar.gz +/rustc-1.11.0-i686-unknown-linux-gnu.tar.gz +/rustc-1.11.0-x86_64-unknown-linux-gnu.tar.gz +/rustc-1.12.0-src.tar.gz diff --git a/rust-1.11.0-no-bootstrap-download.patch b/rust-1.11.0-no-bootstrap-download.patch deleted file mode 100644 index da5a79a..0000000 --- a/rust-1.11.0-no-bootstrap-download.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- rustc-1.11.0/src/etc/get-stage0.py.no-download 2016-08-24 00:34:03.561598809 -0700 -+++ rustc-1.11.0/src/etc/get-stage0.py 2016-08-24 00:34:08.636555684 -0700 -@@ -31,9 +31,8 @@ def main(triple): - filename = 'rustc-{}-{}.tar.gz'.format(channel, triple) - url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename) - dst = dl_dir + '/' + filename -- if os.path.exists(dst): -- os.unlink(dst) -- bootstrap.get(url, dst) -+ if not os.path.exists(dst): -+ bootstrap.get(url, dst) - - stage0_dst = triple + '/stage0' - if os.path.exists(stage0_dst): diff --git a/rust.spec b/rust.spec index 1fa3240..3b6cb64 100644 --- a/rust.spec +++ b/rust.spec @@ -5,24 +5,12 @@ # 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.10.0 -%global bootstrap_date 2016-07-05 - -# Use "rebuild" when building with a distro rustc of the same version. -# Turn this off when the distro has the prior release, matching bootstrap. -# Note, 1.12 will be able to autodetect this via PR34779. -%bcond_without rebuild - -# The script for minidebuginfo copies symbols and *notes* into a "mini" -# ELF object compressed into the .gnu_debugdata section. This includes our -# relatively large .note.rustc metadata, bloating every library. Eventually -# that metadata should be stripped beforehand -- see rust #23366 and #26764. -# Note, 1.12 will move to unallocated data via PR35409, then can be stripped. -%undefine _include_minidebuginfo +%global bootstrap_channel 1.11.0 +%global bootstrap_date 2016-08-16 Name: rust -Version: 1.11.0 -Release: 3%{?dist} +Version: 1.12.0 +Release: 1%{?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) @@ -52,10 +40,8 @@ ExclusiveArch: x86_64 i686 armv7hl %global rust_triple %{_target_cpu}-unknown-linux-gnu %endif -Patch1: rust-1.11.0-no-bootstrap-download.patch - # merged for 1.13.0 -Patch2: rust-pr35814-armv7-no-neon.patch +Patch1: rust-pr35814-armv7-no-neon.patch BuildRequires: make BuildRequires: cmake @@ -67,33 +53,17 @@ BuildRequires: python2 BuildRequires: curl %if %without bootstrap -%if %with rebuild BuildRequires: %{name} < %{version}-%{release} -BuildRequires: %{name} >= %{version} -%else -BuildRequires: %{name} < %{version} BuildRequires: %{name} >= %{bootstrap_channel} -%endif -%endif - -# make check: src/test/run-pass/wait-forked-but-failed-child.rs -BuildRequires: /usr/bin/ps - -# Rust started using cmake for its bundled compiler-rt, but this requires -# llvm-static to be installed. But then llvm-config starts printing flags -# for static linkage, with no way to force it shared. -# -# For now, we'll bypass all that and just use the distro build. Then in the -# next release, Rust is moving toward a true fork of these builtins, with the -# eventual goal of rewriting them in Rust proper. -BuildRequires: compiler-rt -Provides: bundled(compiler-rt) = 3.8 -%ifarch armv7hl -%global clang_builtins %{_libdir}/clang/3.8.0/lib/libclang_rt.builtins-armhf.a +%global local_rust_root %{_prefix} %else -%global clang_builtins %{_libdir}/clang/3.8.0/lib/libclang_rt.builtins-%{_target_cpu}.a +%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 + # TODO: work on unbundling these! Provides: bundled(hoedown) = 3.0.5 Provides: bundled(jquery) = 2.1.4 @@ -147,12 +117,16 @@ its standard library. %prep %setup -q -n %{rustc_package} -%patch1 -p1 -b .no-download -%patch2 -p1 -b .no-neon +%if %with bootstrap +find %{sources} -name '%{bootstrap_root}.tar.gz' -exec tar -xvzf '{}' ';' +test -f '%{local_rust_root}/bin/rustc' +%endif + +%patch1 -p1 -b .no-neon # unbundle -rm -rf src/llvm/ src/jemalloc/ -rm -rf src/compiler-rt/ +rm -rf src/jemalloc/ +rm -rf src/llvm/ # extract bundled licenses for packaging cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown @@ -179,25 +153,17 @@ sed -i.nomips -e '/target=mips/,+1s/^/# unsupported /' \ sed -i.libdir -e '/^HLIB_RELATIVE/s/lib$/$$(CFG_LIBDIR_RELATIVE)/' mk/main.mk %endif -%if %with bootstrap -mkdir -p dl/ -cp -t dl/ %{?SOURCE1} %{?SOURCE2} %{?SOURCE3} %{?SOURCE4} -%endif - %build %configure --disable-option-checking \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ - %{!?with_bootstrap:--enable-local-rust --local-rust-root=%{_prefix} %{?with_rebuild:--enable-local-rebuild}} \ + --enable-local-rust --local-rust-root=%{local_rust_root} \ --llvm-root=%{_prefix} --disable-codegen-tests \ --disable-jemalloc \ --disable-rpath \ --enable-debuginfo \ --release-channel=%{channel} -# Bypass the compiler-rt build -- see above. -cp %{clang_builtins} ./%{rust_triple}/rt/libcompiler-rt.a - %make_build VERBOSE=1 @@ -213,6 +179,10 @@ find %{buildroot}/%{_libdir}/rustlib/ -type f -name '*.so' -exec rm -v '{}' '+' # The remaining shared libraries should be executable for debuginfo extraction. find %{buildroot}/%{_libdir}/ -type f -name '*.so' -exec chmod -v +x '{}' '+' +# They also don't need the .rustc metadata anymore, so they won't support linking. +# (but direct section removal breaks dynamic symbols -- leave it for now...) +#find %{buildroot}/%{_libdir}/ -type f -name '*.so' -exec objcopy -R .rustc '{}' ';' + # FIXME: __os_install_post will strip the rlibs # -- should we find a way to preserve debuginfo? @@ -224,7 +194,7 @@ rm -f %{buildroot}/%{_docdir}/%{name}/LICENSE-MIT # Sanitize the HTML documentation find %{buildroot}/%{_docdir}/%{name}/html -empty -delete -find %{buildroot}/%{_docdir}/%{name}/html -type f -exec chmod -v -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} @@ -273,6 +243,13 @@ make check-lite VERBOSE=1 -k || echo "make check-lite exited with code $?" %changelog +* Fri Sep 30 2016 Josh Stone - 1.12.0-1 +- Update to 1.12.0. +- Always use --local-rust-root, even for bootstrap binaries. +- Remove the rebuild conditional - the build system now figures it out. +- Let minidebuginfo do its thing, since metadata is no longer a note. +- Let rust build its own compiler-rt builtins again. + * Sat Sep 03 2016 Josh Stone - 1.11.0-3 - Rebuild without bootstrap binaries. diff --git a/sources b/sources index 1035e29..a423b9d 100644 --- a/sources +++ b/sources @@ -1,4 +1,5 @@ -bdbd8fa629208c94496adf40c68746a9 rustc-1.11.0-src.tar.gz -059dbecdf8a7360f04450487a19be863 rustc-1.10.0-i686-unknown-linux-gnu.tar.gz -eb49a590e9c30f77bb15741488ef2c2f rustc-1.10.0-x86_64-unknown-linux-gnu.tar.gz -9a7a0bb568cfd3f3d5618e2cac5804ce rustc-1.10.0-armv7-unknown-linux-gnueabihf.tar.gz +2beae9a9bd441553e979e10464829a97 rustc-1.11.0-aarch64-unknown-linux-gnu.tar.gz +7386f1fae4b9e9ef95e281ea27f1446a rustc-1.11.0-armv7-unknown-linux-gnueabihf.tar.gz +932c698c242238a68530c2c15fd0b810 rustc-1.11.0-i686-unknown-linux-gnu.tar.gz +b83d7a1a90c2d80bef97a518022948c8 rustc-1.11.0-x86_64-unknown-linux-gnu.tar.gz +37ee9fc76712e4e94e14947c160bd6d0 rustc-1.12.0-src.tar.gz