From f2a05f33b15816f1b92874422407b99d5c9f9ad7 Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Thu, 28 Feb 2019 21:16:42 +0100 Subject: [PATCH] rust: update to 1.33.0. [ci skip] --- ...f5a34c14f08d65cdd198827e3a2fcb63cf39.patch | 33 -------- srcpkgs/rust/patches/libunwind.patch | 9 --- .../rust/patches/link-musl-dynamically.patch | 76 ++++++----------- srcpkgs/rust/template | 81 ++++++++++--------- 4 files changed, 66 insertions(+), 133 deletions(-) delete mode 100644 srcpkgs/rust/patches/1c95f5a34c14f08d65cdd198827e3a2fcb63cf39.patch diff --git a/srcpkgs/rust/patches/1c95f5a34c14f08d65cdd198827e3a2fcb63cf39.patch b/srcpkgs/rust/patches/1c95f5a34c14f08d65cdd198827e3a2fcb63cf39.patch deleted file mode 100644 index afc2cabde4b..00000000000 --- a/srcpkgs/rust/patches/1c95f5a34c14f08d65cdd198827e3a2fcb63cf39.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1c95f5a34c14f08d65cdd198827e3a2fcb63cf39 Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Tue, 22 Jan 2019 11:13:53 -0700 -Subject: [PATCH] Fix issue 57762 - -Issue 57762 points out a compiler crash when the compiler was built -using 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 ---- - src/librustc_codegen_llvm/debuginfo/metadata.rs | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs -index 6deedd0b5ea3..a354eef6887a 100644 ---- a/src/librustc_codegen_llvm/debuginfo/metadata.rs -+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs -@@ -1164,7 +1164,11 @@ 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_util::get_major_version() < 7 -+ // LLVM version 7 did not release with an important bug fix; -+ // but the required patch is in the equivalent Rust LLVM. -+ // See https://github.com/rust-lang/rust/issues/57762. -+ || (llvm_util::get_major_version() == 7 && unsafe { !llvm::LLVMRustIsRustLLVM() }); - } - - // Describes the members of an enum value: An enum is described as a union of diff --git a/srcpkgs/rust/patches/libunwind.patch b/srcpkgs/rust/patches/libunwind.patch index df7c989caf4..d258e7d0866 100644 --- a/srcpkgs/rust/patches/libunwind.patch +++ b/srcpkgs/rust/patches/libunwind.patch @@ -29,15 +29,6 @@ https://github.com/void-linux/void-packages/issues/3605 --- rustc-1.28.0-src/src/bootstrap/sanity.rs.orig 2018-10-11 10:29:34.169735519 +0200 +++ rustc-1.28.0-src/src/bootstrap/sanity.rs 2018-10-11 10:30:02.467509880 +0200 -@@ -21,7 +21,7 @@ - use std::collections::HashMap; - use std::env; - use std::ffi::{OsString, OsStr}; --use std::fs::{self, File}; -+use std::fs::File; - use std::io::Read; - use std::path::PathBuf; - use std::process::Command; @@ -186,34 +186,6 @@ } } diff --git a/srcpkgs/rust/patches/link-musl-dynamically.patch b/srcpkgs/rust/patches/link-musl-dynamically.patch index 417c2fae04f..ed0c1b52196 100644 --- a/srcpkgs/rust/patches/link-musl-dynamically.patch +++ b/srcpkgs/rust/patches/link-musl-dynamically.patch @@ -1,64 +1,38 @@ ---- rustc-1.28.0-src/src/bootstrap/compile.rs.orig 2018-07-31 00:15:53.000000000 +0200 -+++ rustc-1.28.0-src/src/bootstrap/compile.rs 2018-08-06 09:00:00.011914967 +0200 -@@ -78,13 +78,6 @@ impl Step for Std { - }); - builder.info(&format!("Uplifting stage1 std ({} -> {})", from.host, target)); +--- rustc-1.33.0-src/src/bootstrap/compile.rs ++++ rustc-1.33.0-src/src/bootstrap/compile.rs +@@ -114,21 +114,6 @@ impl Step for Std { + fn copy_third_party_objects(builder: &Builder, compiler: &Compiler, target: Interned) { + let libdir = builder.sysroot_libdir(*compiler, target); -- // Even if we're not building std this stage, the new sysroot must -- // still contain the musl startup objects. -- if target.contains("musl") { -- let libdir = builder.sysroot_libdir(compiler, target); -- copy_musl_third_party_objects(builder, target, &libdir); -- } -- - builder.ensure(StdLink { - compiler: from, - target_compiler: compiler, -@@ -101,11 +94,6 @@ - return; - } - -- if target.contains("musl") { -- let libdir = builder.sysroot_libdir(compiler, target); -- copy_musl_third_party_objects(builder, target, &libdir); +- // Copies the crt(1,i,n).o startup objects +- // +- // Since musl supports fully static linking, we can cross link for it even +- // with a glibc-targeting toolchain, given we have the appropriate startup +- // 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") { +- for &obj in &["crt1.o", "crti.o", "crtn.o"] { +- builder.copy( +- &builder.musl_root(target).unwrap().join("lib").join(obj), +- &libdir.join(obj), +- ); - } -- - let mut cargo = builder.cargo(compiler, Mode::Std, target, "build"); - std_cargo(builder, &compiler, target, &mut cargo); - -@@ -119,20 +107,6 @@ impl Step for Std { - } - } - --/// Copies the crt(1,i,n).o startup objects --/// --/// Since musl supports fully static linking, we can cross link for it even --/// with a glibc-targeting toolchain, given we have the appropriate startup --/// files. As those shipped with glibc won't work, copy the ones provided by --/// musl so we have them on linux-gnu hosts. --fn copy_musl_third_party_objects(builder: &Builder, -- target: Interned, -- into: &Path) { -- for &obj in &["crt1.o", "crti.o", "crtn.o"] { -- builder.copy(&builder.musl_root(target).unwrap().join("lib").join(obj), &into.join(obj)); - } --} - - /// Configure cargo to compile the standard library, adding appropriate env vars - /// and such. - pub fn std_cargo(builder: &Builder, - ---- rustc-1.28.0-src/src/liblibc/src/unix/mod.rs.orig 2018-10-14 16:54:15.555482375 +0200 -+++ rustc-1.28.0-src/src/liblibc/src/unix/mod.rs 2018-10-14 16:54:47.153240177 +0200 -@@ -276,13 +276,6 @@ + // Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx. + // + // This target needs to be linked to Fortanix's port of llvm's libunwind. +--- rustc-1.33.0-src/vendor/libc/src/unix/mod.rs ++++ rustc-1.33.0-src/vendor/libc/src/unix/mod.rs +@@ -317,13 +317,6 @@ cfg_if! { } else if #[cfg(feature = "use_std")] { // cargo build, don't pull in anything extra as the libstd dep // already pulls in all libs. - } else if #[cfg(target_env = "musl")] { -- #[cfg_attr(feature = "stdbuild", +- #[cfg_attr(feature = "rustc-dep-of-std", - link(name = "c", kind = "static", - cfg(target_feature = "crt-static")))] -- #[cfg_attr(feature = "stdbuild", +- #[cfg_attr(feature = "rustc-dep-of-std", - link(name = "c", cfg(not(target_feature = "crt-static"))))] - extern {} } else if #[cfg(target_os = "emscripten")] { diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 713fdfc1203..81bd9ab1609 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -1,9 +1,9 @@ # Template file for 'rust' pkgname=rust -version=1.32.0 +version=1.33.0 revision=1 -_rust_dist_version=1.32.0 -_cargo_dist_version=0.32.0 +_rust_dist_version=1.33.0 +_cargo_dist_version=0.33.0 # NB. if you push any(!) new version, don't forget to put a build # output of musl to https://alpha.de.repo.voidlinux.org/distfiles/ wrksrc="rustc-${version}-src" @@ -18,7 +18,7 @@ maintainer="Enno Boland " license="MIT, Apache-2.0" homepage="https://www.rust-lang.org/" distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz" -checksum=4c594c7712a0e7e8eae6526c464bf6ea1d82f77b4f61717c3fc28fb27ba2224a +checksum=5a01a8d7e65126f6079042831385e77485fa5c014bf217e9f3e4aff36a485d94 lib32disabled=yes patch_args="-Np1" @@ -33,15 +33,14 @@ if [ "$CROSS_BUILD" ]; then else case "$XBPS_MACHINE" in x86_64-musl) - hostmakedepends+=" libcurl libgit2" distfiles+=" https://alpha.de.repo.voidlinux.org/distfiles/rustc-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.xz" checksum+=" - 1fa1c8b4b976919e229c8f3ca070ed2235e6f1cecf4967041ef0b8a29a75d517 - bfc82c04c46a58ae09be1f32a11a11000830c257969afbf2a270e6eb36d6533a - 4dfb1cca7730b38920c04731be0e9d47ec520b3365059b4ccd9c0948346787ea" + 27133fe50d7f43009b802d608654c828e4589cf27810fd7151b67de7de3706e0 + 6971b0b9147371eaf81ece7ac6ee91d2f7adbbd3129b9a80170f394c9a35636a + 7d3e669dc5ddde7529ab0df2d0397648a679426fc56dd4c93d94f84fd68366d5" ;; x86_64) # extract from src/stage0.txt @@ -50,9 +49,9 @@ else https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.xz" checksum+=" - 75c31f32e19548c1608611d08b82b87560e02f15caac7b2663a8189a4609977c - 9f2705a3ed3217c13fd55569406c52f590030752f57520312e135223ae930caf - 7e46150e431eaafef9439c9cd958aa8d980a0a70f0bb052473f0a75023930dcc" + 54a342f718b712d8a17fd7878ebd37d22a82ebc70b59c421168cd4153fd04c2b + 661c2ba717ae1502f002b4c6e7aeb8941685c7ea8fe7ac26ed9ede26f615b7af + c2c31db68c4dcb50ad856a19e6f11489a0d4df1212f31bd068dfbb73c5425761" ;; i686) # extract from src/stage0.txt @@ -61,9 +60,9 @@ else https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-i686-unknown-linux-gnu.tar.xz" checksum+=" - 45e633c985c259a13d3b096662241bd8255a86ed4917e0fec396e7071c04c734 - 69bd6064f605c1d0d7d41070efea1e329d75755b04fbc5a13ffc53efdc3a97c7 - 200cf76636ccbb153d5c430a5c0f3ad5af206899f76470e3cd046679a5a4ab3f" + be4cdc82b511b0f2499fc9b7048b01069257ca2dedb270a7938e1846beb5a349 + f4bba5b77c61a30f0a4c83e152f216c62f974185c4c012c295a5d19d44381a62 + 13acdb3c9f2505805ceed8a696f5f62ab8cd73e443cd43d6edd588aad88e1c32" ;; ppc64le) distfiles+=" @@ -71,9 +70,9 @@ else https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-powerpc64le-unknown-linux-gnu.tar.xz https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-powerpc64le-unknown-linux-gnu.tar.xz" checksum+=" - e41bce347e11e9c4868fec2892778e51ed8f3383bd6ee59dd991376c1dea56a9 - b281c20115467429573da6b2b5b7a8863f29e203d7919989e71d91e6914d3bbe - bf426e52beb08e0f663b00b23a89053e713ec15c8e6d69b3f5ae85fe23ad7e18" + 75ef3992b3de501f0b3442315e6ddef9d6f10070174fdd0f3d62e87534fddbc5 + 984d3ca2a47db04345a2bddd657761f66d209ef95a02097ad4bd549f45a0dc9f + 03ece4d677ad59f08a514eb90dd3bd6cad4399fbbaf3d0e916323fbce38e25d1" ;; ppc64le-musl) distfiles+=" @@ -81,9 +80,9 @@ else https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-powerpc64le-unknown-linux-musl.tar.xz https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-powerpc64le-unknown-linux-musl.tar.xz" checksum+=" - bacb713d86be555af4410d685aab475ac63ad66e358f6b00c058253fba275187 - 24b6b79356c7bf113ad34f43c14a7a6cec92b9008b05ab58624ce7a353b0e6d0 - d9d91997a781753474e89dbb9b7dbbef2f6cfad9387def076d51d654f6bc21fa" + f3a493414b07e9b1b535269cd39552ece586ccad3bfadddd92a952e08179844d + 698dbec4d359bb4a378eef807035c9b0b4fffe478e50af044ae47b485b9b6f8e + 801490f04eac96e883f56434747042c375aa3d210b224c2735e02a3a1eab95a0" ;; ppc64-musl) distfiles+=" @@ -91,9 +90,9 @@ else https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-powerpc64-unknown-linux-musl.tar.xz https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-powerpc64-unknown-linux-musl.tar.xz" checksum+=" - fd090e1329687c1b8e3320b40f0b13640444f93cbb7c235d8491c140337c27df - 791d046ecb3203d90263cddb5f53eafdeb042a55923fea35bbb8db223c892603 - ec846d1e9674f60dbd4416d54f74a618288114cea4907b61363adc71b3c8c26f" + 56805b5a8a7a2d07937ab12a00154a64bf756d0c85d0d69573bc27365fc3157b + e9e15702928f2633b1b971911c992c5ed5c552cf4a05f40bc177e53daa05a764 + ae90844974681c3ee85a855ae0ed27f06d22215e40f825f3b7ca705d8a7cfe7b" ;; esac fi @@ -110,23 +109,6 @@ case $XBPS_MACHINE in esac post_extract() { - if [ "$build_option_internal_llvm" ]; then - # patches for Rust's bundled LLVM - pushd src/llvm - for x in ${FILESDIR}/patches/internal_llvm/llvm-*.patch; do - msg_normal "Applying $x to llvm\n" - patch -sNp1 -i ${x} - done - popd - else - rm -rf src/llvm - # patches for system LLVM - for x in ${FILESDIR}/patches/sys-llvm/*.patch; do - msg_normal "Applying patch $x\n" - patch -sNp1 -i ${x} - done - fi - if [ -z "$CROSS_BUILD" ]; then mkdir -p stage0 rm ../rustc-*/rustc/manifest.in @@ -141,6 +123,25 @@ post_extract() { ;; esac fi +} + +post_patch() { + if [ "$build_option_internal_llvm" ]; then + # patches for Rust's bundled LLVM + pushd src/llvm + for x in ${FILESDIR}/patches/internal-llvm/llvm-*.patch; do + msg_normal "Applying $x to llvm\n" + patch -sNp1 -i ${x} + done + popd + else + rm -rf src/llvm + # patches for system LLVM + for x in ${FILESDIR}/patches/sys-llvm/*.patch; do + msg_normal "Applying patch $x\n" + patch -sNp1 -i ${x} + done + fi sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py }