From 0448c5df9ac7199b707d137a47ed38d4a269a548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Tue, 17 Aug 2021 18:02:42 -0300 Subject: [PATCH 1/2] rust: update to 1.57.0. --- ...ative-libraries-when-linking-static-.patch | 52 ----------- ...dlib-and-musl_root-from-musl-targets.patch | 87 ++++++++++++++----- ...fer-libgcc_eh-over-libunwind-on-musl.patch | 55 ++---------- ...nore-broken-and-non-applicable-tests.patch | 77 ---------------- ...kage-of-musl-libc-for-the-libc-crate.patch | 16 ---- ...patch => 0016-do-not-copy-libunwind.patch} | 0 srcpkgs/rust/patches/fix-ppc32.patch | 6 +- .../need-ssp-nonshared-and-execinfo.patch | 2 +- srcpkgs/rust/patches/xxx-ppcle-ccrs.patch | 29 ------- srcpkgs/rust/patches/xxx-ppcle-gcc.patch | 25 ------ srcpkgs/rust/patches/xxx-ppcle.patch | 60 +------------ srcpkgs/rust/template | 29 +++---- 12 files changed, 89 insertions(+), 349 deletions(-) delete mode 100644 srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch delete mode 100644 srcpkgs/rust/patches/0008-Ignore-broken-and-non-applicable-tests.patch rename srcpkgs/rust/patches/{00016-do-not-copy-libunwind.patch => 0016-do-not-copy-libunwind.patch} (100%) delete mode 100644 srcpkgs/rust/patches/xxx-ppcle-ccrs.patch delete mode 100644 srcpkgs/rust/patches/xxx-ppcle-gcc.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 deleted file mode 100644 index 0fd1ca7d2dfa..000000000000 --- a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch +++ /dev/null @@ -1,52 +0,0 @@ -From baa7ce46f19e3584d70e47c8df28c084e76446da Mon Sep 17 00:00:00 2001 -From: Samuel Holland -Date: Sun, 3 May 2020 17:48:47 +0200 -Subject: [PATCH 03/15] Require static native libraries when linking static - executables - -On ELF targets like Linux, gcc/ld will create a dynamically-linked -executable without warning, even when passed `-static`, when asked to -link to a `.so`. Avoid this confusing and unintended behavior by always -using the static version of libraries when trying to link static -executables. - -Fixes #54243 ---- - src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - -diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index 8bc4e6442..52ff7a52e 100644 ---- a/compiler/rustc_codegen_ssa/src/back/link.rs -+++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -2081,8 +2081,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>( - } - } - --/// Link in all of our upstream crates' native dependencies. Remember that all of these upstream --/// native dependencies are all non-static dependencies. We've got two cases then: -+/// Link in all of our upstream crates' native dependencies. We have two cases: - /// - /// 1. The upstream crate is an rlib. In this case we *must* link in the native dependency because - /// the rlib is just an archive. -@@ -2015,7 +2013,19 @@ - continue; - } - match lib.kind { -- 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. -+ if crate_type == config::CrateType::Executable -+ && sess.crt_static(Some(crate_type)) -+ && !sess.target.options.crt_static_allows_dylibs -+ { -+ cmd.link_staticlib(name) -+ } else { -+ cmd.link_dylib(name) -+ } -+ }, - NativeLibKind::Framework => cmd.link_framework(name), - NativeLibKind::StaticNoBundle => { - // Link "static-nobundle" native libs only if the crate they originate from 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 85a8806e010b..427581c48f54 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 @@ -1,5 +1,5 @@ diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs -index 2fc9ab29f..276736159 100644 +index 2fc9ab29f92..27673615968 100644 --- a/compiler/rustc_target/src/spec/crt_objects.rs +++ b/compiler/rustc_target/src/spec/crt_objects.rs @@ -62,28 +62,6 @@ pub(super) fn all(obj: &str) -> CrtObjects { @@ -32,7 +32,7 @@ index 2fc9ab29f..276736159 100644 new(&[ (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]), diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs -index 5038a967d..b3c0e5bc4 100644 +index 5038a967d0a..b3c0e5bc416 100644 --- a/compiler/rustc_target/src/spec/linux_musl_base.rs +++ b/compiler/rustc_target/src/spec/linux_musl_base.rs @@ -1,16 +1,9 @@ @@ -53,10 +53,10 @@ index 5038a967d..b3c0e5bc4 100644 base } diff --git a/config.toml.example b/config.toml.example -index 6e5584797..5be9882a8 100644 +index 61e57eee782..77943129204 100644 --- a/config.toml.example +++ b/config.toml.example -@@ -638,15 +638,6 @@ changelog-seen = 2 +@@ -668,15 +668,6 @@ changelog-seen = 2 # only use static libraries. If unset, the target's default linkage is used. #crt-static = (bool) @@ -73,7 +73,7 @@ index 6e5584797..5be9882a8 100644 # `wasm32-wasi` target. If you are building wasm32-wasi target, make sure to # create a `[target.wasm32-wasi]` section and move this field there. diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs -index e750c2963..f6ba3032b 100644 +index e750c2963dd..f6ba3032b0d 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs @@ -98,7 +98,7 @@ pub fn find(build: &mut Build) { @@ -130,14 +130,13 @@ index e750c2963..f6ba3032b 100644 } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index ee3527b6b..0a8b78327 100644 +index e9cc7662e63..4971534ba0e 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -179,34 +179,7 @@ fn copy_self_contained_objects( - let mut target_deps = vec![]; +@@ -199,36 +199,7 @@ fn copy_self_contained_objects( // Copies the CRT objects. -- // + // - // 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. @@ -164,12 +163,15 @@ index ee3527b6b..0a8b78327 100644 - builder.copy(&src, &target); - target_deps.push((target, DependencyType::TargetSelfContained)); - } +- +- let libunwind_path = copy_llvm_libunwind(builder, target, &libdir_self_contained); +- target_deps.push((libunwind_path, DependencyType::TargetSelfContained)); - } else if target.ends_with("-wasi") { + if target.ends_with("-wasi") { let srcdir = builder .wasi_root(target) .unwrap_or_else(|| { -@@ -288,15 +261,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car +@@ -312,15 +283,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car .arg("--manifest-path") .arg(builder.src.join("library/test/Cargo.toml")); @@ -186,10 +188,10 @@ index ee3527b6b..0a8b78327 100644 if let Some(p) = builder.wasi_root(target) { let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap()); diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index 483816b98..7517d757c 100644 +index e658d958d0a..914b1390b37 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -165,7 +165,6 @@ pub struct Config { +@@ -172,7 +172,6 @@ pub struct Config { pub missing_tools: bool, // Fallback musl-root for all targets @@ -197,7 +199,7 @@ index 483816b98..7517d757c 100644 pub prefix: Option, pub sysconfdir: Option, pub datadir: Option, -@@ -291,8 +290,6 @@ pub struct Target { +@@ -298,8 +297,6 @@ pub struct Target { pub sanitizers: Option, pub profiler: Option, pub crt_static: Option, @@ -206,7 +208,7 @@ index 483816b98..7517d757c 100644 pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, -@@ -481,7 +478,6 @@ struct Rust { +@@ -493,7 +490,6 @@ struct Rust { default_linker: Option, channel: Option, description: Option, @@ -214,7 +216,7 @@ index 483816b98..7517d757c 100644 rpath: Option, verbose_tests: Option, optimize_tests: Option, -@@ -524,8 +520,6 @@ struct TomlTarget { +@@ -536,8 +532,6 @@ struct TomlTarget { sanitizers: Option, profiler: Option, crt_static: Option, @@ -223,7 +225,7 @@ index 483816b98..7517d757c 100644 wasi_root: Option, qemu_rootfs: Option, no_std: Option, -@@ -846,7 +840,6 @@ impl Config { +@@ -872,7 +866,6 @@ pub fn parse(args: &[String]) -> Config { set(&mut config.llvm_tools_enabled, rust.llvm_tools); config.rustc_parallel = rust.parallel_compiler.unwrap_or(false); config.rustc_default_linker = rust.default_linker; @@ -231,7 +233,7 @@ index 483816b98..7517d757c 100644 config.save_toolstates = rust.save_toolstates.map(PathBuf::from); set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings)); set(&mut config.backtrace_on_ice, rust.backtrace_on_ice); -@@ -892,8 +885,6 @@ impl Config { +@@ -918,8 +911,6 @@ pub fn parse(args: &[String]) -> Config { target.ranlib = cfg.ranlib.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from); target.crt_static = cfg.crt_static; @@ -241,10 +243,10 @@ index 483816b98..7517d757c 100644 target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from); target.sanitizers = cfg.sanitizers; diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py -index 999882a1c..7ccc2b73c 100755 +index 94424cb4548..9ae0cc053e3 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py -@@ -109,34 +109,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", +@@ -114,34 +114,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", "aarch64-linux-android NDK standalone path") v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk", "x86_64-linux-android NDK standalone path") @@ -280,10 +282,18 @@ index 999882a1c..7ccc2b73c 100755 "rootfs in qemu testing, you probably don't want to use this") v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs", diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs -index 24da44b93..c08bc6d94 100644 +index 2d4e1527897..3abe9f4a143 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -927,25 +927,6 @@ impl Build { +@@ -277,7 +277,6 @@ pub struct Build { + struct Crate { + name: Interned, + deps: HashSet>, +- id: String, + path: PathBuf, + } + +@@ -1056,25 +1055,6 @@ fn crt_static(&self, target: TargetSelection) -> Option { } } @@ -309,11 +319,40 @@ index 24da44b93..c08bc6d94 100644 /// Returns the sysroot for the wasi target, if defined fn wasi_root(&self, target: TargetSelection) -> Option<&Path> { self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p) +diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs +index a38391c7b88..65e229697dc 100644 +--- a/src/bootstrap/metadata.rs ++++ b/src/bootstrap/metadata.rs +@@ -14,7 +14,6 @@ struct Output { + + #[derive(Deserialize)] + struct Package { +- id: String, + name: String, + source: Option, + manifest_path: String, +@@ -50,7 +49,7 @@ pub fn build(build: &mut Build) { + .filter(|dep| dep.source.is_none()) + .map(|dep| INTERNER.intern_string(dep.name)) + .collect(); +- build.crates.insert(name, Crate { name, id: package.id, deps, path }); ++ build.crates.insert(name, Crate { name, deps, path }); + } + } + } diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs -index ed0cbdf97..44937aed9 100644 +index d7db2cef24f..a791177956d 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs -@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) { +@@ -11,7 +11,6 @@ + use std::collections::HashMap; + use std::env; + use std::ffi::{OsStr, OsString}; +-use std::fs; + use std::path::PathBuf; + use std::process::Command; + +@@ -178,28 +177,6 @@ pub fn check(build: &mut Build) { } } @@ -339,6 +378,6 @@ index ed0cbdf97..44937aed9 100644 - } - } - - if target.contains("msvc") { + if need_cmake && target.contains("msvc") { // There are three builds of cmake on windows: MSVC, MinGW, and // Cygwin. The Cygwin build does not have generators for Visual diff --git a/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch index 58ffd0776912..30cb66fc24b1 100644 --- a/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch +++ b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch @@ -13,51 +13,12 @@ diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 9182e349b19..0377fbb58fc 100644 --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs -@@ -23,6 +23,6 @@ cfg_if::cfg_if! { - } - - #[cfg(target_env = "musl")] --#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] -+#[link(name = "gcc_eh", cfg(target_feature = "crt-static"))] - #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] - extern {} -diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs -index f24d957..28828e5 100644 ---- a/library/unwind/build.rs -+++ b/library/unwind/build.rs -@@ -5,17 +5,12 @@ - let target = env::var("TARGET").expect("TARGET was not set"); - - if cfg!(feature = "llvm-libunwind") -- && ((target.contains("linux") && !target.contains("musl")) || target.contains("fuchsia")) -+ && (target.contains("linux") || target.contains("fuchsia")) - { - // Build the unwinding from libunwind C/C++ source code. - llvm_libunwind::compile(); - } else if target.contains("x86_64-fortanix-unknown-sgx") { - llvm_libunwind::compile(); -- } else if target.contains("linux") { -- // linking for Linux is handled in lib.rs -- if target.contains("musl") { -- llvm_libunwind::compile(); -- } - } else if target.contains("freebsd") { - println!("cargo:rustc-link-lib=gcc_s"); - } else if target.contains("rumprun") { -@@ -143,15 +138,6 @@ - cfg.file(root.join("src").join(src)); - } - -- if target_env == "musl" { -- // use the same C compiler command to compile C++ code so we do not need to setup the -- // C++ compiler env variables on the builders -- cfg.cpp(false); -- // linking for musl is handled in lib.rs -- cfg.cargo_metadata(false); -- println!("cargo:rustc-link-search=native={}", env::var("OUT_DIR").unwrap()); -- } -- - cfg.compile("unwind"); +@@ -51,7 +51,7 @@ + #[link(name = "unwind", cfg(not(target_feature = "crt-static")))] + extern "C" {} + } else { +- #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))] ++ #[link(name = "gcc_eh", cfg(target_feature = "crt-static"))] + #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] + extern "C" {} } - } - diff --git a/srcpkgs/rust/patches/0008-Ignore-broken-and-non-applicable-tests.patch b/srcpkgs/rust/patches/0008-Ignore-broken-and-non-applicable-tests.patch deleted file mode 100644 index aa6e829074ae..000000000000 --- a/srcpkgs/rust/patches/0008-Ignore-broken-and-non-applicable-tests.patch +++ /dev/null @@ -1,77 +0,0 @@ -From c63745a2777648d530898bae5af9d25266472b05 Mon Sep 17 00:00:00 2001 -From: Samuel Holland -Date: Sat, 21 Dec 2019 17:00:40 +0100 -Subject: [PATCH 08/15] Ignore broken and non-applicable tests - -c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, #56475 -env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox) -long-linker-command-lines: takes >10 minutes to run (but still passes) -simd-intrinsic-generic-bitmask.rs: broken on BE, #59356 -simd-intrinsic-generic-select.rs: broken on BE, #59356 -sparc-struct-abi: no sparc target -sysroot-crates-are-unstable: can't run rustc without RPATH ---- - src/test/codegen/sparc-struct-abi.rs | 1 + - src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile | 2 ++ - src/test/run-make-fulldeps/long-linker-command-lines/Makefile | 2 ++ - src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 2 ++ - src/test/ui/env-funky-keys.rs | 1 + - src/test/ui/simd/simd-intrinsic-generic-bitmask.rs | 2 ++ - 6 files changed, 10 insertions(+) - -diff --git a/src/test/codegen/sparc-struct-abi.rs b/src/test/codegen/sparc-struct-abi.rs -index 78e5b14a..6f93e932 100644 ---- a/src/test/codegen/sparc-struct-abi.rs -+++ b/src/test/codegen/sparc-struct-abi.rs -@@ -4,6 +4,7 @@ - - // only-sparc64 - // compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib -+// ignore-test - #![feature(no_core, lang_items)] - #![no_core] - -diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile -index f124ca2a..363b18f0 100644 ---- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile -+++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile -@@ -1,3 +1,5 @@ -+# ignore-aarch64 -+ - -include ../tools.mk - - all: -diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile -index 5876fbc9..5f167ece 100644 ---- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile -+++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile -@@ -1,3 +1,5 @@ -+# ignore-test -+ - -include ../tools.mk - - all: -diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile -index 9e770706..6d92ec5c 100644 ---- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile -+++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile -@@ -1,3 +1,5 @@ -+# ignore-test -+ - -include ../tools.mk - - all: -diff --git a/src/test/ui/env-funky-keys.rs b/src/test/ui/env-funky-keys.rs -index c5c824ac..f3fe047a 100644 ---- a/src/test/ui/env-funky-keys.rs -+++ b/src/test/ui/env-funky-keys.rs -@@ -1,6 +1,7 @@ - // run-pass - // Ignore this test on Android, because it segfaults there. - -+// ignore-test - // ignore-android - // ignore-windows - // ignore-cloudabi no execve -2.26.2 - diff --git a/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch b/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch index 3378ee361742..a9ca5f6c7bba 100644 --- a/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch +++ b/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch @@ -8,22 +8,6 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate vendor/libc/src/unix/mod.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) -diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs -index 6bb71c552..22060a8d7 100644 ---- a/vendor/libc/src/lib.rs -+++ b/vendor/libc/src/lib.rs -@@ -24,10 +24,7 @@ - #![deny(missing_copy_implementations, safe_packed_borrows)] - #![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)] - #![cfg_attr(feature = "rustc-dep-of-std", no_core)] --#![cfg_attr( -- any(feature = "rustc-dep-of-std", target_os = "redox"), -- feature(static_nobundle) --)] -+#![cfg_attr(feature = "rustc-dep-of-std", feature(static_nobundle))] - #![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))] - - #[macro_use] diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs index 238da24b..ffb05ee7 100644 --- a/vendor/libc/src/unix/mod.rs diff --git a/srcpkgs/rust/patches/00016-do-not-copy-libunwind.patch b/srcpkgs/rust/patches/0016-do-not-copy-libunwind.patch similarity index 100% rename from srcpkgs/rust/patches/00016-do-not-copy-libunwind.patch rename to srcpkgs/rust/patches/0016-do-not-copy-libunwind.patch diff --git a/srcpkgs/rust/patches/fix-ppc32.patch b/srcpkgs/rust/patches/fix-ppc32.patch index c5208648a655..739ce4bce7f0 100644 --- a/srcpkgs/rust/patches/fix-ppc32.patch +++ b/srcpkgs/rust/patches/fix-ppc32.patch @@ -9,14 +9,14 @@ Fixes #81334. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index f39e89a9d01f7..061d7ed5ee08b 100644 +index 6750f7a549d..6032a685776 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs -@@ -1237,7 +1237,7 @@ impl<'a> Builder<'a> { +@@ -1299,7 +1299,7 @@ pub fn cargo( // efficient initial-exec TLS model. This doesn't work with `dlopen`, // so we can't use it by default in general, but we can use it for tools // and our own internal libraries. -- if !mode.must_support_dlopen() { +- if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") { + if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") && !target.triple.starts_with("powerpcle-") { rustflags.arg("-Ztls-model=initial-exec"); } diff --git a/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch b/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch index 8c24f04b20cc..fe0377dbc381 100644 --- a/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch +++ b/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch @@ -6,7 +6,7 @@ extern "C" {} + } else if #[cfg(all(target_os = "linux", target_env = "musl"))] { + #[link(name = "ssp_nonshared")] -+ #[link(name = "execinfo")] ++ #[link(name = "execinfo")] + extern "C" {} } else if #[cfg(target_os = "freebsd")] { #[link(name = "execinfo")] diff --git a/srcpkgs/rust/patches/xxx-ppcle-ccrs.patch b/srcpkgs/rust/patches/xxx-ppcle-ccrs.patch deleted file mode 100644 index 06f57aaec5cf..000000000000 --- a/srcpkgs/rust/patches/xxx-ppcle-ccrs.patch +++ /dev/null @@ -1,29 +0,0 @@ -From dc1de5be2b7908adb493b36f5079064083ed9507 Mon Sep 17 00:00:00 2001 -From: q66 -Date: Sat, 3 Jul 2021 19:00:46 +0200 -Subject: [PATCH 1/2] cc-1.0.60: fix powerpcle being matched as as msvc - ---- - vendor/cc-1.0.60/src/lib.rs | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/vendor/cc-1.0.60/src/lib.rs b/vendor/cc-1.0.60/src/lib.rs -index aff6be86..f428ecbb 100644 ---- a/vendor/cc-1.0.60/src/lib.rs -+++ b/vendor/cc-1.0.60/src/lib.rs -@@ -2556,11 +2556,7 @@ impl Tool { - let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { - if fname.contains("clang-cl") { - ToolFamily::Msvc { clang_cl: true } -- } else if fname.contains("cl") -- && !fname.contains("cloudabi") -- && !fname.contains("uclibc") -- && !fname.contains("clang") -- { -+ } else if fname.ends_with("cl") || fname == "cl.exe" { - ToolFamily::Msvc { clang_cl: false } - } else if fname.contains("clang") { - match clang_driver { --- -2.31.1 - diff --git a/srcpkgs/rust/patches/xxx-ppcle-gcc.patch b/srcpkgs/rust/patches/xxx-ppcle-gcc.patch deleted file mode 100644 index b4150fcd8269..000000000000 --- a/srcpkgs/rust/patches/xxx-ppcle-gcc.patch +++ /dev/null @@ -1,25 +0,0 @@ -From bf983e79364d2d1c4a22857fadae8fcdc6646ef3 Mon Sep 17 00:00:00 2001 -From: q66 -Date: Sun, 4 Jul 2021 02:17:26 +0200 -Subject: [PATCH] gcc: fix powerpcle being matched as msvc - ---- - vendor/gcc/src/lib.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vendor/gcc/src/lib.rs b/vendor/gcc/src/lib.rs -index 7980281f..05787ceb 100644 ---- a/vendor/gcc/src/lib.rs -+++ b/vendor/gcc/src/lib.rs -@@ -1549,7 +1549,7 @@ impl Tool { - let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { - if fname.contains("clang") { - ToolFamily::Clang -- } else if fname.contains("cl") && !fname.contains("uclibc") { -+ } else if fname.ends_with("cl") || fname == "cl.exe" { - ToolFamily::Msvc - } else { - ToolFamily::Gnu --- -2.31.1 - diff --git a/srcpkgs/rust/patches/xxx-ppcle.patch b/srcpkgs/rust/patches/xxx-ppcle.patch index ab5c0c56c925..9473e7ad98f3 100644 --- a/srcpkgs/rust/patches/xxx-ppcle.patch +++ b/srcpkgs/rust/patches/xxx-ppcle.patch @@ -30,11 +30,7 @@ Subject: [PATCH] initial ppcle port src/test/ui/target-feature/gate.rs | 1 + src/test/ui/target-feature/invalid-attribute.rs | 1 + src/tools/compiletest/src/util.rs | 1 + - vendor/cc-1.0.60/src/lib.rs | 1 + vendor/cc/src/lib.rs | 1 + - vendor/gcc/src/lib.rs | 3 ++- - vendor/jemallocator/benches/roundtrip.rs | 3 ++- - vendor/jemallocator/src/lib.rs | 3 ++- vendor/rustc-ap-rustc_target/src/spec/mod.rs | 2 ++ .../src/spec/powerpcle_unknown_linux_gnu.rs | 15 +++++++++++++++ .../src/spec/powerpcle_unknown_linux_musl.rs | 15 +++++++++++++++ @@ -57,9 +53,9 @@ index c2e9dba6..8147a3c3 100644 target.os == "linux" && target.arch == "powerpc" && target_env_gnu_like; + let linux_powerpcle_gnu_like = + target.os == "linux" && target.arch == "powerpcle" && target_env_gnu_like; + use SpecAbi::*; let rust_abi = matches!(sig.abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall); - // Handle safe Rust thin and fat pointers. @@ -2850,7 +2852,8 @@ where || (!win_x64_gnu && !linux_s390x_gnu_like @@ -394,18 +390,6 @@ index 7dbd7094..08c9de3c 100644 ("powerpc64", "powerpc64"), ("powerpc64le", "powerpc64"), ("riscv64gc", "riscv64"), -diff --git a/vendor/cc-1.0.60/src/lib.rs b/vendor/cc-1.0.60/src/lib.rs -index f428ecbb..841e459a 100644 ---- a/vendor/cc-1.0.60/src/lib.rs -+++ b/vendor/cc-1.0.60/src/lib.rs -@@ -2302,6 +2302,7 @@ impl Build { - "mipsisa64r6-unknown-linux-gnuabi64" => Some("mipsisa64r6-linux-gnuabi64"), - "mipsisa64r6el-unknown-linux-gnuabi64" => Some("mipsisa64r6el-linux-gnuabi64"), - "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"), -+ "powerpcle-unknown-linux-gnu" => Some("powerpcle-linux-gnu"), - "powerpc-unknown-linux-gnuspe" => Some("powerpc-linux-gnuspe"), - "powerpc-unknown-netbsd" => Some("powerpc--netbsd"), - "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"), diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs index 5051b296..286c2fb7 100644 --- a/vendor/cc/src/lib.rs @@ -418,48 +402,6 @@ index 5051b296..286c2fb7 100644 "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"), "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"), "riscv32i-unknown-none-elf" => self.find_working_gnu_prefix(&[ -diff --git a/vendor/gcc/src/lib.rs b/vendor/gcc/src/lib.rs -index 1fe73012..7980281f 100644 ---- a/vendor/gcc/src/lib.rs -+++ b/vendor/gcc/src/lib.rs -@@ -1367,7 +1367,8 @@ impl Build { - "mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"), - "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"), - "powerpc-unknown-netbsd" => Some("powerpc--netbsd"), -- "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"), -+ "powerpcle-unknown-linux-gnu" => Some("powerpcle-linux-gnu"), -+ "powerpc64-unknown-linux-gnu" => Some("powerpc64-linux-gnu"), - "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"), - "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"), - "sparc64-unknown-netbsd" => Some("sparc64--netbsd"), -diff --git a/vendor/jemallocator/benches/roundtrip.rs b/vendor/jemallocator/benches/roundtrip.rs -index eddbb6bb..db81596b 100644 ---- a/vendor/jemallocator/benches/roundtrip.rs -+++ b/vendor/jemallocator/benches/roundtrip.rs -@@ -26,7 +26,8 @@ static A: Jemalloc = Jemalloc; - target_arch = "arm", - target_arch = "mips", - target_arch = "mipsel", -- target_arch = "powerpc" -+ target_arch = "powerpc", -+ target_arch = "powerpcle" - )))] - const MIN_ALIGN: usize = 8; - #[cfg(all(any( -diff --git a/vendor/jemallocator/src/lib.rs b/vendor/jemallocator/src/lib.rs -index f0a3692d..43889c55 100644 ---- a/vendor/jemallocator/src/lib.rs -+++ b/vendor/jemallocator/src/lib.rs -@@ -37,7 +37,8 @@ use libc::{c_int, c_void}; - target_arch = "arm", - target_arch = "mips", - target_arch = "mipsel", -- target_arch = "powerpc" -+ target_arch = "powerpc", -+ target_arch = "powerpcle" - )))] - const MIN_ALIGN: usize = 8; - #[cfg(all(any( diff --git a/vendor/rustc-ap-rustc_target/src/spec/mod.rs b/vendor/rustc-ap-rustc_target/src/spec/mod.rs index 2af46693..986d84e0 100644 --- a/vendor/rustc-ap-rustc_target/src/spec/mod.rs diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index f31ea7b87b81..0f7ba7b33273 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -8,9 +8,9 @@ # uploaded to https://alpha.de.repo.voidlinux.org/distfiles/ # pkgname=rust -version=1.53.0 +version=1.57.0 revision=1 -_rust_dist_version=1.53.0 +_rust_dist_version=1.57.0 wrksrc="rustc-${version}-src" hostmakedepends="cmake curl pkg-config python3 tar" makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12" @@ -20,7 +20,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=5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9 +checksum=3546f9c3b91b1f8b8efd26c94d6b50312c08210397b4072ed2748e2bd4445c1a lib32disabled=yes build_options="bindist" @@ -44,7 +44,7 @@ case "$XBPS_MACHINE" in ppc*) # custom bootstrap tarballs still use cargo versioning, so override _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" - _cargo_dist_version="0.54.0" + _cargo_dist_version="0.58.0" ;; esac @@ -55,15 +55,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz case "$XBPS_MACHINE" in i686) checksum+=" - deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927" + 9898a1fae2647f930fa14b9c160a1d22e67ccc70ac0d2d8f79ef1ffcf8d89af7" ;; x86_64) checksum+=" - e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b" + ed2013713ae742895af5df8d91c5430ba9ba3c781e3bc7f3471b220cc06d565d" ;; x86_64-musl) checksum+=" - ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b" + 0d8564d0348843d6c08d98990d9eac50b7b7ab790f89d514b4f45079e786d932" ;; ppc64le) checksum+=" @@ -110,18 +110,18 @@ else case "$XBPS_MACHINE" in i686) checksum+=" - 93b05456ea8500864e020cfbb1dfbe0a93651406432b6950013f87b91ea6ff47 - d63690da8adb531bb92e76e211b37d3cf941fa841eaaaa210cce4cd6301ca64a" + 9bade3fcd246b0ad6859fcf5d0a80d3eb833e5410efa3a5552c241865562461e + 586e7fd521a058cbf4778abb67d7d078dd4820d356351d0b6a719e21d00966db" ;; x86_64) checksum+=" - 9c2f0443a546dd18f1f020c7711a7b9864432545ceb812e79315c1e76508b193 - 66d5257bbd194db08e67ca63a74cc80cdc4a36eaa30bf7dfe65861d9deaff7f7" + c42f40c5279a3a9d539cae93dbcab9d333777ad9a60a5b9f1086b874ef63db86 + ccdc72d06c90841b7227ec3630337881eeda3da5fbe87328d2e9d705f6f8016c" ;; x86_64-musl) checksum+=" - 50de8b4bcb0819ec0ca363e0aa53fc1c55bc85f53bc82da8dce20a132da7e7d9 - 413449866616b1cd048da1356a41d977bf4e037cce114f07c3afbb0497b3e4c6" + 5b04e0e0bbf140f7c49baa6280114c28f59f6de50481bdd45074eebf629c174c + 818213a6444503ed6adf0231d3c71de990d4c26926c62e8c602bb7e2d636fb94" ;; ppc64le) checksum+=" @@ -189,10 +189,7 @@ post_patch() { # clear out all the checksum nonsense of patched vendor crates _clear_vendor_checksums libc _clear_vendor_checksums typenum - _clear_vendor_checksums cc-1.0.60 - _clear_vendor_checksums gcc _clear_vendor_checksums cc - _clear_vendor_checksums jemallocator _clear_vendor_checksums rustc-ap-rustc_target _clear_vendor_checksums target-lexicon _clear_vendor_checksums tikv-jemallocator From 143304983ab0870b9a5639c3dcb8ac8ba175c163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Tue, 17 Aug 2021 18:02:46 -0300 Subject: [PATCH 2/2] cargo: update to 0.58.0. --- srcpkgs/cargo/template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template index 075646348d9f..bf5b4a8ad230 100644 --- a/srcpkgs/cargo/template +++ b/srcpkgs/cargo/template @@ -1,6 +1,6 @@ # Template file for 'cargo' pkgname=cargo -version=0.54.0 +version=0.58.0 revision=1 wrksrc="cargo-${version}" build_helper=rust @@ -13,7 +13,7 @@ license="MIT, Apache-2.0" homepage="https://crates.io/" distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz https://github.com/crossbeam-rs/crossbeam/archive/refs/tags/crossbeam-utils-0.8.5.tar.gz" -checksum="4627e7eb0be3150d878ed695a1ef874885ff84325019499af61f5e3ade410d4b +checksum="e1d6f55414a29906d24b13c687996b5220e08ccce9c682e4c02851138fc7093f 57db07eb38b0aaf7951c79b4639819cb84bc4269507091afea7267e10a54e079" replaces="cargo-tree>=0" @@ -23,14 +23,14 @@ desc_option_bindist="Generate a tarball for bootstrap" # rust upstream no longer ships cargo-versioned tarballs # need to use the corresponding rust version instead _bootstrap_url="https://static.rust-lang.org/dist" -_cargo_dist_version="1.53.0" +_cargo_dist_version="1.57.0" case "$XBPS_MACHINE" in x86_64*|i686|ppc64le) ;; ppc*) # custom bootstrap tarballs still use cargo versioning, so override _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" - _cargo_dist_version="0.54.0" + _cargo_dist_version="0.58.0" ;; esac @@ -55,7 +55,7 @@ case "$XBPS_MACHINE" in ;; x86_64-musl) checksum+=" - ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b" + 0d8564d0348843d6c08d98990d9eac50b7b7ab790f89d514b4f45079e786d932" ;; ppc64le) checksum+="