* Re: [PR PATCH] [Updated] [wip] rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
@ 2021-04-16 6:56 ` ericonr
2021-04-16 13:02 ` ericonr
` (33 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-16 6:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
[wip] rust: update to 1.51.0.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 28357 bytes --]
From 655b88a0cbf69fa70021aa8a97ef14a2186c11f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH] rust: update to 1.51.0.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +--
...ative-libraries-when-linking-static-.patch | 21 ++++---
...dlib-and-musl_root-from-musl-targets.patch | 59 ++++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++++++++----------
...mically-link-libc-on-musl-by-default.patch | 26 --------
...kage-of-musl-libc-for-the-libc-crate.patch | 12 ++--
...-against-host-target-LLVM-in-cross-s.patch | 22 +++----
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +++++-----
srcpkgs/rust/patches/build-at-all.patch | 14 +++++
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++++-------
srcpkgs/rust/template | 26 ++++----
11 files changed, 149 insertions(+), 165 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
create mode 100644 srcpkgs/rust/patches/build-at-all.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..366a47b6c55c 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
@@ -138,45 +138,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index ec1308ab8..1fa3ad0c9 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -163,7 +163,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -288,8 +287,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -479,7 +476,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -520,8 +516,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -867,7 +861,6 @@ impl 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;
@@ -184,7 +183,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -912,8 +905,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,7 +191,7 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
--- a/src/bootstrap/configure.py
@@ -261,10 +260,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index 08acc3d67..7a5aaed39 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -175,28 +175,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +272,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,21 +292,27 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
+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
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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.
+- // These targets statically link libc by default
+- base.crt_static_default = true;
+
+ base
+ }
--- a/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
+++ b/compiler/rustc_target/src/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200
@@ -61,21 +61,6 @@
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 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/build-at-all.patch b/srcpkgs/rust/patches/build-at-all.patch
new file mode 100644
index 000000000000..8ed9ad014c26
--- /dev/null
+++ b/srcpkgs/rust/patches/build-at-all.patch
@@ -0,0 +1,14 @@
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index f1a160250..0f5fcb4af 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
+ for el in stack.iter().rev() {
+ out += &format!("\t{:?}\n", el);
+ }
+- panic!(out);
++ panic!("{}", out);
+ }
+ if let Some(out) = self.cache.get(&step) {
+ self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
+
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..50d128546116 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.48.0
+version=1.51.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.51.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,7 +20,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=7a6b9bafc8b3d81bbc566e7c0d1f17c9f499fd22b95142f7ea3a8e4d1f9eb847
lib32disabled=yes
patch_args="-Np1"
@@ -49,15 +49,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 706417391b73a2f8fd90fe664d2dc4003cd623eabcd7805eebcefe56011965a7"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ 2c557e448c145ed773baae0d6533449947bb130f8f8a2a0876d08f55b74a313f"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
;;
ppc64le)
checksum+="
@@ -104,18 +104,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ c3bc02d677cf53b330161bee3a8ff7b1f3ae730b8cd7c43ecda7615fdd5d4839
+ d152e4331c8f0d7c3f548bab04d906afd14257902c831908328eea7e06ca1397"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ feef13f6cd5072f30e2c121b7775d7ac5316998fcf03b68b2537684f3a7fe24a
+ 1199ba8351bb88166050c0fb15a55a23b20b6ead098d7637aaca53b91c5e68ca"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ dd432bee9206bc5edd149a295b912504998ebcc2569cfe68f37f6366f7122723
+ 3a0ddcc426fe79e21f943309258cf40b552e633180536fe90be21e6e492053c3"
;;
ppc64le)
checksum+="
@@ -254,7 +254,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] [wip] rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
2021-04-16 6:56 ` [PR PATCH] [Updated] " ericonr
@ 2021-04-16 13:02 ` ericonr
2021-04-16 23:21 ` ericonr
` (32 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-16 13:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
[wip] rust: update to 1.51.0.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 30388 bytes --]
From e9ae558c1cb2ceae6734470aa90b238c6a89a033 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 1/2] rust: update to 1.51.0.
Also disable tests on CI.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +--
...ative-libraries-when-linking-static-.patch | 21 ++++---
...dlib-and-musl_root-from-musl-targets.patch | 59 ++++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++++++++----------
...mically-link-libc-on-musl-by-default.patch | 26 --------
...kage-of-musl-libc-for-the-libc-crate.patch | 12 ++--
...-against-host-target-LLVM-in-cross-s.patch | 22 +++----
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +++++-----
srcpkgs/rust/patches/build-at-all.patch | 14 +++++
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++++-------
srcpkgs/rust/template | 27 +++++----
11 files changed, 150 insertions(+), 165 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
create mode 100644 srcpkgs/rust/patches/build-at-all.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..366a47b6c55c 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
@@ -138,45 +138,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index ec1308ab8..1fa3ad0c9 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -163,7 +163,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -288,8 +287,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -479,7 +476,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -520,8 +516,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -867,7 +861,6 @@ impl 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;
@@ -184,7 +183,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -912,8 +905,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,7 +191,7 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
--- a/src/bootstrap/configure.py
@@ -261,10 +260,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index 08acc3d67..7a5aaed39 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -175,28 +175,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +272,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,21 +292,27 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
+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
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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.
+- // These targets statically link libc by default
+- base.crt_static_default = true;
+
+ base
+ }
--- a/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
+++ b/compiler/rustc_target/src/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200
@@ -61,21 +61,6 @@
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 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/build-at-all.patch b/srcpkgs/rust/patches/build-at-all.patch
new file mode 100644
index 000000000000..8ed9ad014c26
--- /dev/null
+++ b/srcpkgs/rust/patches/build-at-all.patch
@@ -0,0 +1,14 @@
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index f1a160250..0f5fcb4af 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
+ for el in stack.iter().rev() {
+ out += &format!("\t{:?}\n", el);
+ }
+- panic!(out);
++ panic!("{}", out);
+ }
+ if let Some(out) = self.cache.get(&step) {
+ self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
+
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..cd6f4300c8a2 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.48.0
+version=1.51.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.51.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,8 +20,9 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=7a6b9bafc8b3d81bbc566e7c0d1f17c9f499fd22b95142f7ea3a8e4d1f9eb847
lib32disabled=yes
+make_check=extended
patch_args="-Np1"
build_options="bindist"
@@ -49,15 +50,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 706417391b73a2f8fd90fe664d2dc4003cd623eabcd7805eebcefe56011965a7"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ 2c557e448c145ed773baae0d6533449947bb130f8f8a2a0876d08f55b74a313f"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
;;
ppc64le)
checksum+="
@@ -104,18 +105,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ c3bc02d677cf53b330161bee3a8ff7b1f3ae730b8cd7c43ecda7615fdd5d4839
+ d152e4331c8f0d7c3f548bab04d906afd14257902c831908328eea7e06ca1397"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ feef13f6cd5072f30e2c121b7775d7ac5316998fcf03b68b2537684f3a7fe24a
+ 1199ba8351bb88166050c0fb15a55a23b20b6ead098d7637aaca53b91c5e68ca"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ dd432bee9206bc5edd149a295b912504998ebcc2569cfe68f37f6366f7122723
+ 3a0ddcc426fe79e21f943309258cf40b552e633180536fe90be21e6e492053c3"
;;
ppc64le)
checksum+="
@@ -254,7 +255,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
From 3fe131c07913c59e5cd98505af1455b72217e99b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 2/2] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] [wip] rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
2021-04-16 6:56 ` [PR PATCH] [Updated] " ericonr
2021-04-16 13:02 ` ericonr
@ 2021-04-16 23:21 ` ericonr
2021-04-16 23:34 ` ericonr
` (31 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-16 23:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
[wip] rust: update to 1.51.0.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 30793 bytes --]
From 2b2610077a5371afcebbe10e99f6f802c2b918d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 1/2] rust: update to 1.51.0.
Also disable tests on CI.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +--
...ative-libraries-when-linking-static-.patch | 21 ++++---
...dlib-and-musl_root-from-musl-targets.patch | 59 ++++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++++++++----------
...mically-link-libc-on-musl-by-default.patch | 26 --------
...kage-of-musl-libc-for-the-libc-crate.patch | 12 ++--
...-against-host-target-LLVM-in-cross-s.patch | 22 +++----
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +++++-----
srcpkgs/rust/patches/build-at-all.patch | 14 +++++
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++++-------
srcpkgs/rust/template | 32 ++++++----
11 files changed, 155 insertions(+), 165 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
create mode 100644 srcpkgs/rust/patches/build-at-all.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..366a47b6c55c 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
@@ -138,45 +138,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index ec1308ab8..1fa3ad0c9 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -163,7 +163,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -288,8 +287,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -479,7 +476,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -520,8 +516,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -867,7 +861,6 @@ impl 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;
@@ -184,7 +183,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -912,8 +905,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,7 +191,7 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
--- a/src/bootstrap/configure.py
@@ -261,10 +260,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index 08acc3d67..7a5aaed39 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -175,28 +175,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +272,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,21 +292,27 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
+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
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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.
+- // These targets statically link libc by default
+- base.crt_static_default = true;
+
+ base
+ }
--- a/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
+++ b/compiler/rustc_target/src/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200
@@ -61,21 +61,6 @@
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 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/build-at-all.patch b/srcpkgs/rust/patches/build-at-all.patch
new file mode 100644
index 000000000000..8ed9ad014c26
--- /dev/null
+++ b/srcpkgs/rust/patches/build-at-all.patch
@@ -0,0 +1,14 @@
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index f1a160250..0f5fcb4af 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
+ for el in stack.iter().rev() {
+ out += &format!("\t{:?}\n", el);
+ }
+- panic!(out);
++ panic!("{}", out);
+ }
+ if let Some(out) = self.cache.get(&step) {
+ self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
+
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..e33293c61dce 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.48.0
+version=1.51.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.51.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,8 +20,9 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=7a6b9bafc8b3d81bbc566e7c0d1f17c9f499fd22b95142f7ea3a8e4d1f9eb847
lib32disabled=yes
+make_check=extended
patch_args="-Np1"
build_options="bindist"
@@ -49,15 +50,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 706417391b73a2f8fd90fe664d2dc4003cd623eabcd7805eebcefe56011965a7"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ 2c557e448c145ed773baae0d6533449947bb130f8f8a2a0876d08f55b74a313f"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
;;
ppc64le)
checksum+="
@@ -104,18 +105,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ c3bc02d677cf53b330161bee3a8ff7b1f3ae730b8cd7c43ecda7615fdd5d4839
+ d152e4331c8f0d7c3f548bab04d906afd14257902c831908328eea7e06ca1397"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ feef13f6cd5072f30e2c121b7775d7ac5316998fcf03b68b2537684f3a7fe24a
+ 1199ba8351bb88166050c0fb15a55a23b20b6ead098d7637aaca53b91c5e68ca"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ dd432bee9206bc5edd149a295b912504998ebcc2569cfe68f37f6366f7122723
+ 3a0ddcc426fe79e21f943309258cf40b552e633180536fe90be21e6e492053c3"
;;
ppc64le)
checksum+="
@@ -254,7 +255,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -343,6 +344,11 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # FIXME: cross builds are installing this built for the build machine:
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From 4ea239a62186a24f6f52aeb3055ceaa8eea2c636 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 2/2] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] [wip] rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (2 preceding siblings ...)
2021-04-16 23:21 ` ericonr
@ 2021-04-16 23:34 ` ericonr
2021-04-17 5:20 ` ericonr
` (30 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-16 23:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
[wip] rust: update to 1.51.0.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 31297 bytes --]
From ed15e50ce5ab770265a9a052abfe26227e2c7665 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 1/2] rust: update to 1.51.0.
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave just line linux_gnu_base
- build-at-all.patch is identical to an upstream change
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
Also disable tests on CI.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +--
...ative-libraries-when-linking-static-.patch | 21 ++++---
...dlib-and-musl_root-from-musl-targets.patch | 59 ++++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++++++++----------
...mically-link-libc-on-musl-by-default.patch | 26 --------
...kage-of-musl-libc-for-the-libc-crate.patch | 12 ++--
...-against-host-target-LLVM-in-cross-s.patch | 22 +++----
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +++++-----
srcpkgs/rust/patches/build-at-all.patch | 14 +++++
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++++-------
srcpkgs/rust/template | 33 +++++++----
11 files changed, 156 insertions(+), 165 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
create mode 100644 srcpkgs/rust/patches/build-at-all.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..366a47b6c55c 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
@@ -138,45 +138,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index ec1308ab8..1fa3ad0c9 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -163,7 +163,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -288,8 +287,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -479,7 +476,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -520,8 +516,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -867,7 +861,6 @@ impl 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;
@@ -184,7 +183,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -912,8 +905,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,7 +191,7 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
--- a/src/bootstrap/configure.py
@@ -261,10 +260,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index 08acc3d67..7a5aaed39 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -175,28 +175,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +272,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,21 +292,27 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
+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
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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.
+- // These targets statically link libc by default
+- base.crt_static_default = true;
+
+ base
+ }
--- a/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
+++ b/compiler/rustc_target/src/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200
@@ -61,21 +61,6 @@
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 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/build-at-all.patch b/srcpkgs/rust/patches/build-at-all.patch
new file mode 100644
index 000000000000..8ed9ad014c26
--- /dev/null
+++ b/srcpkgs/rust/patches/build-at-all.patch
@@ -0,0 +1,14 @@
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index f1a160250..0f5fcb4af 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
+ for el in stack.iter().rev() {
+ out += &format!("\t{:?}\n", el);
+ }
+- panic!(out);
++ panic!("{}", out);
+ }
+ if let Some(out) = self.cache.get(&step) {
+ self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
+
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..19bc0484359b 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.48.0
+version=1.51.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.51.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,8 +20,9 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=7a6b9bafc8b3d81bbc566e7c0d1f17c9f499fd22b95142f7ea3a8e4d1f9eb847
lib32disabled=yes
+make_check=extended
patch_args="-Np1"
build_options="bindist"
@@ -49,15 +50,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 706417391b73a2f8fd90fe664d2dc4003cd623eabcd7805eebcefe56011965a7"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ 2c557e448c145ed773baae0d6533449947bb130f8f8a2a0876d08f55b74a313f"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
;;
ppc64le)
checksum+="
@@ -104,18 +105,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ c3bc02d677cf53b330161bee3a8ff7b1f3ae730b8cd7c43ecda7615fdd5d4839
+ d152e4331c8f0d7c3f548bab04d906afd14257902c831908328eea7e06ca1397"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ feef13f6cd5072f30e2c121b7775d7ac5316998fcf03b68b2537684f3a7fe24a
+ 1199ba8351bb88166050c0fb15a55a23b20b6ead098d7637aaca53b91c5e68ca"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ dd432bee9206bc5edd149a295b912504998ebcc2569cfe68f37f6366f7122723
+ 3a0ddcc426fe79e21f943309258cf40b552e633180536fe90be21e6e492053c3"
;;
ppc64le)
checksum+="
@@ -254,7 +255,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -343,6 +344,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From 33073a5518ec07f9c4b0e25b699d168ccff6edc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 2/2] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] [wip] rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (3 preceding siblings ...)
2021-04-16 23:34 ` ericonr
@ 2021-04-17 5:20 ` ericonr
2021-04-17 23:51 ` ericonr
` (29 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-17 5:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
[wip] rust: update to 1.51.0.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 34575 bytes --]
From ed15e50ce5ab770265a9a052abfe26227e2c7665 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 1/3] rust: update to 1.51.0.
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave just line linux_gnu_base
- build-at-all.patch is identical to an upstream change
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
Also disable tests on CI.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +--
...ative-libraries-when-linking-static-.patch | 21 ++++---
...dlib-and-musl_root-from-musl-targets.patch | 59 ++++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++++++++----------
...mically-link-libc-on-musl-by-default.patch | 26 --------
...kage-of-musl-libc-for-the-libc-crate.patch | 12 ++--
...-against-host-target-LLVM-in-cross-s.patch | 22 +++----
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +++++-----
srcpkgs/rust/patches/build-at-all.patch | 14 +++++
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++++-------
srcpkgs/rust/template | 33 +++++++----
11 files changed, 156 insertions(+), 165 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
create mode 100644 srcpkgs/rust/patches/build-at-all.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..366a47b6c55c 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
@@ -138,45 +138,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index ec1308ab8..1fa3ad0c9 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -163,7 +163,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -288,8 +287,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -479,7 +476,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -520,8 +516,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -867,7 +861,6 @@ impl 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;
@@ -184,7 +183,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -912,8 +905,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,7 +191,7 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
--- a/src/bootstrap/configure.py
@@ -261,10 +260,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index 08acc3d67..7a5aaed39 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -175,28 +175,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +272,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,21 +292,27 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
+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
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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.
+- // These targets statically link libc by default
+- base.crt_static_default = true;
+
+ base
+ }
--- a/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
+++ b/compiler/rustc_target/src/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200
@@ -61,21 +61,6 @@
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 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/build-at-all.patch b/srcpkgs/rust/patches/build-at-all.patch
new file mode 100644
index 000000000000..8ed9ad014c26
--- /dev/null
+++ b/srcpkgs/rust/patches/build-at-all.patch
@@ -0,0 +1,14 @@
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index f1a160250..0f5fcb4af 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
+ for el in stack.iter().rev() {
+ out += &format!("\t{:?}\n", el);
+ }
+- panic!(out);
++ panic!("{}", out);
+ }
+ if let Some(out) = self.cache.get(&step) {
+ self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
+
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..19bc0484359b 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.48.0
+version=1.51.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.51.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,8 +20,9 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=7a6b9bafc8b3d81bbc566e7c0d1f17c9f499fd22b95142f7ea3a8e4d1f9eb847
lib32disabled=yes
+make_check=extended
patch_args="-Np1"
build_options="bindist"
@@ -49,15 +50,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 706417391b73a2f8fd90fe664d2dc4003cd623eabcd7805eebcefe56011965a7"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ 2c557e448c145ed773baae0d6533449947bb130f8f8a2a0876d08f55b74a313f"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
;;
ppc64le)
checksum+="
@@ -104,18 +105,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ c3bc02d677cf53b330161bee3a8ff7b1f3ae730b8cd7c43ecda7615fdd5d4839
+ d152e4331c8f0d7c3f548bab04d906afd14257902c831908328eea7e06ca1397"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ feef13f6cd5072f30e2c121b7775d7ac5316998fcf03b68b2537684f3a7fe24a
+ 1199ba8351bb88166050c0fb15a55a23b20b6ead098d7637aaca53b91c5e68ca"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ dd432bee9206bc5edd149a295b912504998ebcc2569cfe68f37f6366f7122723
+ 3a0ddcc426fe79e21f943309258cf40b552e633180536fe90be21e6e492053c3"
;;
ppc64le)
checksum+="
@@ -254,7 +255,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -343,6 +344,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From 33073a5518ec07f9c4b0e25b699d168ccff6edc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 2/3] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
From 4432d44ff7bfdb5dac72c48fd5ceba81308ae9cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sat, 17 Apr 2021 02:19:49 -0300
Subject: [PATCH 3/3] cargo: update to 0.52.0.
---
srcpkgs/cargo/patches/fix-serde.diff | 14 --------------
srcpkgs/cargo/template | 14 +++++++-------
2 files changed, 7 insertions(+), 21 deletions(-)
delete mode 100644 srcpkgs/cargo/patches/fix-serde.diff
diff --git a/srcpkgs/cargo/patches/fix-serde.diff b/srcpkgs/cargo/patches/fix-serde.diff
deleted file mode 100644
index d76499f5cd9f..000000000000
--- a/srcpkgs/cargo/patches/fix-serde.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-This patch was downloaded from "https://github.com/alexcrichton/cargo/commit/f097d02ea62111493b9f06d096a94dfddd020415.diff"
-diff --git src/cargo/util/config/de.rs src/cargo/util/config/de.rs
-index 758f5c23f1..a70cd0dce8 100644
---- src/cargo/util/config/de.rs
-+++ src/cargo/util/config/de.rs
-@@ -527,7 +527,7 @@ impl<'de, 'config> de::MapAccess<'de> for ValueDeserializer<'config> {
- seed.deserialize(Tuple2Deserializer(0i32, path.to_string_lossy()))
- }
- Definition::Environment(env) => {
-- seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
-+ seed.deserialize(Tuple2Deserializer(1i32, env.as_str()))
- }
- Definition::Cli => seed.deserialize(Tuple2Deserializer(2i32, "")),
- }
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index 9c9781d1fc47..0d6920a40e6f 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,7 +1,7 @@
# Template file for 'cargo'
pkgname=cargo
-version=0.49.0
-revision=2
+version=0.52.0
+revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python3 curl cmake pkg-config zlib-devel"
@@ -12,7 +12,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
-checksum=59ba1ce05becb4a5e0772d334d75f9dce3d5487ca288ac986e786241bb1cbac5
+checksum=127be796380ddbd979679f97c01e1e61e4b6d91f1a28560995a7a543bc568f21
replaces="cargo-tree>=0"
build_options="static bindist"
@@ -21,7 +21,7 @@ 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.48.0"
+_cargo_dist_version="1.51.0"
case "$XBPS_MACHINE" in
x86_64*|i686|ppc64le) ;;
@@ -45,15 +45,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 706417391b73a2f8fd90fe664d2dc4003cd623eabcd7805eebcefe56011965a7"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ 2c557e448c145ed773baae0d6533449947bb130f8f8a2a0876d08f55b74a313f"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
;;
ppc64le)
checksum+="
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (4 preceding siblings ...)
2021-04-17 5:20 ` ericonr
@ 2021-04-17 23:51 ` ericonr
2021-04-18 0:03 ` ericonr
` (28 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-17 23:51 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 420 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-821904014
Comment:
Still needs the `nocross for now` commit, but besides that it looks good to go. CI managed to run for all the cross builds :)
Pending on ppc from @q66 if he wants to get those ready before merging.
I have built thunderbird with this toolchain and it seems to be working ok.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (5 preceding siblings ...)
2021-04-17 23:51 ` ericonr
@ 2021-04-18 0:03 ` ericonr
2021-05-06 17:47 ` cinerea0
` (27 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-04-18 0:03 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 165 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-821905212
Comment:
Going to wait on llvm 12
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (6 preceding siblings ...)
2021-04-18 0:03 ` ericonr
@ 2021-05-06 17:47 ` cinerea0
2021-05-06 18:31 ` ericonr
` (26 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-05-06 17:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-833731159
Comment:
@ericonr What is the specific reason for this blocking on llvm 12? Would cargo and rust need to be rebuilt against it when it gets added?
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (7 preceding siblings ...)
2021-05-06 17:47 ` cinerea0
@ 2021-05-06 18:31 ` ericonr
2021-05-10 22:44 ` cinerea0
` (25 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-06 18:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 178 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-833761585
Comment:
@cinerea0 yes, I believe that was it.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (8 preceding siblings ...)
2021-05-06 18:31 ` ericonr
@ 2021-05-10 22:44 ` cinerea0
2021-05-10 22:57 ` ericonr
` (24 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-05-10 22:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-837449254
Comment:
Understood. Given that 1.52.1 has recently come out, are you planning on changing this PR to that release or are going to stick with 1.51?
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (9 preceding siblings ...)
2021-05-10 22:44 ` cinerea0
@ 2021-05-10 22:57 ` ericonr
2021-05-12 14:20 ` [PR PATCH] [Updated] " ericonr
` (23 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-10 22:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-837461324
Comment:
Will definitely update, after my attempt at libreoffice is over.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] rust: update to 1.51.0.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (10 preceding siblings ...)
2021-05-10 22:57 ` ericonr
@ 2021-05-12 14:20 ` ericonr
2021-05-12 14:22 ` rust: update to 1.52.1 ericonr
` (22 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-12 14:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
rust: update to 1.51.0.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 43223 bytes --]
From 31b1612607153b4a50e3ab9cec51a9706054ebf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 1/3] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
From ff8665673ff91917f4f99a8920280e5f1b4849c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 2/3] rust: update to 1.52.1
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave just line linux_gnu_base
- build-at-all.patch is identical to an upstream change
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
Also disable tests in CI.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +-
...ative-libraries-when-linking-static-.patch | 21 +-
...dlib-and-musl_root-from-musl-targets.patch | 209 +++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++--
...mically-link-libc-on-musl-by-default.patch | 26 ---
...kage-of-musl-libc-for-the-libc-crate.patch | 12 +-
...-against-host-target-LLVM-in-cross-s.patch | 22 +-
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +--
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++-
srcpkgs/rust/template | 35 +--
10 files changed, 219 insertions(+), 240 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..872c961e9b9e 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,22 +1,62 @@
-From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Sun, 3 May 2020 17:53:33 +0200
-Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-
----
- config.toml.example | 3 ---
- src/bootstrap/cc_detect.rs | 25 ++----------------
- src/bootstrap/compile.rs | 22 +---------------
- src/bootstrap/config.rs | 7 ------
- src/bootstrap/configure.py | 28 ---------------------
- src/bootstrap/lib.rs | 10 --------
- src/bootstrap/sanity.rs | 22 ----------------
- src/librustc_target/spec/linux_musl_base.rs | 16 ------------
- 8 files changed, 3 insertions(+), 130 deletions(-)
-
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
+index 2fc9ab29f..276736159 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 {
+ ])
+ }
+
+-pub(super) fn pre_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
+- ])
+-}
+-
+-pub(super) fn post_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
+- ])
+-}
+-
+ pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ 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
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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;
+
+ base
+ }
+diff --git a/config.toml.example b/config.toml.example
+index ee06e1bd0..7515ee338 100644
--- a/config.toml.example
+++ b/config.toml.example
-@@ -525,15 +525,6 @@
+@@ -633,15 +633,6 @@ changelog-seen = 2
# only use static libraries. If unset, the target's default linkage is used.
#crt-static = false
@@ -29,14 +69,14 @@ Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-# The full path to the musl libdir.
-#musl-libdir = musl-root/lib
-
- # The root location of the `wasm32-wasi` sysroot.
- #wasi-root = "..."
-
+ # The root location of the `wasm32-wasi` sysroot. Only used for the
+ # `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 a236edf9..54c3cc64 100644
+index e750c2963..f6ba3032b 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
-@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) {
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
cfg.compiler(cc);
} else {
@@ -45,7 +85,7 @@ index a236edf9..54c3cc64 100644
}
let compiler = cfg.get_compiler();
-@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+@@ -126,7 +126,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
@@ -53,16 +93,16 @@ index a236edf9..54c3cc64 100644
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
true
} else {
- false
-@@ -154,7 +154,6 @@ fn set_compiler(
+ // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
+@@ -157,7 +157,6 @@ fn set_compiler(
compiler: Language,
- target: Interned<String>,
+ target: TargetSelection,
config: Option<&Target>,
- build: &Build,
) {
- match &*target {
+ match &*target.triple {
// When compiling for android we may have the NDK configured in the
-@@ -196,26 +195,6 @@ fn set_compiler(
+@@ -200,26 +199,6 @@ fn set_compiler(
}
}
@@ -90,14 +130,13 @@ index a236edf9..54c3cc64 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index 65a00db3..01fd2cf3 100644
+index 9398f2117..e4aea06fd 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
-@@ -169,26 +169,7 @@
- t!(fs::create_dir_all(&libdir_self_contained));
+@@ -177,33 +177,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
-- // Copies the CRT 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
@@ -105,7 +144,9 @@ index 65a00db3..01fd2cf3 100644
- // 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_libdir(target).unwrap();
+- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
+- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
+- });
- for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] {
- copy_and_stamp(
- builder,
@@ -116,14 +157,20 @@ index 65a00db3..01fd2cf3 100644
- DependencyType::TargetSelfContained,
- );
- }
+- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] {
+- let src = compiler_file(builder, builder.cc(target), target, obj);
+- let target = libdir_self_contained.join(obj);
+- builder.copy(&src, &target);
+- target_deps.push((target, DependencyType::TargetSelfContained));
+- }
- } else if target.ends_with("-wasi") {
+ if target.ends_with("-wasi") {
- let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
- copy_and_stamp(
- builder,
-@@ -263,15 +244,6 @@
+ let srcdir = builder
+ .wasi_root(target)
+ .unwrap_or_else(|| {
+@@ -285,15 +259,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
- .arg(builder.src.join("src/libtest/Cargo.toml"));
+ .arg(builder.src.join("library/test/Cargo.toml"));
- // Help the libc crate compile by assisting it in finding various
- // sysroot native libraries.
@@ -138,45 +185,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index b9b090bb2..f3e617970 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -166,7 +166,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -292,8 +291,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -486,7 +483,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -528,8 +524,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -879,7 +873,6 @@ impl 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;
@@ -184,7 +230,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -925,8 +918,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,12 +238,12 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
+index 2e6e9142a..4fbe4deb8 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
-@@ -110,34 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
+@@ -109,34 +109,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")
@@ -232,9 +278,11 @@ index 2a46c563..025928b9 100755
v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
"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 5d708d3b2..8397ebbf0 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
-@@ -876,25 +876,6 @@
+@@ -927,25 +927,6 @@ impl Build {
}
}
@@ -261,10 +309,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index ed0cbdf97..44937aed9 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +321,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,44 +341,3 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
-
-- 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/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
-+++ b/compiler/rustc_target/src/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/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
index 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..8df40053a1eb 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.48.0
+version=1.52.1
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.52.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,8 +20,9 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=3a6f23a26d0e8f87abbfbf32c5cd7daa0c0b71d0986abefc56b9a5fbfbd0bf98
lib32disabled=yes
+make_check=ci-skip
patch_args="-Np1"
build_options="bindist"
@@ -38,7 +39,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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -49,15 +50,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 56e5738e71ebde6af88c6089af99e6785f6b75250781dc64a4ad3639eeb9f0d5"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ d0931a1e728afdfbe3390a2ff3a5256d1668402298a3a6c050ac65ad01c4db2b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 680dbc224f2a1d9a33a256b15be8d1c58dbdfe88aae3ca9c2b0f805fea568ab3"
;;
ppc64le)
checksum+="
@@ -104,18 +105,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ 0db222569292231d5e43d02cab5b724c707737f5654cee3a09f220b88b0f66c1
+ 54749b579a8426dd46afe67feb3c206b0b129e59873a443dcd93ed51232a37d6"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ a5ce7d951dbebd815530c3c571c193c24ae4b83bc1bf431845c0dbfbe1280476
+ dcdc0083facd6484527494ee5b8f72e040a095ab346bb658ce176be573d5c9b4"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ 57a2282e20694ea9dcb8417bd45ad7623c95ccbfac86c58927a7e3479976b21d
+ d5809f3f1345a3c524f00cfa2ac1631b494a6de3143b1a3d081476f2c4f78905"
;;
ppc64le)
checksum+="
@@ -254,7 +255,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -343,6 +344,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From e00254995bdd546503724d01f76eab47d77bd336 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sat, 17 Apr 2021 02:19:49 -0300
Subject: [PATCH 3/3] cargo: update to 0.53.0.
---
srcpkgs/cargo/patches/fix-serde.diff | 14 --------------
srcpkgs/cargo/template | 16 ++++++++--------
2 files changed, 8 insertions(+), 22 deletions(-)
delete mode 100644 srcpkgs/cargo/patches/fix-serde.diff
diff --git a/srcpkgs/cargo/patches/fix-serde.diff b/srcpkgs/cargo/patches/fix-serde.diff
deleted file mode 100644
index d76499f5cd9f..000000000000
--- a/srcpkgs/cargo/patches/fix-serde.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-This patch was downloaded from "https://github.com/alexcrichton/cargo/commit/f097d02ea62111493b9f06d096a94dfddd020415.diff"
-diff --git src/cargo/util/config/de.rs src/cargo/util/config/de.rs
-index 758f5c23f1..a70cd0dce8 100644
---- src/cargo/util/config/de.rs
-+++ src/cargo/util/config/de.rs
-@@ -527,7 +527,7 @@ impl<'de, 'config> de::MapAccess<'de> for ValueDeserializer<'config> {
- seed.deserialize(Tuple2Deserializer(0i32, path.to_string_lossy()))
- }
- Definition::Environment(env) => {
-- seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
-+ seed.deserialize(Tuple2Deserializer(1i32, env.as_str()))
- }
- Definition::Cli => seed.deserialize(Tuple2Deserializer(2i32, "")),
- }
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index 9c9781d1fc47..af52504d2a4e 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,7 +1,7 @@
# Template file for 'cargo'
pkgname=cargo
-version=0.49.0
-revision=2
+version=0.53.0
+revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python3 curl cmake pkg-config zlib-devel"
@@ -12,7 +12,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
-checksum=59ba1ce05becb4a5e0772d334d75f9dce3d5487ca288ac986e786241bb1cbac5
+checksum=f8e292b7b1a9e30f0b201a4c0267427a06a8d814083999fb7b183b5c0f168480
replaces="cargo-tree>=0"
build_options="static bindist"
@@ -21,14 +21,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.48.0"
+_cargo_dist_version="1.52.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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -45,15 +45,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 56e5738e71ebde6af88c6089af99e6785f6b75250781dc64a4ad3639eeb9f0d5"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ d0931a1e728afdfbe3390a2ff3a5256d1668402298a3a6c050ac65ad01c4db2b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 680dbc224f2a1d9a33a256b15be8d1c58dbdfe88aae3ca9c2b0f805fea568ab3"
;;
ppc64le)
checksum+="
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (11 preceding siblings ...)
2021-05-12 14:20 ` [PR PATCH] [Updated] " ericonr
@ 2021-05-12 14:22 ` ericonr
2021-05-12 20:12 ` ericonr
` (21 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-12 14:22 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 148 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-839814282
Comment:
Updated
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (12 preceding siblings ...)
2021-05-12 14:22 ` rust: update to 1.52.1 ericonr
@ 2021-05-12 20:12 ` ericonr
2021-05-12 20:13 ` [PR PATCH] [Updated] " ericonr
` (20 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-12 20:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-840066340
Comment:
Tagging as CI skip to push some cosmetic changes, but fully working CI results can be seen in https://github.com/void-linux/void-packages/actions/runs/835775216
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (13 preceding siblings ...)
2021-05-12 20:12 ` ericonr
@ 2021-05-12 20:13 ` ericonr
2021-05-22 4:47 ` rustysec
` (19 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-12 20:13 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
rust: update to 1.52.1.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
[ci skip]
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 43167 bytes --]
From 3100c9d091a1dee14594180d1f727f9b4e82cddc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 1/3] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
From c0221348c350eeacbc06741129546be87571917a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 2/3] rust: update to 1.52.1
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave just line linux_gnu_base
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
Also disable tests in CI.
---
...to-work-when-cross-compiling-on-musl.patch | 8 +-
...ative-libraries-when-linking-static-.patch | 21 +-
...dlib-and-musl_root-from-musl-targets.patch | 209 +++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++--
...mically-link-libc-on-musl-by-default.patch | 26 ---
...kage-of-musl-libc-for-the-libc-crate.patch | 12 +-
...-against-host-target-LLVM-in-cross-s.patch | 22 +-
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +--
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++-
srcpkgs/rust/template | 35 +--
10 files changed, 219 insertions(+), 240 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..872c961e9b9e 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,22 +1,62 @@
-From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Sun, 3 May 2020 17:53:33 +0200
-Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-
----
- config.toml.example | 3 ---
- src/bootstrap/cc_detect.rs | 25 ++----------------
- src/bootstrap/compile.rs | 22 +---------------
- src/bootstrap/config.rs | 7 ------
- src/bootstrap/configure.py | 28 ---------------------
- src/bootstrap/lib.rs | 10 --------
- src/bootstrap/sanity.rs | 22 ----------------
- src/librustc_target/spec/linux_musl_base.rs | 16 ------------
- 8 files changed, 3 insertions(+), 130 deletions(-)
-
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
+index 2fc9ab29f..276736159 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 {
+ ])
+ }
+
+-pub(super) fn pre_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
+- ])
+-}
+-
+-pub(super) fn post_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
+- ])
+-}
+-
+ pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ 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
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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;
+
+ base
+ }
+diff --git a/config.toml.example b/config.toml.example
+index ee06e1bd0..7515ee338 100644
--- a/config.toml.example
+++ b/config.toml.example
-@@ -525,15 +525,6 @@
+@@ -633,15 +633,6 @@ changelog-seen = 2
# only use static libraries. If unset, the target's default linkage is used.
#crt-static = false
@@ -29,14 +69,14 @@ Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-# The full path to the musl libdir.
-#musl-libdir = musl-root/lib
-
- # The root location of the `wasm32-wasi` sysroot.
- #wasi-root = "..."
-
+ # The root location of the `wasm32-wasi` sysroot. Only used for the
+ # `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 a236edf9..54c3cc64 100644
+index e750c2963..f6ba3032b 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
-@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) {
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
cfg.compiler(cc);
} else {
@@ -45,7 +85,7 @@ index a236edf9..54c3cc64 100644
}
let compiler = cfg.get_compiler();
-@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+@@ -126,7 +126,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
@@ -53,16 +93,16 @@ index a236edf9..54c3cc64 100644
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
true
} else {
- false
-@@ -154,7 +154,6 @@ fn set_compiler(
+ // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
+@@ -157,7 +157,6 @@ fn set_compiler(
compiler: Language,
- target: Interned<String>,
+ target: TargetSelection,
config: Option<&Target>,
- build: &Build,
) {
- match &*target {
+ match &*target.triple {
// When compiling for android we may have the NDK configured in the
-@@ -196,26 +195,6 @@ fn set_compiler(
+@@ -200,26 +199,6 @@ fn set_compiler(
}
}
@@ -90,14 +130,13 @@ index a236edf9..54c3cc64 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index 65a00db3..01fd2cf3 100644
+index 9398f2117..e4aea06fd 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
-@@ -169,26 +169,7 @@
- t!(fs::create_dir_all(&libdir_self_contained));
+@@ -177,33 +177,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
-- // Copies the CRT 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
@@ -105,7 +144,9 @@ index 65a00db3..01fd2cf3 100644
- // 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_libdir(target).unwrap();
+- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
+- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
+- });
- for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] {
- copy_and_stamp(
- builder,
@@ -116,14 +157,20 @@ index 65a00db3..01fd2cf3 100644
- DependencyType::TargetSelfContained,
- );
- }
+- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] {
+- let src = compiler_file(builder, builder.cc(target), target, obj);
+- let target = libdir_self_contained.join(obj);
+- builder.copy(&src, &target);
+- target_deps.push((target, DependencyType::TargetSelfContained));
+- }
- } else if target.ends_with("-wasi") {
+ if target.ends_with("-wasi") {
- let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
- copy_and_stamp(
- builder,
-@@ -263,15 +244,6 @@
+ let srcdir = builder
+ .wasi_root(target)
+ .unwrap_or_else(|| {
+@@ -285,15 +259,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
- .arg(builder.src.join("src/libtest/Cargo.toml"));
+ .arg(builder.src.join("library/test/Cargo.toml"));
- // Help the libc crate compile by assisting it in finding various
- // sysroot native libraries.
@@ -138,45 +185,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index b9b090bb2..f3e617970 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -166,7 +166,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -292,8 +291,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -486,7 +483,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -528,8 +524,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -879,7 +873,6 @@ impl 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;
@@ -184,7 +230,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -925,8 +918,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,12 +238,12 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
+index 2e6e9142a..4fbe4deb8 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
-@@ -110,34 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
+@@ -109,34 +109,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")
@@ -232,9 +278,11 @@ index 2a46c563..025928b9 100755
v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
"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 5d708d3b2..8397ebbf0 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
-@@ -876,25 +876,6 @@
+@@ -927,25 +927,6 @@ impl Build {
}
}
@@ -261,10 +309,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index ed0cbdf97..44937aed9 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +321,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,44 +341,3 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
-
-- 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/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
-+++ b/compiler/rustc_target/src/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/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
index 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..8df40053a1eb 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.48.0
+version=1.52.1
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.52.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
@@ -20,8 +20,9 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=3a6f23a26d0e8f87abbfbf32c5cd7daa0c0b71d0986abefc56b9a5fbfbd0bf98
lib32disabled=yes
+make_check=ci-skip
patch_args="-Np1"
build_options="bindist"
@@ -38,7 +39,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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -49,15 +50,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 56e5738e71ebde6af88c6089af99e6785f6b75250781dc64a4ad3639eeb9f0d5"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ d0931a1e728afdfbe3390a2ff3a5256d1668402298a3a6c050ac65ad01c4db2b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 680dbc224f2a1d9a33a256b15be8d1c58dbdfe88aae3ca9c2b0f805fea568ab3"
;;
ppc64le)
checksum+="
@@ -104,18 +105,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ 0db222569292231d5e43d02cab5b724c707737f5654cee3a09f220b88b0f66c1
+ 54749b579a8426dd46afe67feb3c206b0b129e59873a443dcd93ed51232a37d6"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ a5ce7d951dbebd815530c3c571c193c24ae4b83bc1bf431845c0dbfbe1280476
+ dcdc0083facd6484527494ee5b8f72e040a095ab346bb658ce176be573d5c9b4"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ 57a2282e20694ea9dcb8417bd45ad7623c95ccbfac86c58927a7e3479976b21d
+ d5809f3f1345a3c524f00cfa2ac1631b494a6de3143b1a3d081476f2c4f78905"
;;
ppc64le)
checksum+="
@@ -254,7 +255,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -343,6 +344,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From b75293158bc580056b4e423576f7a9c8e2d75167 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sat, 17 Apr 2021 02:19:49 -0300
Subject: [PATCH 3/3] cargo: update to 0.53.0.
---
srcpkgs/cargo/patches/fix-serde.diff | 14 --------------
srcpkgs/cargo/template | 16 ++++++++--------
2 files changed, 8 insertions(+), 22 deletions(-)
delete mode 100644 srcpkgs/cargo/patches/fix-serde.diff
diff --git a/srcpkgs/cargo/patches/fix-serde.diff b/srcpkgs/cargo/patches/fix-serde.diff
deleted file mode 100644
index d76499f5cd9f..000000000000
--- a/srcpkgs/cargo/patches/fix-serde.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-This patch was downloaded from "https://github.com/alexcrichton/cargo/commit/f097d02ea62111493b9f06d096a94dfddd020415.diff"
-diff --git src/cargo/util/config/de.rs src/cargo/util/config/de.rs
-index 758f5c23f1..a70cd0dce8 100644
---- src/cargo/util/config/de.rs
-+++ src/cargo/util/config/de.rs
-@@ -527,7 +527,7 @@ impl<'de, 'config> de::MapAccess<'de> for ValueDeserializer<'config> {
- seed.deserialize(Tuple2Deserializer(0i32, path.to_string_lossy()))
- }
- Definition::Environment(env) => {
-- seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
-+ seed.deserialize(Tuple2Deserializer(1i32, env.as_str()))
- }
- Definition::Cli => seed.deserialize(Tuple2Deserializer(2i32, "")),
- }
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index 9c9781d1fc47..af52504d2a4e 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,7 +1,7 @@
# Template file for 'cargo'
pkgname=cargo
-version=0.49.0
-revision=2
+version=0.53.0
+revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python3 curl cmake pkg-config zlib-devel"
@@ -12,7 +12,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
-checksum=59ba1ce05becb4a5e0772d334d75f9dce3d5487ca288ac986e786241bb1cbac5
+checksum=f8e292b7b1a9e30f0b201a4c0267427a06a8d814083999fb7b183b5c0f168480
replaces="cargo-tree>=0"
build_options="static bindist"
@@ -21,14 +21,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.48.0"
+_cargo_dist_version="1.52.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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -45,15 +45,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ 56e5738e71ebde6af88c6089af99e6785f6b75250781dc64a4ad3639eeb9f0d5"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ d0931a1e728afdfbe3390a2ff3a5256d1668402298a3a6c050ac65ad01c4db2b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ 680dbc224f2a1d9a33a256b15be8d1c58dbdfe88aae3ca9c2b0f805fea568ab3"
;;
ppc64le)
checksum+="
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (14 preceding siblings ...)
2021-05-12 20:13 ` [PR PATCH] [Updated] " ericonr
@ 2021-05-22 4:47 ` rustysec
2021-05-22 6:05 ` ericonr
` (18 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: rustysec @ 2021-05-22 4:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
New comment by rustysec on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-846349243
Comment:
Is there a status update on this? I have another PR I would like to open but it depends on a newer rust version.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (15 preceding siblings ...)
2021-05-22 4:47 ` rustysec
@ 2021-05-22 6:05 ` ericonr
2021-05-23 13:26 ` paper42
` (17 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-22 6:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 318 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-846357039
Comment:
It's pending on q66 doing the ppc side of things.
You can clone this locally and use it to test your packages, then just make a PR with `pending on rust update` in the name.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (16 preceding siblings ...)
2021-05-22 6:05 ` ericonr
@ 2021-05-23 13:26 ` paper42
2021-05-25 14:53 ` ericonr
` (16 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: paper42 @ 2021-05-23 13:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 2372 bytes --]
New comment by paper42 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-846563195
Comment:
Tests fail for me
```
=> rust-1.52.1_1: running do_check ...
Finished dev [unoptimized + debuginfo] target(s) in 0.24s
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 2` at the top of `config.toml`
thread 'main' panicked at 'error: no rules matched src/test/compile-fail', src/bootstrap/builder.rs:225:17
stack backtrace:
0: rust_begin_unwind
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:493:5
1: std::panicking::begin_panic_fmt
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:435:5
2: bootstrap::builder::StepDescription::run
at ./src/bootstrap/builder.rs:225:17
3: bootstrap::builder::Builder::run_step_descriptions
at ./src/bootstrap/builder.rs:571:9
4: bootstrap::builder::Builder::execute_cli
at ./src/bootstrap/builder.rs:563:9
5: bootstrap::Build::build
at ./src/bootstrap/lib.rs:506:17
6: bootstrap::main
at ./src/bootstrap/bin/main.rs:33:5
7: core::ops::function::FnOnce::call_once
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failed to run: /builddir/rustc-1.52.1-src/build/bootstrap/debug/bootstrap test -j8 --no-doc --no-fail-fast src/test/codegen src/test/codegen-units src/test/compile-fail src/test/incremental src/test/mir-opt src/test/pretty src/test/run-fail src/test/run-fail/pretty src/test/run-make src/test/run-make-fulldeps src/test/ui src/test/ui-fulldeps
Build completed unsuccessfully in 0:00:00
=> ERROR: rust-1.52.1_1: do_check: 'python3 x.py test ${makejobs} --no-doc --no-fail-fast src/test/codegen src/test/codegen-units src/test/compile-fail src/test/incremental src/test/mir-opt src/test/pretty src/test/run-fail src/test/run-fail/pretty src/test/run-make src/test/run-make-fulldeps src/test/ui src/test/ui-fulldeps' exited with 1
=> ERROR: in do_check() at srcpkgs/rust/template:304
```
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (17 preceding siblings ...)
2021-05-23 13:26 ` paper42
@ 2021-05-25 14:53 ` ericonr
2021-05-27 10:35 ` paper42
` (15 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-05-25 14:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-847938194
Comment:
@paper42 any idea why it fails? Could be due to our patching.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (18 preceding siblings ...)
2021-05-25 14:53 ` ericonr
@ 2021-05-27 10:35 ` paper42
2021-06-03 16:18 ` cinerea0
` (14 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: paper42 @ 2021-05-27 10:35 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
New comment by paper42 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-849525407
Comment:
> @paper42 any idea why it fails? Could be due to our patching.
I have no idea, I don't know enough about rust.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (19 preceding siblings ...)
2021-05-27 10:35 ` paper42
@ 2021-06-03 16:18 ` cinerea0
2021-06-03 20:14 ` paper42
` (13 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-03 16:18 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-853999785
Comment:
@paper42 How are you getting this error? Rust compiled fine for me when I tried the commits in this PR last night.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (20 preceding siblings ...)
2021-06-03 16:18 ` cinerea0
@ 2021-06-03 20:14 ` paper42
2021-06-04 4:53 ` cinerea0
` (12 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: paper42 @ 2021-06-03 20:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
New comment by paper42 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-854148483
Comment:
@cinerea0 it compiles fine, check fails.
```
./xbps-src check rust
```
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (21 preceding siblings ...)
2021-06-03 20:14 ` paper42
@ 2021-06-04 4:53 ` cinerea0
2021-06-04 6:35 ` cinerea0
` (11 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-04 4:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 6881 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-854356826
Comment:
Yeah, I'm getting the error now. Here's the output using RUST_BACKTRACE=full:
```
thread 'main' panicked at 'error: no rules matched src/test/compile-fail', src/bootstrap/builder.rs:225:17
stack backtrace:
0: 0x55f848efe6b0 - std::backtrace_rs::backtrace::libunwind::trace::h74532f8b485906a1
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
1: 0x55f848efe6b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h2c8425dd0be5999b
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x55f848efe6b0 - std::sys_common::backtrace::_print_fmt::hd8ce6577f46119ce
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/sys_common/backtrace.rs:67:5
3: 0x55f848efe6b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6289eeebc1f97d57
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/sys_common/backtrace.rs:46:22
4: 0x55f848f22cff - core::fmt::write::h3d3f8a8bb9d4c367
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/core/src/fmt/mod.rs:1092:17
5: 0x55f848ef9e32 - std::io::Write::write_fmt::ha117cbfa72664a7b
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/io/mod.rs:1572:15
6: 0x55f848f015c5 - std::sys_common::backtrace::_print::h112e8a4ac2720a21
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/sys_common/backtrace.rs:49:5
7: 0x55f848f015c5 - std::sys_common::backtrace::print::h2a4ab5824600ebce
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/sys_common/backtrace.rs:36:9
8: 0x55f848f015c5 - std::panicking::default_hook::{{closure}}::h399ab06c3b83a1f2
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:208:50
9: 0x55f848f01073 - std::panicking::default_hook::h7481e93ca9c2d739
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:225:9
10: 0x55f848f01bcd - std::panicking::rust_panic_with_hook::h01f9d4e9485ccb8b
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:591:17
11: 0x55f848f01767 - std::panicking::begin_panic_handler::{{closure}}::h25bff4eb752cc444
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:497:13
12: 0x55f848efeb6c - std::sys_common::backtrace::__rust_end_short_backtrace::h5dfd3f7920e58cc5
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/sys_common/backtrace.rs:141:18
13: 0x55f848f016c9 - rust_begin_unwind
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:493:5
14: 0x55f848484fab - std::panicking::begin_panic_fmt::h5ea05d30b78d4fb2
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:435:5
15: 0x55f848962d57 - bootstrap::builder::StepDescription::run::h7959fb55c5ccedec
at /builddir/rustc-1.52.1-src/src/bootstrap/builder.rs:225:17
16: 0x55f8489664ba - bootstrap::builder::Builder::run_step_descriptions::h1e65121b32641c91
at /builddir/rustc-1.52.1-src/src/bootstrap/builder.rs:571:9
17: 0x55f848966396 - bootstrap::builder::Builder::execute_cli::he17f02d612b6ec68
at /builddir/rustc-1.52.1-src/src/bootstrap/builder.rs:563:9
18: 0x55f84848ae4b - bootstrap::Build::build::he59c79f668638183
at /builddir/rustc-1.52.1-src/src/bootstrap/lib.rs:506:17
19: 0x55f84848675b - bootstrap::main::h4659e37ed446ebcb
at /builddir/rustc-1.52.1-src/src/bootstrap/bin/main.rs:33:5
20: 0x55f848486eab - core::ops::function::FnOnce::call_once::h1a8cd00380f36571
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/core/src/ops/function.rs:227:5
21: 0x55f8484874fe - std::sys_common::backtrace::__rust_begin_short_backtrace::h13d252e39becdd1c
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/sys_common/backtrace.rs:125:18
22: 0x55f8484861f1 - std::rt::lang_start::{{closure}}::h05db9941e783416a
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/rt.rs:66:18
23: 0x55f848f020ca - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::ha7db63b609be77e3
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/core/src/ops/function.rs:259:13
24: 0x55f848f020ca - std::panicking::try::do_call::h715c8c8ca0806d14
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:379:40
25: 0x55f848f020ca - std::panicking::try::h2530c507ef432acf
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:343:19
26: 0x55f848f020ca - std::panic::catch_unwind::h0c4984a63ffdd417
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panic.rs:431:14
27: 0x55f848f020ca - std::rt::lang_start_internal::h12392519f60c6396
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/rt.rs:51:25
28: 0x55f8484861d0 - std::rt::lang_start::h8cdadcc7fbf2ca81
at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/rt.rs:65:5
29: 0x55f848486dbc - main
30: 0x7f81ca422e0a - __libc_start_main
at /builddir/glibc-2.32/csu/../csu/libc-start.c:314:16
31: 0x55f8484860da - <unknown>
at /builddir/glibc-2.32/csu/../sysdeps/x86_64/start.S:120
32: 0x0 - <unknown>
failed to run: /builddir/rustc-1.52.1-src/build/bootstrap/debug/bootstrap test -j1 --no-doc --no-fail-fast src/test/codegen src/test/codegen-units src/test/compile-fail src/test/incremental src/test/mir-opt src/test/pretty src/test/run-fail src/test/run-fail/pretty src/test/run-make src/test/run-make-fulldeps src/test/ui src/test/ui-fulldeps
```
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (22 preceding siblings ...)
2021-06-04 4:53 ` cinerea0
@ 2021-06-04 6:35 ` cinerea0
2021-06-04 6:36 ` cinerea0
` (10 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-04 6:35 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-854402591
Comment:
This may be a lot simpler than I thought. I took a look in the `src/test/` directory, and if there was a "compile-fail" set of tests they don't exist anymore. The "run-fail" and it's sub-test listed in the template don't exist anymore either. Taking out the non-existent tests results in the check process proceeding as it should. I didn't have the forethought to redirect the output to a file and the amount of output exceeded my scrollback buffer, but from what I saw only a few tests failed out of the thousands that were run. I can try to get the full output and link it to here if that would be helpful.
If you want to take a look at the descriptions of all of the available tests, check here: https://rustc-dev-guide.rust-lang.org/tests/intro.html. I don't know if any of them replace the ones that had to be taken out or if any of them even need replacing; that stuff is way over my head.
As a side note, is q66 still working on the ppc stuff for llvm12?
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (23 preceding siblings ...)
2021-06-04 6:35 ` cinerea0
@ 2021-06-04 6:36 ` cinerea0
2021-06-07 4:29 ` cinerea0
` (9 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-04 6:36 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-854402591
Comment:
This may be a lot simpler than I thought. I took a look in the `src/test/` directory, and if there was a "compile-fail" set of tests they don't exist anymore. The "run-fail" and it's sub-test listed in the template don't exist anymore either. Taking out the non-existent tests results in the check process proceeding as it should. I didn't have the forethought to redirect the output to a file and the amount of output exceeded my scrollback buffer, but from what I saw only a few tests failed out of the thousands that were run. I can try to get the full output and link it to here if that would be helpful.
If you want to take a look at the descriptions of all of the categories of available tests, check here: https://rustc-dev-guide.rust-lang.org/tests/intro.html. I don't know if any of them replace the ones that had to be taken out or if any of them even need replacing; that stuff is way over my head.
As a side note, is q66 still working on the ppc stuff for llvm12?
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (24 preceding siblings ...)
2021-06-04 6:36 ` cinerea0
@ 2021-06-07 4:29 ` cinerea0
2021-06-07 4:31 ` cinerea0
` (8 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-07 4:29 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 700 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-855566970
Comment:
```diff
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template (copy)
index 8df40053a1..d3dc5715b8 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template (copy)
@@ -304,12 +304,9 @@ do_check() {
python3 x.py test ${makejobs} --no-doc --no-fail-fast \
src/test/codegen \
src/test/codegen-units \
- src/test/compile-fail \
src/test/incremental \
src/test/mir-opt \
src/test/pretty \
- src/test/run-fail \
- src/test/run-fail/pretty \
src/test/run-make \
src/test/run-make-fulldeps \
src/test/ui \
```
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (25 preceding siblings ...)
2021-06-07 4:29 ` cinerea0
@ 2021-06-07 4:31 ` cinerea0
2021-06-07 4:37 ` cinerea0
` (7 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-07 4:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-855567371
Comment:
The above diff will bring the patches into line with what the newest version of the compiler uses for tests. The "compile-fail" and "run-fail" categories got absorbed into the "ui" category.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (26 preceding siblings ...)
2021-06-07 4:31 ` cinerea0
@ 2021-06-07 4:37 ` cinerea0
2021-06-17 20:15 ` [PR PATCH] [Updated] " ericonr
` (6 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-06-07 4:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 333 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-855567371
Comment:
The above diff will bring the template into line with what the newest version of the compiler uses for tests. The "compile-fail" and "run-fail" categories got absorbed into the "ui" category.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] rust: update to 1.52.1.
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (27 preceding siblings ...)
2021-06-07 4:37 ` cinerea0
@ 2021-06-17 20:15 ` ericonr
2021-06-17 20:17 ` [PR PATCH] [Updated] rust: update to 1.53.0 ericonr
` (5 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-06-17 20:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
rust: update to 1.52.1.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
[ci skip]
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 44363 bytes --]
From 40dff563b929192f0229e80a2216225d331e148d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 1/3] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
From 71d5dd8b50b991cf3b36cc3748cabd58c064fc3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 2/3] rust: update to 1.53.0.
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave just line linux_gnu_base
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
- fix do_check (thanks cinerea0)
---
...to-work-when-cross-compiling-on-musl.patch | 8 +-
...ative-libraries-when-linking-static-.patch | 21 +-
...dlib-and-musl_root-from-musl-targets.patch | 216 +++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++--
...mically-link-libc-on-musl-by-default.patch | 26 ---
...kage-of-musl-libc-for-the-libc-crate.patch | 12 +-
...-against-host-target-LLVM-in-cross-s.patch | 22 +-
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +--
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++-
srcpkgs/rust/template | 41 ++--
10 files changed, 224 insertions(+), 248 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..85a8806e010b 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,42 +1,82 @@
-From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Sun, 3 May 2020 17:53:33 +0200
-Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-
----
- config.toml.example | 3 ---
- src/bootstrap/cc_detect.rs | 25 ++----------------
- src/bootstrap/compile.rs | 22 +---------------
- src/bootstrap/config.rs | 7 ------
- src/bootstrap/configure.py | 28 ---------------------
- src/bootstrap/lib.rs | 10 --------
- src/bootstrap/sanity.rs | 22 ----------------
- src/librustc_target/spec/linux_musl_base.rs | 16 ------------
- 8 files changed, 3 insertions(+), 130 deletions(-)
-
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
+index 2fc9ab29f..276736159 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 {
+ ])
+ }
+
+-pub(super) fn pre_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
+- ])
+-}
+-
+-pub(super) fn post_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
+- ])
+-}
+-
+ pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ 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
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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;
+
+ base
+ }
+diff --git a/config.toml.example b/config.toml.example
+index 6e5584797..5be9882a8 100644
--- a/config.toml.example
+++ b/config.toml.example
-@@ -525,15 +525,6 @@
+@@ -638,15 +638,6 @@ changelog-seen = 2
# only use static libraries. If unset, the target's default linkage is used.
- #crt-static = false
+ #crt-static = <platform-specific> (bool)
-# The root location of the musl installation directory. The library directory
-# will also need to contain libunwind.a for an unwinding implementation. Note
-# that this option only makes sense for musl targets that produce statically
--# linked binaries
--#musl-root = "..."
+-# linked binaries.
+-#musl-root = build.musl-root (path)
-
-# The full path to the musl libdir.
-#musl-libdir = musl-root/lib
-
- # The root location of the `wasm32-wasi` sysroot.
- #wasi-root = "..."
-
+ # The root location of the `wasm32-wasi` sysroot. Only used for the
+ # `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 a236edf9..54c3cc64 100644
+index e750c2963..f6ba3032b 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
-@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) {
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
cfg.compiler(cc);
} else {
@@ -45,7 +85,7 @@ index a236edf9..54c3cc64 100644
}
let compiler = cfg.get_compiler();
-@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+@@ -126,7 +126,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
@@ -53,16 +93,16 @@ index a236edf9..54c3cc64 100644
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
true
} else {
- false
-@@ -154,7 +154,6 @@ fn set_compiler(
+ // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
+@@ -157,7 +157,6 @@ fn set_compiler(
compiler: Language,
- target: Interned<String>,
+ target: TargetSelection,
config: Option<&Target>,
- build: &Build,
) {
- match &*target {
+ match &*target.triple {
// When compiling for android we may have the NDK configured in the
-@@ -196,26 +195,6 @@ fn set_compiler(
+@@ -200,26 +199,6 @@ fn set_compiler(
}
}
@@ -90,14 +130,13 @@ index a236edf9..54c3cc64 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index 65a00db3..01fd2cf3 100644
+index ee3527b6b..0a8b78327 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
-@@ -169,26 +169,7 @@
- t!(fs::create_dir_all(&libdir_self_contained));
+@@ -179,34 +179,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
-- // Copies the CRT 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
@@ -105,7 +144,9 @@ index 65a00db3..01fd2cf3 100644
- // 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_libdir(target).unwrap();
+- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
+- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
+- });
- for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] {
- copy_and_stamp(
- builder,
@@ -116,14 +157,21 @@ index 65a00db3..01fd2cf3 100644
- DependencyType::TargetSelfContained,
- );
- }
+- let crt_path = builder.ensure(native::CrtBeginEnd { target });
+- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] {
+- let src = crt_path.join(obj);
+- let target = libdir_self_contained.join(obj);
+- builder.copy(&src, &target);
+- target_deps.push((target, DependencyType::TargetSelfContained));
+- }
- } else if target.ends_with("-wasi") {
+ if target.ends_with("-wasi") {
- let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
- copy_and_stamp(
- builder,
-@@ -263,15 +244,6 @@
+ let srcdir = builder
+ .wasi_root(target)
+ .unwrap_or_else(|| {
+@@ -288,15 +261,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
- .arg(builder.src.join("src/libtest/Cargo.toml"));
+ .arg(builder.src.join("library/test/Cargo.toml"));
- // Help the libc crate compile by assisting it in finding various
- // sysroot native libraries.
@@ -138,45 +186,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index 483816b98..7517d757c 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -165,7 +165,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -291,8 +290,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -481,7 +478,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -524,8 +520,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -846,7 +840,6 @@ impl 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;
@@ -184,7 +231,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -892,8 +885,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,12 +239,12 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
+index 999882a1c..7ccc2b73c 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
-@@ -110,34 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
+@@ -109,34 +109,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")
@@ -232,9 +279,11 @@ index 2a46c563..025928b9 100755
v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
"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
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
-@@ -876,25 +876,6 @@
+@@ -927,25 +927,6 @@ impl Build {
}
}
@@ -261,10 +310,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index ed0cbdf97..44937aed9 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +322,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,44 +342,3 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
-
-- 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/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
-+++ b/compiler/rustc_target/src/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/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
index 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..3b519eec3b96 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -8,19 +8,19 @@
# uploaded to https://alpha.de.repo.voidlinux.org/distfiles/
#
pkgname=rust
-version=1.48.0
+version=1.53.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.53.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
depends="rust-std"
short_desc="Safe, concurrent, practical systems language"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9
lib32disabled=yes
patch_args="-Np1"
@@ -38,7 +38,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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -49,15 +49,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
;;
ppc64le)
checksum+="
@@ -93,7 +93,7 @@ _bootstrap_dir="stage0-bootstrap"
# cut down the build time (the local-rebuild property is enabled for cross)
if [ "$CROSS_BUILD" ]; then
- hostmakedepends+=" rust llvm11"
+ hostmakedepends+=" rust llvm12"
# These are required for building the buildhost's stage0/1
hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
else
@@ -104,18 +104,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ 93b05456ea8500864e020cfbb1dfbe0a93651406432b6950013f87b91ea6ff47
+ d63690da8adb531bb92e76e211b37d3cf941fa841eaaaa210cce4cd6301ca64a"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ 9c2f0443a546dd18f1f020c7711a7b9864432545ceb812e79315c1e76508b193
+ 66d5257bbd194db08e67ca63a74cc80cdc4a36eaa30bf7dfe65861d9deaff7f7"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ 50de8b4bcb0819ec0ca363e0aa53fc1c55bc85f53bc82da8dce20a132da7e7d9
+ 413449866616b1cd048da1356a41d977bf4e037cce114f07c3afbb0497b3e4c6"
;;
ppc64le)
checksum+="
@@ -254,7 +254,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -303,12 +303,9 @@ do_check() {
python3 x.py test ${makejobs} --no-doc --no-fail-fast \
src/test/codegen \
src/test/codegen-units \
- src/test/compile-fail \
src/test/incremental \
src/test/mir-opt \
src/test/pretty \
- src/test/run-fail \
- src/test/run-fail/pretty \
src/test/run-make \
src/test/run-make-fulldeps \
src/test/ui \
@@ -343,6 +340,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From db42c0752c4a0d07d492e7211d30e399c4e1c19e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sat, 17 Apr 2021 02:19:49 -0300
Subject: [PATCH 3/3] cargo: update to 0.53.0.
And use rust 1.53.0 as bootstrap.
---
srcpkgs/cargo/patches/fix-serde.diff | 14 --------------
srcpkgs/cargo/template | 16 ++++++++--------
2 files changed, 8 insertions(+), 22 deletions(-)
delete mode 100644 srcpkgs/cargo/patches/fix-serde.diff
diff --git a/srcpkgs/cargo/patches/fix-serde.diff b/srcpkgs/cargo/patches/fix-serde.diff
deleted file mode 100644
index d76499f5cd9f..000000000000
--- a/srcpkgs/cargo/patches/fix-serde.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-This patch was downloaded from "https://github.com/alexcrichton/cargo/commit/f097d02ea62111493b9f06d096a94dfddd020415.diff"
-diff --git src/cargo/util/config/de.rs src/cargo/util/config/de.rs
-index 758f5c23f1..a70cd0dce8 100644
---- src/cargo/util/config/de.rs
-+++ src/cargo/util/config/de.rs
-@@ -527,7 +527,7 @@ impl<'de, 'config> de::MapAccess<'de> for ValueDeserializer<'config> {
- seed.deserialize(Tuple2Deserializer(0i32, path.to_string_lossy()))
- }
- Definition::Environment(env) => {
-- seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
-+ seed.deserialize(Tuple2Deserializer(1i32, env.as_str()))
- }
- Definition::Cli => seed.deserialize(Tuple2Deserializer(2i32, "")),
- }
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index 9c9781d1fc47..259629bba5c3 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,7 +1,7 @@
# Template file for 'cargo'
pkgname=cargo
-version=0.49.0
-revision=2
+version=0.53.0
+revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python3 curl cmake pkg-config zlib-devel"
@@ -12,7 +12,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
-checksum=59ba1ce05becb4a5e0772d334d75f9dce3d5487ca288ac986e786241bb1cbac5
+checksum=f8e292b7b1a9e30f0b201a4c0267427a06a8d814083999fb7b183b5c0f168480
replaces="cargo-tree>=0"
build_options="static bindist"
@@ -21,14 +21,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.48.0"
+_cargo_dist_version="1.53.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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -45,15 +45,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
;;
ppc64le)
checksum+="
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] rust: update to 1.53.0
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (28 preceding siblings ...)
2021-06-17 20:15 ` [PR PATCH] [Updated] " ericonr
@ 2021-06-17 20:17 ` ericonr
2021-06-17 23:15 ` ericonr
` (4 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-06-17 20:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
rust: update to 1.53.0
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 44365 bytes --]
From 40dff563b929192f0229e80a2216225d331e148d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 1/3] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
From 63a4ab926ff54532ee7082491f59aa8865c744ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 2/3] rust: update to 1.53.0.
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave
just line linux_gnu_base
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
- fix do_check (thanks cinerea0)
---
...to-work-when-cross-compiling-on-musl.patch | 8 +-
...ative-libraries-when-linking-static-.patch | 21 +-
...dlib-and-musl_root-from-musl-targets.patch | 216 +++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++--
...mically-link-libc-on-musl-by-default.patch | 26 ---
...kage-of-musl-libc-for-the-libc-crate.patch | 12 +-
...-against-host-target-LLVM-in-cross-s.patch | 22 +-
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +--
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++-
srcpkgs/rust/template | 41 ++--
10 files changed, 224 insertions(+), 248 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..85a8806e010b 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,42 +1,82 @@
-From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Sun, 3 May 2020 17:53:33 +0200
-Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-
----
- config.toml.example | 3 ---
- src/bootstrap/cc_detect.rs | 25 ++----------------
- src/bootstrap/compile.rs | 22 +---------------
- src/bootstrap/config.rs | 7 ------
- src/bootstrap/configure.py | 28 ---------------------
- src/bootstrap/lib.rs | 10 --------
- src/bootstrap/sanity.rs | 22 ----------------
- src/librustc_target/spec/linux_musl_base.rs | 16 ------------
- 8 files changed, 3 insertions(+), 130 deletions(-)
-
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
+index 2fc9ab29f..276736159 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 {
+ ])
+ }
+
+-pub(super) fn pre_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
+- ])
+-}
+-
+-pub(super) fn post_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
+- ])
+-}
+-
+ pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ 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
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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;
+
+ base
+ }
+diff --git a/config.toml.example b/config.toml.example
+index 6e5584797..5be9882a8 100644
--- a/config.toml.example
+++ b/config.toml.example
-@@ -525,15 +525,6 @@
+@@ -638,15 +638,6 @@ changelog-seen = 2
# only use static libraries. If unset, the target's default linkage is used.
- #crt-static = false
+ #crt-static = <platform-specific> (bool)
-# The root location of the musl installation directory. The library directory
-# will also need to contain libunwind.a for an unwinding implementation. Note
-# that this option only makes sense for musl targets that produce statically
--# linked binaries
--#musl-root = "..."
+-# linked binaries.
+-#musl-root = build.musl-root (path)
-
-# The full path to the musl libdir.
-#musl-libdir = musl-root/lib
-
- # The root location of the `wasm32-wasi` sysroot.
- #wasi-root = "..."
-
+ # The root location of the `wasm32-wasi` sysroot. Only used for the
+ # `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 a236edf9..54c3cc64 100644
+index e750c2963..f6ba3032b 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
-@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) {
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
cfg.compiler(cc);
} else {
@@ -45,7 +85,7 @@ index a236edf9..54c3cc64 100644
}
let compiler = cfg.get_compiler();
-@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+@@ -126,7 +126,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
@@ -53,16 +93,16 @@ index a236edf9..54c3cc64 100644
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
true
} else {
- false
-@@ -154,7 +154,6 @@ fn set_compiler(
+ // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
+@@ -157,7 +157,6 @@ fn set_compiler(
compiler: Language,
- target: Interned<String>,
+ target: TargetSelection,
config: Option<&Target>,
- build: &Build,
) {
- match &*target {
+ match &*target.triple {
// When compiling for android we may have the NDK configured in the
-@@ -196,26 +195,6 @@ fn set_compiler(
+@@ -200,26 +199,6 @@ fn set_compiler(
}
}
@@ -90,14 +130,13 @@ index a236edf9..54c3cc64 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index 65a00db3..01fd2cf3 100644
+index ee3527b6b..0a8b78327 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
-@@ -169,26 +169,7 @@
- t!(fs::create_dir_all(&libdir_self_contained));
+@@ -179,34 +179,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
-- // Copies the CRT 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
@@ -105,7 +144,9 @@ index 65a00db3..01fd2cf3 100644
- // 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_libdir(target).unwrap();
+- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
+- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
+- });
- for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] {
- copy_and_stamp(
- builder,
@@ -116,14 +157,21 @@ index 65a00db3..01fd2cf3 100644
- DependencyType::TargetSelfContained,
- );
- }
+- let crt_path = builder.ensure(native::CrtBeginEnd { target });
+- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] {
+- let src = crt_path.join(obj);
+- let target = libdir_self_contained.join(obj);
+- builder.copy(&src, &target);
+- target_deps.push((target, DependencyType::TargetSelfContained));
+- }
- } else if target.ends_with("-wasi") {
+ if target.ends_with("-wasi") {
- let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
- copy_and_stamp(
- builder,
-@@ -263,15 +244,6 @@
+ let srcdir = builder
+ .wasi_root(target)
+ .unwrap_or_else(|| {
+@@ -288,15 +261,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
- .arg(builder.src.join("src/libtest/Cargo.toml"));
+ .arg(builder.src.join("library/test/Cargo.toml"));
- // Help the libc crate compile by assisting it in finding various
- // sysroot native libraries.
@@ -138,45 +186,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index 483816b98..7517d757c 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -165,7 +165,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -291,8 +290,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -481,7 +478,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -524,8 +520,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -846,7 +840,6 @@ impl 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;
@@ -184,7 +231,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -892,8 +885,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,12 +239,12 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
+index 999882a1c..7ccc2b73c 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
-@@ -110,34 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
+@@ -109,34 +109,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")
@@ -232,9 +279,11 @@ index 2a46c563..025928b9 100755
v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
"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
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
-@@ -876,25 +876,6 @@
+@@ -927,25 +927,6 @@ impl Build {
}
}
@@ -261,10 +310,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index ed0cbdf97..44937aed9 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +322,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,44 +342,3 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
-
-- 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/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
-+++ b/compiler/rustc_target/src/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/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
index 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 6bb928e14783..3b519eec3b96 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -8,19 +8,19 @@
# uploaded to https://alpha.de.repo.voidlinux.org/distfiles/
#
pkgname=rust
-version=1.48.0
+version=1.53.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.53.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
depends="rust-std"
short_desc="Safe, concurrent, practical systems language"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9
lib32disabled=yes
patch_args="-Np1"
@@ -38,7 +38,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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -49,15 +49,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
;;
ppc64le)
checksum+="
@@ -93,7 +93,7 @@ _bootstrap_dir="stage0-bootstrap"
# cut down the build time (the local-rebuild property is enabled for cross)
if [ "$CROSS_BUILD" ]; then
- hostmakedepends+=" rust llvm11"
+ hostmakedepends+=" rust llvm12"
# These are required for building the buildhost's stage0/1
hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
else
@@ -104,18 +104,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ 93b05456ea8500864e020cfbb1dfbe0a93651406432b6950013f87b91ea6ff47
+ d63690da8adb531bb92e76e211b37d3cf941fa841eaaaa210cce4cd6301ca64a"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ 9c2f0443a546dd18f1f020c7711a7b9864432545ceb812e79315c1e76508b193
+ 66d5257bbd194db08e67ca63a74cc80cdc4a36eaa30bf7dfe65861d9deaff7f7"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ 50de8b4bcb0819ec0ca363e0aa53fc1c55bc85f53bc82da8dce20a132da7e7d9
+ 413449866616b1cd048da1356a41d977bf4e037cce114f07c3afbb0497b3e4c6"
;;
ppc64le)
checksum+="
@@ -254,7 +254,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -303,12 +303,9 @@ do_check() {
python3 x.py test ${makejobs} --no-doc --no-fail-fast \
src/test/codegen \
src/test/codegen-units \
- src/test/compile-fail \
src/test/incremental \
src/test/mir-opt \
src/test/pretty \
- src/test/run-fail \
- src/test/run-fail/pretty \
src/test/run-make \
src/test/run-make-fulldeps \
src/test/ui \
@@ -343,6 +340,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From 3b73d052d0db2f404e696cf9126f6f7c6bff6313 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sat, 17 Apr 2021 02:19:49 -0300
Subject: [PATCH 3/3] cargo: update to 0.53.0.
And use rust 1.53.0 as bootstrap.
---
srcpkgs/cargo/patches/fix-serde.diff | 14 --------------
srcpkgs/cargo/template | 16 ++++++++--------
2 files changed, 8 insertions(+), 22 deletions(-)
delete mode 100644 srcpkgs/cargo/patches/fix-serde.diff
diff --git a/srcpkgs/cargo/patches/fix-serde.diff b/srcpkgs/cargo/patches/fix-serde.diff
deleted file mode 100644
index d76499f5cd9f..000000000000
--- a/srcpkgs/cargo/patches/fix-serde.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-This patch was downloaded from "https://github.com/alexcrichton/cargo/commit/f097d02ea62111493b9f06d096a94dfddd020415.diff"
-diff --git src/cargo/util/config/de.rs src/cargo/util/config/de.rs
-index 758f5c23f1..a70cd0dce8 100644
---- src/cargo/util/config/de.rs
-+++ src/cargo/util/config/de.rs
-@@ -527,7 +527,7 @@ impl<'de, 'config> de::MapAccess<'de> for ValueDeserializer<'config> {
- seed.deserialize(Tuple2Deserializer(0i32, path.to_string_lossy()))
- }
- Definition::Environment(env) => {
-- seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
-+ seed.deserialize(Tuple2Deserializer(1i32, env.as_str()))
- }
- Definition::Cli => seed.deserialize(Tuple2Deserializer(2i32, "")),
- }
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index 9c9781d1fc47..259629bba5c3 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,7 +1,7 @@
# Template file for 'cargo'
pkgname=cargo
-version=0.49.0
-revision=2
+version=0.53.0
+revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python3 curl cmake pkg-config zlib-devel"
@@ -12,7 +12,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
-checksum=59ba1ce05becb4a5e0772d334d75f9dce3d5487ca288ac986e786241bb1cbac5
+checksum=f8e292b7b1a9e30f0b201a4c0267427a06a8d814083999fb7b183b5c0f168480
replaces="cargo-tree>=0"
build_options="static bindist"
@@ -21,14 +21,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.48.0"
+_cargo_dist_version="1.53.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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -45,15 +45,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
;;
ppc64le)
checksum+="
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.53.0
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (29 preceding siblings ...)
2021-06-17 20:17 ` [PR PATCH] [Updated] rust: update to 1.53.0 ericonr
@ 2021-06-17 23:15 ` ericonr
2021-06-26 22:08 ` [PR PATCH] [Updated] " ericonr
` (3 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-06-17 23:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-863620110
Comment:
I built Firefox successfully with 1.53.0. Good to merge on the `x86_64-musl` side, mainly waiting for @q66 to produce tarballs.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Updated] rust: update to 1.53.0
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (30 preceding siblings ...)
2021-06-17 23:15 ` ericonr
@ 2021-06-26 22:08 ` ericonr
2021-07-01 17:32 ` cinerea0
` (2 subsequent siblings)
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-06-26 22:08 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]
There is an updated pull request by ericonr against master on the void-packages repository
https://github.com/ericonr/void-packages rust
https://github.com/void-linux/void-packages/pull/30259
rust: update to 1.53.0
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
A patch file from https://github.com/void-linux/void-packages/pull/30259.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rust-30259.patch --]
[-- Type: text/x-diff, Size: 44375 bytes --]
From 41fd4b8fef6b421cd594d07b8055085b0b106f44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 09:59:51 -0300
Subject: [PATCH 1/3] common/hooks/post-install: show error in $STRIPCMD in
06-strip-and-debug.
Currently fails with a hard to understand error message:
2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
---
common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 52591c38b311..2cec68412c50 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -86,16 +86,14 @@ hook() {
chmod +w "$f"
if [[ $(file $f) =~ "statically linked" ]]; then
# static binary
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
echo " Stripped static executable: ${f#$PKGDESTDIR}"
else
make_debug "$f"
- $STRIPCMD "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -125,8 +123,7 @@ hook() {
chmod +w "$f"
# shared library
make_debug "$f"
- $STRIPCMD --strip-unneeded "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-unneeded "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
@@ -139,8 +136,7 @@ hook() {
;;
application/x-archive*)
chmod +w "$f"
- $STRIPCMD --strip-debug "$f"
- if [ $? -ne 0 ]; then
+ if ! $STRIPCMD --strip-debug "$f"; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
From e6b27229257343b8dd2cdda60d7149d0cb85fb64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 2/3] rust: update to 1.53.0.
- rebase patches
- fix type of 'llvm-unwind' in config.toml
- move linux_musl_base stuff to a single patch which makes it behave
just line linux_gnu_base
- copy new version of need-ssp_nonshared.patch from alpine
- temporary workaround for the new rust-llvm-dwp binary: it's copied
from the llvm toolchain and shoved into /usr/lib, but they copied the
binary from the build machine
- fix do_check (thanks cinerea0)
---
...to-work-when-cross-compiling-on-musl.patch | 8 +-
...ative-libraries-when-linking-static-.patch | 21 +-
...dlib-and-musl_root-from-musl-targets.patch | 216 +++++++++---------
...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +++--
...mically-link-libc-on-musl-by-default.patch | 26 ---
...kage-of-musl-libc-for-the-libc-crate.patch | 12 +-
...-against-host-target-LLVM-in-cross-s.patch | 22 +-
...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +--
srcpkgs/rust/patches/need-ssp_nonshared.patch | 36 ++-
srcpkgs/rust/template | 41 ++--
10 files changed, 224 insertions(+), 248 deletions(-)
delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
index 7687c35ce87f..f72bd0e68a0d 100644
--- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
+++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
@@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
-index 04345867..8156d5ec 100644
+index cba17c8e6..45cbdd81b 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
-@@ -22,9 +22,6 @@ fn main() {
+@@ -20,9 +20,6 @@ fn main() {
Err(_) => 0,
};
- let mut dylib_path = bootstrap::util::dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
- //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
- //arguments here
let mut cmd = Command::new(rustdoc);
+ cmd.args(&args)
+ .arg("--sysroot")
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
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 1f345ca14625..0fd1ca7d2dfa 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
@@ -15,21 +15,20 @@ Fixes #54243
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
-diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
-index 0dd2f029..f22b4277 100644
+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
-@@ -1964,9 +1964,7 @@
+@@ -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.
+-/// 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;
}
@@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644
+ // 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.target.options.crt_static_allows_dylibs
++ && !sess.target.options.crt_static_allows_dylibs
+ {
+ cmd.link_staticlib(name)
+ } else {
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 326ed1a4ed1d..85a8806e010b 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,42 +1,82 @@
-From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Sun, 3 May 2020 17:53:33 +0200
-Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
-
----
- config.toml.example | 3 ---
- src/bootstrap/cc_detect.rs | 25 ++----------------
- src/bootstrap/compile.rs | 22 +---------------
- src/bootstrap/config.rs | 7 ------
- src/bootstrap/configure.py | 28 ---------------------
- src/bootstrap/lib.rs | 10 --------
- src/bootstrap/sanity.rs | 22 ----------------
- src/librustc_target/spec/linux_musl_base.rs | 16 ------------
- 8 files changed, 3 insertions(+), 130 deletions(-)
-
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
+index 2fc9ab29f..276736159 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 {
+ ])
+ }
+
+-pub(super) fn pre_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
+- ])
+-}
+-
+-pub(super) fn post_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
+- ])
+-}
+-
+ pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ 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
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -1,16 +1,9 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".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;
+
+ base
+ }
+diff --git a/config.toml.example b/config.toml.example
+index 6e5584797..5be9882a8 100644
--- a/config.toml.example
+++ b/config.toml.example
-@@ -525,15 +525,6 @@
+@@ -638,15 +638,6 @@ changelog-seen = 2
# only use static libraries. If unset, the target's default linkage is used.
- #crt-static = false
+ #crt-static = <platform-specific> (bool)
-# The root location of the musl installation directory. The library directory
-# will also need to contain libunwind.a for an unwinding implementation. Note
-# that this option only makes sense for musl targets that produce statically
--# linked binaries
--#musl-root = "..."
+-# linked binaries.
+-#musl-root = build.musl-root (path)
-
-# The full path to the musl libdir.
-#musl-libdir = musl-root/lib
-
- # The root location of the `wasm32-wasi` sysroot.
- #wasi-root = "..."
-
+ # The root location of the `wasm32-wasi` sysroot. Only used for the
+ # `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 a236edf9..54c3cc64 100644
+index e750c2963..f6ba3032b 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
-@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) {
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
cfg.compiler(cc);
} else {
@@ -45,7 +85,7 @@ index a236edf9..54c3cc64 100644
}
let compiler = cfg.get_compiler();
-@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+@@ -126,7 +126,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
@@ -53,16 +93,16 @@ index a236edf9..54c3cc64 100644
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
true
} else {
- false
-@@ -154,7 +154,6 @@ fn set_compiler(
+ // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
+@@ -157,7 +157,6 @@ fn set_compiler(
compiler: Language,
- target: Interned<String>,
+ target: TargetSelection,
config: Option<&Target>,
- build: &Build,
) {
- match &*target {
+ match &*target.triple {
// When compiling for android we may have the NDK configured in the
-@@ -196,26 +195,6 @@ fn set_compiler(
+@@ -200,26 +199,6 @@ fn set_compiler(
}
}
@@ -90,14 +130,13 @@ index a236edf9..54c3cc64 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
-index 65a00db3..01fd2cf3 100644
+index ee3527b6b..0a8b78327 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
-@@ -169,26 +169,7 @@
- t!(fs::create_dir_all(&libdir_self_contained));
+@@ -179,34 +179,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
-- // Copies the CRT 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
@@ -105,7 +144,9 @@ index 65a00db3..01fd2cf3 100644
- // 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_libdir(target).unwrap();
+- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
+- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
+- });
- for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] {
- copy_and_stamp(
- builder,
@@ -116,14 +157,21 @@ index 65a00db3..01fd2cf3 100644
- DependencyType::TargetSelfContained,
- );
- }
+- let crt_path = builder.ensure(native::CrtBeginEnd { target });
+- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] {
+- let src = crt_path.join(obj);
+- let target = libdir_self_contained.join(obj);
+- builder.copy(&src, &target);
+- target_deps.push((target, DependencyType::TargetSelfContained));
+- }
- } else if target.ends_with("-wasi") {
+ if target.ends_with("-wasi") {
- let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
- copy_and_stamp(
- builder,
-@@ -263,15 +244,6 @@
+ let srcdir = builder
+ .wasi_root(target)
+ .unwrap_or_else(|| {
+@@ -288,15 +261,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
- .arg(builder.src.join("src/libtest/Cargo.toml"));
+ .arg(builder.src.join("library/test/Cargo.toml"));
- // Help the libc crate compile by assisting it in finding various
- // sysroot native libraries.
@@ -138,45 +186,44 @@ index 65a00db3..01fd2cf3 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 56164b74..8c46334a 100644
+index 483816b98..7517d757c 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
-@@ -154,8 +154,6 @@
- pub print_step_timings: bool,
+@@ -165,7 +165,6 @@ pub struct Config {
pub missing_tools: bool,
-
-- // Fallback musl-root for all targets
+
+ // Fallback musl-root for all targets
- pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
-@@ -252,8 +250,6 @@
- pub linker: Option<PathBuf>,
- pub ndk: Option<PathBuf>,
+@@ -291,8 +290,6 @@ pub struct Target {
+ pub sanitizers: Option<bool>,
+ pub profiler: Option<bool>,
pub crt_static: Option<bool>,
- pub musl_root: Option<PathBuf>,
- pub musl_libdir: Option<PathBuf>,
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
-@@ -438,7 +434,6 @@
- parallel_compiler: Option<bool>,
+@@ -481,7 +478,6 @@ struct Rust {
default_linker: Option<String>,
channel: Option<String>,
+ description: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
-@@ -475,8 +470,6 @@
- llvm_filecheck: Option<String>,
- android_ndk: Option<String>,
+@@ -524,8 +520,6 @@ struct TomlTarget {
+ sanitizers: Option<bool>,
+ profiler: Option<bool>,
crt_static: Option<bool>,
- musl_root: Option<String>,
- musl_libdir: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
-@@ -806,7 +799,6 @@
+@@ -846,7 +840,6 @@ impl 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;
@@ -184,7 +231,7 @@ index 56164b74..8c46334a 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);
-@@ -846,8 +838,6 @@
+@@ -892,8 +885,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@@ -192,12 +239,12 @@ index 56164b74..8c46334a 100644
- target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
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 2a46c563..025928b9 100755
+index 999882a1c..7ccc2b73c 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
-@@ -110,34 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
+@@ -109,34 +109,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")
@@ -232,9 +279,11 @@ index 2a46c563..025928b9 100755
v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
"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
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
-@@ -876,25 +876,6 @@
+@@ -927,25 +927,6 @@ impl Build {
}
}
@@ -261,10 +310,10 @@ index 2a46c563..025928b9 100755
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/sanity.rs b/src/bootstrap/sanity.rs
-index 530e74da..8ec9f046 100644
+index ed0cbdf97..44937aed9 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
-@@ -191,28 +191,6 @@
+@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) {
}
}
@@ -273,7 +322,7 @@ index 530e74da..8ec9f046 100644
- // 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_default();
+- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_libdir(*target) {
@@ -293,44 +342,3 @@ index 530e74da..8ec9f046 100644
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
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index e294e639..58ae91a9 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -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());
-
-- 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/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200
-+++ b/compiler/rustc_target/src/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/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch
index 6571cb3c2229..58ffd0776912 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
@@ -1,18 +1,31 @@
-From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sun, 3 May 2020 17:55:50 +0200
-Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl
+Additions for build.rs by q66, necessary for our musl setup.
+
+From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sat, 9 Sep 2017 00:14:16 -0500
+Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
- src/libunwind/build.rs | 16 ++--------------
- src/libunwind/lib.rs | 2 +-
- 2 files changed, 3 insertions(+), 15 deletions(-)
+ src/libunwind/lib.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+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 a24808b3..a1250889 100644
+index f24d957..28828e5 100644
--- a/library/unwind/build.rs
+++ b/library/unwind/build.rs
-@@ -5,17 +5,14 @@
+@@ -5,17 +5,12 @@
let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "llvm-libunwind")
@@ -23,16 +36,15 @@ index a24808b3..a1250889 100644
llvm_libunwind::compile();
} else if target.contains("x86_64-fortanix-unknown-sgx") {
llvm_libunwind::compile();
- } else if target.contains("linux") {
+- } else if target.contains("linux") {
+- // linking for Linux is handled in lib.rs
- if target.contains("musl") {
-- // linking for musl is handled in lib.rs
- llvm_libunwind::compile();
-- } else if !target.contains("android") {
-+ if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
- }
+- }
} else if target.contains("freebsd") {
-@@ -145,15 +142,6 @@
+ println!("cargo:rustc-link-lib=gcc_s");
+ } else if target.contains("rumprun") {
+@@ -143,15 +138,6 @@
cfg.file(root.join("src").join(src));
}
@@ -48,19 +60,4 @@ index a24808b3..a1250889 100644
cfg.compile("unwind");
}
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 18d41be7..17f73d69 100644
---- a/library/unwind/src/lib.rs
-+++ b/library/unwind/src/lib.rs
-@@ -19,7 +19,7 @@ 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 "C" {}
-
---
-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
deleted file mode 100644
index 7f6ca13a95d3..000000000000
--- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001
-From: q66 <daniel@octaforge.org>
-Date: Sat, 21 Dec 2019 17:04:13 +0100
-Subject: [PATCH 11/15] Dynamically link libc on musl by default
-
----
- src/librustc_target/spec/linux_musl_base.rs | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
-index 58ae91a9..1fae72d6 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
-@@ -1,11 +1,9 @@
--use crate::spec::crt_objects::{self, CrtObjectsFallback};
- use crate::spec::TargetOptions;
-
- pub fn opts() -> TargetOptions {
- let mut base = super::linux_base::opts();
-
-- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
- // These targets allow the user to choose between static and dynamic linking.
- base.crt_static_respected = true;
-
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 e4d4f145b6b7..3378ee361742 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
@@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
-index 0b1496af..7f7e85a7 100644
+index 6bb71c552..22060a8d7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
-@@ -33,6 +33,7 @@
+@@ -24,10 +24,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
- #![no_std]
+ #![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(target_os = "redox", 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/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
index b4835eb3f4f8..692eb71142e7 100644
--- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
+++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch
@@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
-index 9b4f03b3..d0167838 100644
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -217,9 +217,11 @@ fn main() {
+@@ -242,9 +242,11 @@ fn main() {
for lib in output(&mut cmd).split_whitespace() {
if is_crossed {
- if lib.starts_with("-LIBPATH:") {
-- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]);
- } else if lib.starts_with("-L") {
-- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
+ } else if let Some(stripped) = lib.strip_prefix("-L") {
+- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
-+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
++ env::var("XBPS_CROSS_BASE").unwrap(), stripped);
}
- } else if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
+ } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", stripped);
--
2.26.2
diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
index a064d178cef7..3f3bd3212bb9 100644
--- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
+++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch
@@ -12,15 +12,15 @@ so at least match the environment we have.
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 13 deletions(-)
-diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs
-index 93c4e97d..96b02486 100644
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 8c2a9d09a..2dcbf2c09 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
@@ -119,14 +119,7 @@ where
- Ty: TyLayoutMethods<'a, C> + Copy,
- C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
+ Ty: TyAndLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
-- let abi = if cx.target_spec().target_env == "musl" {
+- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else {
- match cx.data_layout().endian {
@@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644
if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
-diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
-index 5306d905..c63eed85 100644
+diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+index 751022c12..c4d55a62e 100644
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
-+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+@@ -1,5 +1,5 @@
+ use crate::abi::Endian;
+-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
++use crate::spec::{LinkerFlavor, Target, TargetOptions};
- pub fn target() -> TargetResult {
- let mut base = super::linux_base::opts();
-@@ -6,10 +6,6 @@ pub fn target() -> TargetResult {
+ pub fn target() -> Target {
+ let mut base = super::linux_gnu_base::opts();
+@@ -7,10 +7,6 @@ pub fn target() -> Target {
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
@@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644
- // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
- base.relro_level = RelroLevel::Partial;
-
- Ok(Target {
+ Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
- target_endian: "big".to_string(),
+ pointer_width: 64,
--
2.26.2
diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch
index 44c6dc2f26f2..f1adf20421ee 100644
--- a/srcpkgs/rust/patches/need-ssp_nonshared.patch
+++ b/srcpkgs/rust/patches/need-ssp_nonshared.patch
@@ -1,23 +1,13 @@
---- rustc-1.47.0-src/library/std/build.rs.orig
-+++ rustc-1.47.0-src/library/std/build.rs
-@@ -8,6 +8,8 @@
- println!("cargo:rustc-link-lib=dl");
- println!("cargo:rustc-link-lib=log");
- println!("cargo:rustc-link-lib=gcc");
-+ } else if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=execinfo");
---- rustc-1.44.0-src/library/unwind/build.rs.orig
-+++ rustc-1.44.0-src/library/unwind/build.rs
-@@ -12,6 +12,9 @@ fn main() {
- } else if target.contains("linux") {
- if !target.contains("android") {
- println!("cargo:rustc-link-lib=gcc_s");
-+ if target.contains("musl") {
-+ println!("cargo:rustc-link-lib=ssp_nonshared");
-+ }
- }
- } else if target.contains("freebsd") {
- println!("cargo:rustc-link-lib=gcc_s");
+--- a/library/std/src/sys/unix/mod.rs.orig 2021-02-11 18:34:14.479832268 +0100
++++ b/library/std/src/sys/unix/mod.rs 2021-02-11 18:38:28.078987749 +0100
+@@ -243,6 +243,9 @@
+ #[link(name = "log")]
+ #[link(name = "gcc")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+
diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 92ed8935ab09..24d8d1cb7163 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -8,19 +8,19 @@
# uploaded to https://alpha.de.repo.voidlinux.org/distfiles/
#
pkgname=rust
-version=1.48.0
+version=1.53.0
revision=1
-_rust_dist_version=1.48.0
+_rust_dist_version=1.53.0
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
depends="rust-std"
short_desc="Safe, concurrent, practical systems language"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
-checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b"
+checksum=5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9
lib32disabled=yes
build_options="bindist"
@@ -37,7 +37,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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -48,15 +48,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
;;
ppc64le)
checksum+="
@@ -92,7 +92,7 @@ _bootstrap_dir="stage0-bootstrap"
# cut down the build time (the local-rebuild property is enabled for cross)
if [ "$CROSS_BUILD" ]; then
- hostmakedepends+=" rust llvm11"
+ hostmakedepends+=" rust llvm12"
# These are required for building the buildhost's stage0/1
hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
else
@@ -103,18 +103,18 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
- c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28
- d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf"
+ 93b05456ea8500864e020cfbb1dfbe0a93651406432b6950013f87b91ea6ff47
+ d63690da8adb531bb92e76e211b37d3cf941fa841eaaaa210cce4cd6301ca64a"
;;
x86_64)
checksum+="
- fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483
- 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+ 9c2f0443a546dd18f1f020c7711a7b9864432545ceb812e79315c1e76508b193
+ 66d5257bbd194db08e67ca63a74cc80cdc4a36eaa30bf7dfe65861d9deaff7f7"
;;
x86_64-musl)
checksum+="
- 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3
- 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0"
+ 50de8b4bcb0819ec0ca363e0aa53fc1c55bc85f53bc82da8dce20a132da7e7d9
+ 413449866616b1cd048da1356a41d977bf4e037cce114f07c3afbb0497b3e4c6"
;;
ppc64le)
checksum+="
@@ -253,7 +253,7 @@ do_configure() {
verbose-tests = true
dist-src = false
jemalloc = false
- llvm-libunwind = false
+ llvm-libunwind = "no"
codegen-tests = false
[dist]
src-tarball = false
@@ -302,12 +302,9 @@ do_check() {
python3 x.py test ${makejobs} --no-doc --no-fail-fast \
src/test/codegen \
src/test/codegen-units \
- src/test/compile-fail \
src/test/incremental \
src/test/mir-opt \
src/test/pretty \
- src/test/run-fail \
- src/test/run-fail/pretty \
src/test/run-make \
src/test/run-make-fulldeps \
src/test/ui \
@@ -342,6 +339,12 @@ do_install() {
# symlinks instead of copies
mv *.so rustlib/${RUST_TARGET}/lib
ln -sf rustlib/${RUST_TARGET}/lib/*.so .
+
+ # executable used for split dwarf, currently unstable on linux.
+ # it's copied directly from the local llvm package, but
+ # FIXME: cross builds are installing the version from the build machine,
+ # it shouldn't be necessary to remove it
+ rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp
}
rust-doc_package() {
From a5188a1ae0c335774835c4afd30cb5ba2034e103 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sat, 17 Apr 2021 02:19:49 -0300
Subject: [PATCH 3/3] cargo: update to 0.53.0.
And use rust 1.53.0 as bootstrap.
---
srcpkgs/cargo/patches/fix-serde.diff | 14 --------------
srcpkgs/cargo/template | 16 ++++++++--------
2 files changed, 8 insertions(+), 22 deletions(-)
delete mode 100644 srcpkgs/cargo/patches/fix-serde.diff
diff --git a/srcpkgs/cargo/patches/fix-serde.diff b/srcpkgs/cargo/patches/fix-serde.diff
deleted file mode 100644
index 8fc2cffee09a..000000000000
--- a/srcpkgs/cargo/patches/fix-serde.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-This patch was downloaded from "https://github.com/alexcrichton/cargo/commit/f097d02ea62111493b9f06d096a94dfddd020415.diff"
-diff --git src/cargo/util/config/de.rs src/cargo/util/config/de.rs
-index 758f5c23f1..a70cd0dce8 100644
---- a/src/cargo/util/config/de.rs
-+++ b/src/cargo/util/config/de.rs
-@@ -527,7 +527,7 @@ impl<'de, 'config> de::MapAccess<'de> for ValueDeserializer<'config> {
- seed.deserialize(Tuple2Deserializer(0i32, path.to_string_lossy()))
- }
- Definition::Environment(env) => {
-- seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
-+ seed.deserialize(Tuple2Deserializer(1i32, env.as_str()))
- }
- Definition::Cli => seed.deserialize(Tuple2Deserializer(2i32, "")),
- }
diff --git a/srcpkgs/cargo/template b/srcpkgs/cargo/template
index 9c9781d1fc47..259629bba5c3 100644
--- a/srcpkgs/cargo/template
+++ b/srcpkgs/cargo/template
@@ -1,7 +1,7 @@
# Template file for 'cargo'
pkgname=cargo
-version=0.49.0
-revision=2
+version=0.53.0
+revision=1
wrksrc="cargo-${version}"
build_helper=rust
hostmakedepends="rust python3 curl cmake pkg-config zlib-devel"
@@ -12,7 +12,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
-checksum=59ba1ce05becb4a5e0772d334d75f9dce3d5487ca288ac986e786241bb1cbac5
+checksum=f8e292b7b1a9e30f0b201a4c0267427a06a8d814083999fb7b183b5c0f168480
replaces="cargo-tree>=0"
build_options="static bindist"
@@ -21,14 +21,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.48.0"
+_cargo_dist_version="1.53.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.49.0"
+ _cargo_dist_version="0.53.0"
;;
esac
@@ -45,15 +45,15 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz
case "$XBPS_MACHINE" in
i686)
checksum+="
- 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb"
+ deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
;;
x86_64)
checksum+="
- b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
+ e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
;;
x86_64-musl)
checksum+="
- 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+ ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
;;
ppc64le)
checksum+="
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.53.0
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (31 preceding siblings ...)
2021-06-26 22:08 ` [PR PATCH] [Updated] " ericonr
@ 2021-07-01 17:32 ` cinerea0
2021-07-04 20:42 ` ericonr
2021-07-04 20:42 ` [PR PATCH] [Closed]: " ericonr
34 siblings, 0 replies; 36+ messages in thread
From: cinerea0 @ 2021-07-01 17:32 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 174 bytes --]
New comment by cinerea0 on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-872427776
Comment:
@q66 Any update on the tarballs?
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: rust: update to 1.53.0
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (32 preceding siblings ...)
2021-07-01 17:32 ` cinerea0
@ 2021-07-04 20:42 ` ericonr
2021-07-04 20:42 ` [PR PATCH] [Closed]: " ericonr
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-07-04 20:42 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30259#issuecomment-873658791
Comment:
Merged manually.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: [PR PATCH] [Closed]: rust: update to 1.53.0
2021-04-16 6:36 [PR PATCH] [wip] rust: update to 1.51.0 ericonr
` (33 preceding siblings ...)
2021-07-04 20:42 ` ericonr
@ 2021-07-04 20:42 ` ericonr
34 siblings, 0 replies; 36+ messages in thread
From: ericonr @ 2021-07-04 20:42 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]
There's a closed pull request on the void-packages repository
rust: update to 1.53.0
https://github.com/void-linux/void-packages/pull/30259
Description:
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
@jnbr @q66
^ permalink raw reply [flat|nested] 36+ messages in thread