From 78571ec254b237abad0d544a675b1239ccc48ff5 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 7 Aug 2020 20:56:38 +0200 Subject: [PATCH] rust: update to 1.45.2 --- ...ative-libraries-when-linking-static-.patch | 15 ++-- ...dlib-and-musl_root-from-musl-targets.patch | 68 ++++++++++--------- ...mically-link-libc-on-musl-by-default.patch | 8 ++- ...nd-result-of-highest-as-f64-.log-2.0.patch | 29 -------- srcpkgs/rust/template | 14 ++-- 5 files changed, 55 insertions(+), 79 deletions(-) delete mode 100644 srcpkgs/rust/patches/0013-round-result-of-highest-as-f64-.log-2.0.patch diff --git a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch b/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch index 54cc27cded5..77e5551e73e 100644 --- a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch +++ b/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch @@ -19,7 +19,7 @@ diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/ba index 0dd2f029..f22b4277 100644 --- a/src/librustc_codegen_ssa/back/link.rs +++ b/src/librustc_codegen_ssa/back/link.rs -@@ -1741,9 +1741,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>( +@@ -1964,9 +1964,7 @@ } } @@ -30,12 +30,12 @@ index 0dd2f029..f22b4277 100644 // // 1. The upstream crate is an rlib. In this case we *must* link in the // native dependency because the rlib is just an archive. -@@ -1792,7 +1790,19 @@ pub fn add_upstream_native_libraries( +@@ -2015,7 +2013,19 @@ continue; } match lib.kind { -- NativeLibraryKind::NativeUnknown => cmd.link_dylib(name), -+ NativeLibraryKind::NativeUnknown => { +- NativeLibKind::Dylib | NativeLibKind::Unspecified => cmd.link_dylib(name), ++ NativeLibKind::Dylib | NativeLibKind::Unspecified => { + // On some targets, like Linux, linking a static executable inhibits using + // dylibs at all. Force native libraries to be static, even if for example + // an upstream rlib was originally linked against a native shared library. @@ -48,9 +48,6 @@ index 0dd2f029..f22b4277 100644 + cmd.link_dylib(name) + } + }, - NativeLibraryKind::NativeFramework => cmd.link_framework(name), - NativeLibraryKind::NativeStaticNobundle => { + NativeLibKind::Framework => cmd.link_framework(name), + NativeLibKind::StaticNoBundle => { // Link "static-nobundle" native libs only if the crate they originate from --- -2.26.2 - diff --git a/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch b/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch index 06e42fdf1e3..e6e88d24a4a 100644 --- a/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch +++ b/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch @@ -89,19 +89,20 @@ diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 65a00db3..01fd2cf3 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -125,18 +125,7 @@ fn copy_third_party_objects( +@@ -125,19 +125,7 @@ target_deps.push(target); }; -- // Copies the crt(1,i,n).o startup objects +- // Copies the CRT 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. +- // rustc historically provides a more self-contained installation for musl targets +- // not requiring the presence of a native musl toolchain. For example, it can fall back +- // to using gcc from a glibc-targeting toolchain for linking. +- // To do that we have to distribute musl startup objects as a part of Rust toolchain +- // and link with them manually in the self-contained mode. - if target.contains("musl") { - let srcdir = builder.musl_root(target).unwrap().join("lib"); -- for &obj in &["crt1.o", "crti.o", "crtn.o"] { +- for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] { - copy_and_stamp(&srcdir, obj); - } - } else if target.ends_with("-wasi") { @@ -109,7 +110,7 @@ index 65a00db3..01fd2cf3 100644 let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi"); copy_and_stamp(&srcdir, "crt1.o"); } -@@ -213,15 +202,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: Interned, cargo: &mut Ca +@@ -216,15 +204,6 @@ .arg("--manifest-path") .arg(builder.src.join("src/libtest/Cargo.toml")); @@ -275,35 +276,40 @@ diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/s index e294e639..58ae91a9 100644 --- a/src/librustc_target/spec/linux_musl_base.rs +++ b/src/librustc_target/spec/linux_musl_base.rs -@@ -3,28 +3,12 @@ use crate::spec::{LinkerFlavor, TargetOptions}; - pub fn opts() -> TargetOptions { - let mut base = super::linux_base::opts(); - -- // Make sure that the linker/gcc really don't pull in anything, including -- // default objects, libs, etc. -- base.pre_link_args_crt.insert(LinkerFlavor::Gcc, Vec::new()); -- base.pre_link_args_crt.get_mut(&LinkerFlavor::Gcc).unwrap().push("-nostdlib".to_string()); -- - // At least when this was tested, the linker would not add the - // `GNU_EH_FRAME` program header to executables generated, which is required - // when unwinding to locate the unwinding information. I'm not sure why this +@@ -10,10 +10,6 @@ // argument is *not* necessary for normal builds, but it can't hurt! base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".to_string()); -- // When generating a statically linked executable there's generally some -- // small setup needed which is listed in these files. These are provided by -- // a musl toolchain and are linked by default by the `musl-gcc` script. Note -- // that `gcc` also does this by default, it just uses some different files. -- // -- // Each target directory for musl has these object files included in it so -- // they'll be included from there. -- base.pre_link_objects_exe_crt.push("crt1.o".to_string()); -- base.pre_link_objects_exe_crt.push("crti.o".to_string()); -- base.post_link_objects_crt.push("crtn.o".to_string()); +- base.pre_link_objects_fallback = crt_objects::pre_musl_fallback(); +- base.post_link_objects_fallback = crt_objects::post_musl_fallback(); +- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl); - // These targets statically link libc by default base.crt_static_default = true; // These targets allow the user to choose between static and dynamic linking. +--- a/src/librustc_target/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200 ++++ b/src/librustc_target/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200 +@@ -61,21 +61,6 @@ + ]) + } + +-pub(super) fn pre_musl_fallback() -> CrtObjects { +- new(&[ +- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o"]), +- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o"]), +- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o"]), +- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o"]), +- (LinkOutputKind::DynamicDylib, &["crti.o"]), +- (LinkOutputKind::StaticDylib, &["crti.o"]), +- ]) +-} +- +-pub(super) fn post_musl_fallback() -> CrtObjects { +- all("crtn.o") +-} +- + pub(super) fn pre_mingw_fallback() -> CrtObjects { + new(&[ + (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]), -- 2.26.2 - diff --git a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch b/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch index 0492242be10..99bd516027b 100644 --- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch +++ b/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch @@ -11,6 +11,11 @@ diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/s index 58ae91a9..1fae72d6 100644 --- a/src/librustc_target/spec/linux_musl_base.rs +++ b/src/librustc_target/spec/linux_musl_base.rs +@@ -1,4 +1,3 @@ +-use crate::spec::crt_objects::{self, CrtObjectsFallback}; + use crate::spec::{LinkerFlavor, TargetOptions}; + + pub fn opts() -> TargetOptions { @@ -9,8 +9,7 @@ pub fn opts() -> TargetOptions { // argument is *not* necessary for normal builds, but it can't hurt! base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".to_string()); @@ -21,6 +26,3 @@ index 58ae91a9..1fae72d6 100644 // These targets allow the user to choose between static and dynamic linking. base.crt_static_respected = true; --- -2.26.2 - diff --git a/srcpkgs/rust/patches/0013-round-result-of-highest-as-f64-.log-2.0.patch b/srcpkgs/rust/patches/0013-round-result-of-highest-as-f64-.log-2.0.patch deleted file mode 100644 index 46fac863858..00000000000 --- a/srcpkgs/rust/patches/0013-round-result-of-highest-as-f64-.log-2.0.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d74af8923022dd369315ada0a06e467dffd127cf Mon Sep 17 00:00:00 2001 -From: Michael Hudson-Doyle -Date: Wed, 13 Mar 2019 15:55:30 +1300 -Subject: [PATCH 13/15] round result of (highest as f64).log(2.0) - -Even though (1024f64).log(2.0) has an exact, representable, value, with -rustc 1.32 on i386 it comes out as +9.999999999999999985 with -optimization enabled. And the rustc doesn't like having two defintions -for U1024 etc. ---- - vendor/typenum/build/main.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vendor/typenum/build/main.rs b/vendor/typenum/build/main.rs -index 9c9f237c..153031a2 100644 ---- a/vendor/typenum/build/main.rs -+++ b/vendor/typenum/build/main.rs -@@ -77,7 +77,7 @@ pub fn no_std() {} - fn main() { - let highest: u64 = 1024; - -- let first2: u32 = (highest as f64).log(2.0) as u32 + 1; -+ let first2: u32 = (highest as f64).log(2.0).round() as u32 + 1; - let first10: u32 = (highest as f64).log(10.0) as u32 + 1; - let uints = (0..(highest + 1)) - .chain((first2..64).map(|i| 2u64.pow(i))) --- -2.26.2 - diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index cba2feba4d2..fc0fd28d538 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -4,9 +4,9 @@ # Permission to use rust and cargo trademark is granted. # See: https://github.com/rust-lang/core-team/issues/4 pkgname=rust -version=1.44.1 +version=1.45.2 revision=1 -_rust_dist_version=1.43.1 +_rust_dist_version=1.44.1 _cargo_dist_version=0.44.0 # Always make sure custom distfiles used for bootstrap are # uploaded to https://alpha.de.repo.voidlinux.org/distfiles/ @@ -19,7 +19,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="7e2e64cb298dd5d5aea52eafe943ba0458fa82f2987fdcda1ff6f537b6f88473" +checksum="b7a3fc1e3ee367260ef945da867da0957f8983705f011ba2a73715375e50e308" lib32disabled=yes patch_args="-Np1" @@ -57,14 +57,14 @@ else ;; x86_64) checksum+=" - a18b89572ff2e55eb9e0428efcdb60eacd82fe28c4d825d169b0ffc9e3c55ceb - dabc62db53c2e7ffeba2824d4c52a938486b04c01a93ecba00c5d529868f6cfc + 958f84334c59f43b321b34fbf437f683b3b1fc51fde89a5572b41415b52372fe + 36059ac75bb226e72e882f5830379b7d31d4ecc0da0cf69df2ddc3441c26eb58 84ba23058542691dae8157beec6a7679a420643eb6a708134bb1dfb01cbdebea" ;; x86_64-musl) checksum+=" - be982dc01b5c86a3f2b0b99a2ca0e13b3cea698ee6f1db9fa024de5c8b35a75d - f3b55147ff6e01448699eaf0875d7956ea38eeef42a19cda9d555e814470e823 + dc3405eaf9dacc1288fb26aa75e50d4ee9b18ed2d558c4b28bdbc6feca3cfc4b + ad6c595d85acd999cadf16d62d889f9f61647ceb666866083336e355dd9c5fdc 653cb60214d6f1000c9a7775111dccd093c0118e7f7bf5f2f1f53a7e5e2420b3" ;; ppc64le)