Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [wip] rust: update to 1.51.0.
@ 2021-04-16  6:36 ericonr
  2021-04-16  6:56 ` [PR PATCH] [Updated] " ericonr
                   ` (34 more replies)
  0 siblings, 35 replies; 36+ messages in thread
From: ericonr @ 2021-04-16  6:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

There is a new 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: 27285 bytes --]

From 7ccb0ba609c8577cd0b147d9c9de658965f5bc4b 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                         | 14 ++---
 11 files changed, 143 insertions(+), 159 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..876d1a5a874f 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"
 
@@ -57,7 +57,7 @@ case "$XBPS_MACHINE" in
 		;;
 	x86_64-musl)
 		checksum+="
-		 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90"
+		 16ce1d5b31d52bd54975d4d22ce76bd9085cc1d1f595791944d120a0294cb9d9"
 		;;
 	ppc64le)
 		checksum+="
@@ -114,8 +114,8 @@ else
 			;;
 		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

end of thread, other threads:[~2021-07-04 20:42 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-04-17  5:20 ` ericonr
2021-04-17 23:51 ` ericonr
2021-04-18  0:03 ` ericonr
2021-05-06 17:47 ` cinerea0
2021-05-06 18:31 ` ericonr
2021-05-10 22:44 ` cinerea0
2021-05-10 22:57 ` ericonr
2021-05-12 14:20 ` [PR PATCH] [Updated] " ericonr
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
2021-05-22  4:47 ` rustysec
2021-05-22  6:05 ` ericonr
2021-05-23 13:26 ` paper42
2021-05-25 14:53 ` ericonr
2021-05-27 10:35 ` paper42
2021-06-03 16:18 ` cinerea0
2021-06-03 20:14 ` paper42
2021-06-04  4:53 ` cinerea0
2021-06-04  6:35 ` cinerea0
2021-06-04  6:36 ` cinerea0
2021-06-07  4:29 ` cinerea0
2021-06-07  4:31 ` cinerea0
2021-06-07  4:37 ` cinerea0
2021-06-17 20:15 ` [PR PATCH] [Updated] " ericonr
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
2021-07-01 17:32 ` cinerea0
2021-07-04 20:42 ` ericonr
2021-07-04 20:42 ` [PR PATCH] [Closed]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).