From 1e72791ace4a556782c06ac146d5f8e5f8412307 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Mon, 6 Aug 2018 15:31:29 +0200 Subject: [PATCH] rust: update to 1.28.0. [ci skip] --- srcpkgs/rust/files/musl.patch | 68 ++--------- .../rust/patches/link-musl-dynamically.patch | 114 ++---------------- srcpkgs/rust/template | 33 ++--- 3 files changed, 36 insertions(+), 179 deletions(-) diff --git a/srcpkgs/rust/files/musl.patch b/srcpkgs/rust/files/musl.patch index 41268746a1..8bcb259789 100644 --- a/srcpkgs/rust/files/musl.patch +++ b/srcpkgs/rust/files/musl.patch @@ -1,59 +1,11 @@ ---- src/llvm/include/llvm/Analysis/TargetLibraryInfo.h 2015-08-04 21:30:36.000000000 +0200 -+++ src/llvm/include/llvm/Analysis/TargetLibraryInfo.h 2015-08-12 14:34:21.732793886 +0200 -@@ -18,6 +18,15 @@ - #include "llvm/IR/Module.h" - #include "llvm/Pass.h" - -+#undef fopen64 -+#undef fseeko64 -+#undef fstat64 -+#undef fstatvfs64 -+#undef ftello64 -+#undef lstat64 -+#undef stat64 -+#undef tmpfile64 -+ - namespace llvm { - /// VecDesc - Describes a possible vectorization of a function. - /// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized ---- src/llvm/lib/Analysis/TargetLibraryInfo.cpp 2015-08-04 21:30:36.000000000 +0200 -+++ src/llvm/lib/Analysis/TargetLibraryInfo.cpp 2015-08-12 14:34:58.542597686 +0200 -@@ -336,14 +336,15 @@ - } - - // The following functions are available on at least Linux: -- if (!T.isOSLinux()) { -+ if (!T.isOSLinux()) -+ TLI.setUnavailable(LibFunc::memalign); -+ if (1 /*!T.isGlibc()*/) { - TLI.setUnavailable(LibFunc::dunder_strdup); - TLI.setUnavailable(LibFunc::dunder_strtok_r); - TLI.setUnavailable(LibFunc::dunder_isoc99_scanf); - TLI.setUnavailable(LibFunc::dunder_isoc99_sscanf); - TLI.setUnavailable(LibFunc::under_IO_getc); - TLI.setUnavailable(LibFunc::under_IO_putc); -- TLI.setUnavailable(LibFunc::memalign); - TLI.setUnavailable(LibFunc::fopen64); - TLI.setUnavailable(LibFunc::fseeko64); - TLI.setUnavailable(LibFunc::fstat64); ---- src/llvm/lib/Support/DynamicLibrary.cpp 2015-08-04 21:30:36.000000000 +0200 -+++ src/llvm/lib/Support/DynamicLibrary.cpp 2015-08-12 13:41:14.397917475 +0200 -@@ -138,7 +138,7 @@ - - // This macro returns the address of a well-known, explicit symbol - #define EXPLICIT_SYMBOL(SYM) \ -- if (!strcmp(symbolName, #SYM)) return &SYM -+ if (!strcmp(symbolName, #SYM)) return (void *) &SYM - - // On linux we have a weird situation. The stderr/out/in symbols are both - // macros and global variables because of standards requirements. So, we ---- src/llvm/utils/unittest/googletest/src/gtest.cc 2015-08-04 21:30:48.000000000 +0200 -+++ src/llvm/utils/unittest/googletest/src/gtest.cc 2015-08-12 13:41:36.965795116 +0200 -@@ -120,6 +120,7 @@ - - #if GTEST_CAN_STREAM_RESULTS_ - # include // NOLINT -+# include // NOLINT - # include // NOLINT - #endif +--- rustc-1.28.0-src/src/librustc_target/spec/x86_64_unknown_linux_musl.rs.orig 2018-08-08 23:21:51.673454236 +0200 ++++ rustc-1.28.0-src/src/librustc_target/spec/x86_64_unknown_linux_musl.rs 2018-08-08 23:23:11.080834122 +0200 +@@ -11,7 +11,7 @@ + use spec::{LinkerFlavor, Target, TargetResult}; + pub fn target() -> TargetResult { +- let mut base = super::linux_musl_base::opts(); ++ let mut base = super::linux_base::opts(); + base.cpu = "x86-64".to_string(); + base.max_atomic_width = Some(64); + base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); diff --git a/srcpkgs/rust/patches/link-musl-dynamically.patch b/srcpkgs/rust/patches/link-musl-dynamically.patch index 7d54007c46..7212eac510 100644 --- a/srcpkgs/rust/patches/link-musl-dynamically.patch +++ b/srcpkgs/rust/patches/link-musl-dynamically.patch @@ -1,6 +1,6 @@ ---- rustc-1.27.0-src/src/bootstrap/compile.rs.orig 2018-06-20 20:41:04.992367746 +0200 -+++ rustc-1.27-0-src/src/bootstrap/compile.rs 2018-06-20 20:41:54.402969673 +0200 -@@ -78,13 +78,6 @@ +--- 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)); @@ -14,7 +14,7 @@ builder.ensure(StdLink { compiler: from, target_compiler: compiler, -@@ -93,11 +86,6 @@ +@@ -93,11 +86,6 @@ impl Step for Std { return; } @@ -23,10 +23,10 @@ - copy_musl_third_party_objects(builder, target, &libdir); - } - - let out_dir = builder.cargo_out(compiler, Mode::Libstd, target); + let out_dir = builder.cargo_out(compiler, Mode::Std, target); builder.clear_if_dirty(&out_dir, &builder.rustc(compiler)); - let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "build"); -@@ -119,20 +107,6 @@ + let mut cargo = builder.cargo(compiler, Mode::Std, target, "build"); +@@ -119,20 +107,6 @@ impl Step for Std { } } @@ -47,103 +47,3 @@ /// Configure cargo to compile the standard library, adding appropriate env vars /// and such. pub fn std_cargo(builder: &Builder, - ---- rustc-1.25.0-src-orig/src/bootstrap/sanity.rs 2018-03-25 16:26:14.000000000 +0200 -+++ rustc-1.25.0-src/src/bootstrap/sanity.rs 2018-03-29 12:49:49.192705213 +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; -@@ -169,34 +169,6 @@ - panic!("the iOS target is only supported on macOS"); - } - -- // Make sure musl-root is valid -- if target.contains("musl") { -- // If this is a native target (host is also musl) and no musl-root is given, -- // fall back to the system toolchain in /usr before giving up -- if build.musl_root(*target).is_none() && build.config.build == *target { -- let target = build.config.target_config.entry(target.clone()) -- .or_insert(Default::default()); -- target.musl_root = Some("/usr".into()); -- } -- match build.musl_root(*target) { -- Some(root) => { -- if fs::metadata(root.join("lib/libc.a")).is_err() { -- panic!("couldn't find libc.a in musl dir: {}", -- root.join("lib").display()); -- } -- if fs::metadata(root.join("lib/libunwind.a")).is_err() { -- panic!("couldn't find libunwind.a in musl dir: {}", -- root.join("lib").display()); -- } -- } -- None => { -- panic!("when targeting MUSL either the rust.musl-root \ -- option or the target.$TARGET.musl-root option must \ -- be specified in config.toml") -- } -- } -- } -- - if target.contains("msvc") { - // There are three builds of cmake on windows: MSVC, MinGW, and - // Cygwin. The Cygwin build does not have generators for Visual - ---- rustc-1.25.0-src/src/liblibc/src/unix/mod.rs 2018-03-25 16:29:43.000000000 +0200 -+++ rustc-1.25.0-src/src/liblibc/src/unix/mod.rs 2018-03-28 18:31:35.073467567 +0200 -@@ -276,13 +276,6 @@ - } 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", -- link(name = "c", kind = "static", -- cfg(target_feature = "crt-static")))] -- #[cfg_attr(feature = "stdbuild", -- link(name = "c", cfg(not(target_feature = "crt-static"))))] -- extern {} - } else if #[cfg(target_os = "emscripten")] { - #[link(name = "c")] - extern {} - ---- rustc-1.25.0-src/src/libunwind/build.rs 2018-03-25 16:26:14.000000000 +0200 -+++ rustc-1.25.0-src/src/libunwind/build.rs 2018-03-28 18:27:35.043788864 +0200 -@@ -15,9 +15,7 @@ - let target = env::var("TARGET").expect("TARGET was not set"); - - if target.contains("linux") { -- if target.contains("musl") { -- // musl is handled in lib.rs -- } else if !target.contains("android") { -+ if !target.contains("android") { - println!("cargo:rustc-link-lib=gcc_s"); - } - } else if target.contains("freebsd") { - ---- rustc-1.25.0-src/src/libunwind/lib.rs 2018-03-25 16:26:14.000000000 +0200 -+++ rustc-1.25.0-src/src/libunwind/lib.rs 2018-03-28 18:27:35.044788854 +0200 -@@ -35,7 +35,3 @@ - } - } - --#[cfg(target_env = "musl")] --#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] --#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] --extern {} ---- rustc-1.27.0-src/src/librustc_target/spec/x86_64_unknown_linux_musl.rs.orig 2018-06-21 01:04:53.727461595 +0200 -+++ rustc-1.27.0-src/src/librustc_target/spec/x86_64_unknown_linux_musl.rs 2018-06-21 01:05:14.786265086 +0200 -@@ -11,7 +11,7 @@ - use spec::{LinkerFlavor, Target, TargetResult}; - - pub fn target() -> TargetResult { -- let mut base = super::linux_musl_base::opts(); -+ let mut base = super::linux_base::opts(); - base.cpu = "x86-64".to_string(); - base.max_atomic_width = Some(64); - base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 3b8bfa3e1d..ba24435984 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -1,9 +1,9 @@ # Template file for 'rust' pkgname=rust -version=1.27.2 +version=1.28.0 revision=1 -_rust_dist_version=1.26.1 -_cargo_dist_version=0.26.0 +_rust_dist_version=1.27.2 +_cargo_dist_version=0.29.0 # NB. if you push any(!) new version, don't forget to put a build # output of musl to https://repo.voidlinux.eu/distfiles/ wrksrc="rustc-${version}-src" @@ -13,13 +13,14 @@ build_style=configure make_build_args="dist VERBOSE=1" only_for_archs="i686 x86_64 x86_64-musl" hostmakedepends="cmake curl pkg-config python" -makedepends="libffi-devel llvm ncurses-devel libxml2-devel zlib-devel" +makedepends="libffi-devel llvm ncurses-devel libxml2-devel libunwind-devel + zlib-devel" short_desc="Safe, concurrent, practical systems language" maintainer="Enno Boland " homepage="http://www.rust-lang.org/" license="MIT, Apache-2.0" distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz" -checksum=9a818c50cdb7880abeaa68b3d97792711e6c64c1cdfb6efdc23f75b8ced0e15d +checksum=1d5a81729c6f23a0a23b584dd249e35abe9c6f7569cee967cc42b1758ecd6486 case "$XBPS_MACHINE" in x86_64-musl) @@ -29,9 +30,9 @@ x86_64-musl) https://repo.voidlinux.eu/distfiles/rust-std-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz https://repo.voidlinux.eu/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.gz" checksum+=" - ecd89cf4b88adf7e13edb439388cbb6709eafdaaec2103aa118dffc445e2c374 - a21106bdb5896db318e928a5ffade540bdd2fc3654f5e0ec0563f9d1762d2fcf - 406a348567577cb2859749f1b1e1a843de20e7c1f305de89d3a3760635c4979e" + 2da811f9a81f63a93d62cefe15f391efaff663438f2c364fd1a522ef576753f4 + e18aea5529d434e0950a77c266c3230ea878e3f3ea8b4114ee5a081092f98037 + d54f7b4c6e8af657e6173e9e0200130b2f297f365ed4c06a4e9029762d975836" ;; x86_64) # extract from src/stage0.txt @@ -40,9 +41,9 @@ x86_64) 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+=" - 45bc1c30e0c473c42889f22b182ec6f0b0fc3be0825e1607c64933592486eb2a - cc7cec9a121a97e8e23c350305a0e4cd4e3b475fd5a36fa6335a585d3c511f0d - aeaa5813aa6615dd7fdde6d870ca257c5b2e9da5e308f8242a08b231605bce0e" + ec3efc17ddbe6625840957049e15ebae960f447c8e8feb7da40c28dd6adf655f + 68984f2233853d3e9c7c56edd72a91b5822157f28fdb42023fb311af68f842dd + 2e62f91aab9ea496209a060e7ec62f088f5081b568a28b88f3c8ea7073db9829" ;; i686) # extract from src/stage0.txt @@ -51,15 +52,19 @@ i686) 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+=" - 86cf7c8e5781330628af8cd794c8965acc95e4a990d7e4555f2f25534677d3f4 - 07be256a2fc95336fb595664c5c494d6e733f0574b145a7f059a786724e814a8 - bc5f5aa32d2f4ba26abf79a900231d06eecc7f1f2e125ed51bf71766550d1879" + a9ba9c97cf4818ab14966617390eadfc3dfd5221033f8f749aebd86c1d722ef9 + 0ac6356223f53ec5f21cea6a9e9e5cd2fee3d45916f831e1ca54853893ec0b73 + 2bc3468b9b470824bf366f7404ad36644ad4d5a41f1be29601fd6a138d3b72a5" ;; esac post_extract() { rm -rf src/llvm + case "$XBPS_MACHINE" in + *-musl) patch -p1 < $FILESDIR/musl.patch ;; + esac + mkdir -p stage0 cp -flr ../rustc-*/rustc/* stage0 cp -flr ../rust-std-*/rust-std-*/* stage0