Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (84868cfe8da033d4d5057ff92f1de51d9a210095)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (84868cfe8da033d4d5057ff92f1de51d9a210095)
  • Date: Wed, 21 Sep 2022 10:05:22 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

devel/rust/BUILD
| 2
devel/rust/DEPENDS
| 4
devel/rust/HISTORY
| 8
devel/rust/PRE_BUILD
| 3

devel/rust/patches/0003-Remove-nostdlib-and-musl_root-from-musl-targets.patch
| 379 ++++++++++
devel/rust/patches/0006-Link-with-ssp_nonshared.patch
| 30

devel/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
| 33
7 files changed, 458 insertions(+), 1 deletion(-)

New commits:
commit 84868cfe8da033d4d5057ff92f1de51d9a210095
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

rust: Fix build against musl

- Reintroduce musl patches removed by 1.54.0 update.
- Add dependency on libexecinfo for musl hosts

Patches added:
* 0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch

Patches updated:
* 0003-Remove-nostdlib-and-musl_root-from-musl-targets.patch
* 0006-Link-with-ssp_nonshared.patch

Patches dropped:
* 0004-Prefer-libgcc_eh-over-libunwind-on-musl.patch
* 0009-Dynamically-link-libc-on-musl-by-default.patch

Ref: b05ffb2c70c8 ("devel/rust: version 1.54.0")

commit afa28793693deab213d63d420921c611adb5d3aa
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

rust: Fix crt-static setting

commit 438d87e7e4e786384e380a8b37a5c8fa2e040444
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

rust: Remove dependency on bash

diff --git a/devel/rust/BUILD b/devel/rust/BUILD
index 73a0df9..289968f 100755
--- a/devel/rust/BUILD
+++ b/devel/rust/BUILD
@@ -41,7 +41,7 @@ message "${MESSAGE_COLOR}OPTS=$OPTS${DEFAULT_COLOR}" &&
$OPTS &&

# static doesn't work
-sed -i '/^#crt-static *= *false/s/#//' config.toml &&
+sed -i '/^#crt-static/acrt-static = false' config.toml &&

sed -i "/BOOTSTRAP.*doc/d" Makefile &&

diff --git a/devel/rust/DEPENDS b/devel/rust/DEPENDS
index 0eed5aa..f7a025d 100755
--- a/devel/rust/DEPENDS
+++ b/devel/rust/DEPENDS
@@ -1,3 +1,7 @@
+case "$HOST" in
+ (*-musl)
+ depends libexecinfo ;;
+esac
. "$GRIMOIRE"/VDEPENDS &&
vdepends <<EOF &&
llvm >= 11.0
diff --git a/devel/rust/HISTORY b/devel/rust/HISTORY
index b284145..b5f74cd 100644
--- a/devel/rust/HISTORY
+++ b/devel/rust/HISTORY
@@ -1,3 +1,11 @@
+2022-09-21 Ismael Luceno <ismael AT sourcemage.org>
+ * PRE_BUILD: removed dependency on bash
+ * DEPENDS: added dep on libexecinfo for musl hosts
+ * 0003-Remove-nostdlib-and-musl_root-from-musl-targets.patch,
+ 0006-Link-with-ssp_nonshared.patch,
+ 0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch:
+ fixed build against musl
+
2022-09-12 Pavel Vinogradov <public AT sourcemage.org>
* BUILD, DETAILS, INSTALL, PRE_BUILD: reenabled bootstrapping using
system
rust (kudos to binutils)
diff --git a/devel/rust/PRE_BUILD b/devel/rust/PRE_BUILD
index 4258968..531b74c 100755
--- a/devel/rust/PRE_BUILD
+++ b/devel/rust/PRE_BUILD
@@ -2,6 +2,9 @@ default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
apply_patch_dir patches &&

+# Remove dependency on bash
+sedit '1s@bash$@sh@' src/tools/rust-installer/install-template.sh &&
+
# remove checksums to avoid failure with patched sources
sed -i 's/"files":{[^}]*}/"files":{}/' \
vendor/{libc,openssl-sys}/.cargo-checksum.json &&
diff --git
a/devel/rust/patches/0003-Remove-nostdlib-and-musl_root-from-musl-targets.patch

b/devel/rust/patches/0003-Remove-nostdlib-and-musl_root-from-musl-targets.patch
new file mode 100644
index 0000000..2fd902b
--- /dev/null
+++
b/devel/rust/patches/0003-Remove-nostdlib-and-musl_root-from-musl-targets.patch
@@ -0,0 +1,379 @@
+From 273a82b22a5ac25eebb076145caa9b953a3c7671 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sun, 3 May 2020 17:53:33 +0200
+Subject: [PATCH 02/15] Remove -nostdlib and musl_root from musl targets
+
+[ismael AT sourcemage.org: Updated for rust 1.49.0]
+[ismael AT sourcemage.org: Updated for rust 1.63.0 from Void Linux patch]
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ compiler/rustc_target/src/spec/crt_objects.rs | 22 ----------
+ .../rustc_target/src/spec/linux_musl_base.rs | 7 ---
+ config.toml.example | 8 ----
+ src/bootstrap/cc_detect.rs | 25 +----------
+ src/bootstrap/compile.rs | 43 +------------------
+ src/bootstrap/config.rs | 9 ----
+ src/bootstrap/configure.py | 28 ------------
+ src/bootstrap/lib.rs | 19 --------
+ src/bootstrap/sanity.rs | 23 ----------
+ 9 files changed, 3 insertions(+), 181 deletions(-)
+
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs
b/compiler/rustc_target/src/spec/crt_objects.rs
+index 76c0bf419e8c..5ea8a69265ff 100644
+--- a/compiler/rustc_target/src/spec/crt_objects.rs
++++ b/compiler/rustc_target/src/spec/crt_objects.rs
+@@ -63,28 +63,6 @@ pub(super) fn all(obj: &'static 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 5038a967d0a0..bc432445bea7 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".into();
+- 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 c9e183887504..1c217d18f840 100644
+--- a/config.toml.example
++++ b/config.toml.example
+@@ -523,14 +523,6 @@ changelog-seen = 2
+ # supplementary build information, like distro-specific package versions.
+ #description = <none> (string)
+
+-# 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.
+-#
+-# Defaults to /usr on musl hosts. Has no default otherwise.
+-#musl-root = <platform specific> (path)
+-
+ # By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
+ # platforms to ensure that the compiler is usable by default from the build
+ # directory (as it links to a number of dynamic libraries). This may not be
+diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
+index e750c2963ddd..f6ba3032b0d5 100644
+--- a/src/bootstrap/cc_detect.rs
++++ b/src/bootstrap/cc_detect.rs
+@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) {
+ if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
+ cfg.compiler(cc);
+ } else {
+- set_compiler(&mut cfg, Language::C, target, config, build);
++ set_compiler(&mut cfg, Language::C, target, config);
+ }
+
+ let compiler = cfg.get_compiler();
+@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
+ cfg.compiler(cxx);
+ true
+ } else if build.hosts.contains(&target) || build.build == target {
+- set_compiler(&mut cfg, Language::CPlusPlus, target, config,
build);
++ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
+ true
+ } else {
+ // Use an auto-detected compiler (or one configured via
`CXX_target_triple` env vars).
+@@ -161,7 +161,6 @@ fn set_compiler(
+ compiler: Language,
+ target: TargetSelection,
+ config: Option<&Target>,
+- build: &Build,
+ ) {
+ match &*target.triple {
+ // When compiling for android we may have the NDK configured in the
+@@ -204,26 +203,6 @@ fn set_compiler(
+ }
+ }
+
+- "mips-unknown-linux-musl" => {
+- if cfg.get_compiler().path().to_str() == Some("gcc") {
+- cfg.compiler("mips-linux-musl-gcc");
+- }
+- }
+- "mipsel-unknown-linux-musl" => {
+- if cfg.get_compiler().path().to_str() == Some("gcc") {
+- cfg.compiler("mipsel-linux-musl-gcc");
+- }
+- }
+-
+- t if t.contains("musl") => {
+- if let Some(root) = build.musl_root(target) {
+- let guess = root.join("bin/musl-gcc");
+- if guess.exists() {
+- cfg.compiler(guess);
+- }
+- }
+- }
+-
+ _ => {}
+ }
+ }
+diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
+index cdad1cb4d499..26552ece3e91 100644
+--- a/src/bootstrap/compile.rs
++++ b/src/bootstrap/compile.rs
+@@ -200,39 +200,7 @@ fn copy_self_contained_objects(
+ let mut target_deps = vec![];
+
+ // Copies the libc and CRT objects.
+- //
+- // rustc historically provides a more self-contained installation for
musl targets
+- // not requiring the presence of a native musl toolchain. For example,
it can fall back
+- // to using gcc from a glibc-targeting toolchain for linking.
+- // 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_or_else(|| {
+- panic!("Target {:?} does not have a \"musl-libdir\" key",
target.triple)
+- });
+- for &obj in &["libc.a", "crt1.o", "Scrt1.o", "rcrt1.o", "crti.o",
"crtn.o"] {
+- copy_and_stamp(
+- builder,
+- &libdir_self_contained,
+- &srcdir,
+- obj,
+- &mut target_deps,
+- 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));
+- }
+-
+- if !target.starts_with("s390x") {
+- let libunwind_path = copy_llvm_libunwind(builder, target,
&libdir_self_contained);
+- target_deps.push((libunwind_path,
DependencyType::TargetSelfContained));
+- }
+- } else if target.ends_with("-wasi") {
++ if target.ends_with("-wasi") {
+ let srcdir = builder
+ .wasi_root(target)
+ .unwrap_or_else(|| {
+@@ -316,15 +284,6 @@ pub fn std_cargo(builder: &Builder<'_>, target:
TargetSelection, stage: u32, car
+ .arg("--manifest-path")
+ .arg(builder.src.join("library/test/Cargo.toml"));
+
+- // Help the libc crate compile by assisting it in finding various
+- // sysroot native libraries.
+- if target.contains("musl") {
+- if let Some(p) = builder.musl_libdir(target) {
+- let root = format!("native={}", p.to_str().unwrap());
+- cargo.rustflag("-L").rustflag(&root);
+- }
+- }
+-
+ if target.ends_with("-wasi") {
+ 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 c0753d88504a..55ff57dca8d4 100644
+--- a/src/bootstrap/config.rs
++++ b/src/bootstrap/config.rs
+@@ -186,7 +186,6 @@ pub struct Config {
+ pub missing_tools: bool,
+
+ // Fallback musl-root for all targets
+- pub musl_root: Option<PathBuf>,
+ pub prefix: Option<PathBuf>,
+ pub sysconfdir: Option<PathBuf>,
+ pub datadir: Option<PathBuf>,
+@@ -400,8 +399,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,
+@@ -689,7 +686,6 @@ define_config! {
+ default_linker: Option<String> = "default-linker",
+ channel: Option<String> = "channel",
+ description: Option<String> = "description",
+- musl_root: Option<String> = "musl-root",
+ rpath: Option<bool> = "rpath",
+ verbose_tests: Option<bool> = "verbose-tests",
+ optimize_tests: Option<bool> = "optimize-tests",
+@@ -734,8 +730,6 @@ define_config! {
+ sanitizers: Option<bool> = "sanitizers",
+ profiler: Option<bool> = "profiler",
+ crt_static: Option<bool> = "crt-static",
+- musl_root: Option<String> = "musl-root",
+- musl_libdir: Option<String> = "musl-libdir",
+ wasi_root: Option<String> = "wasi-root",
+ qemu_rootfs: Option<String> = "qemu-rootfs",
+ no_std: Option<bool> = "no-std",
+@@ -1107,7 +1101,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;
+- config.musl_root = rust.musl_root.map(PathBuf::from);
+ 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);
+@@ -1164,8 +1157,6 @@ impl Config {
+ target.ranlib = cfg.ranlib.map(PathBuf::from);
+ target.linker = cfg.linker.map(PathBuf::from);
+ target.crt_static = cfg.crt_static;
+- target.musl_root = cfg.musl_root.map(PathBuf::from);
+- 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 322e9d692329..47c7432f38c2 100755
+--- a/src/bootstrap/configure.py
++++ b/src/bootstrap/configure.py
+@@ -114,34 +114,6 @@ v("aarch64-linux-android-ndk",
"target.aarch64-linux-android.android-ndk",
+ "aarch64-linux-android NDK standalone path")
+ v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk",
+ "x86_64-linux-android NDK standalone path")
+-v("musl-root", "target.x86_64-unknown-linux-musl.musl-root",
+- "MUSL root installation directory (deprecated)")
+-v("musl-root-x86_64", "target.x86_64-unknown-linux-musl.musl-root",
+- "x86_64-unknown-linux-musl install directory")
+-v("musl-root-i586", "target.i586-unknown-linux-musl.musl-root",
+- "i586-unknown-linux-musl install directory")
+-v("musl-root-i686", "target.i686-unknown-linux-musl.musl-root",
+- "i686-unknown-linux-musl install directory")
+-v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root",
+- "arm-unknown-linux-musleabi install directory")
+-v("musl-root-armhf", "target.arm-unknown-linux-musleabihf.musl-root",
+- "arm-unknown-linux-musleabihf install directory")
+-v("musl-root-armv5te", "target.armv5te-unknown-linux-musleabi.musl-root",
+- "armv5te-unknown-linux-musleabi install directory")
+-v("musl-root-armv7", "target.armv7-unknown-linux-musleabi.musl-root",
+- "armv7-unknown-linux-musleabi install directory")
+-v("musl-root-armv7hf", "target.armv7-unknown-linux-musleabihf.musl-root",
+- "armv7-unknown-linux-musleabihf install directory")
+-v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root",
+- "aarch64-unknown-linux-musl install directory")
+-v("musl-root-mips", "target.mips-unknown-linux-musl.musl-root",
+- "mips-unknown-linux-musl install directory")
+-v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root",
+- "mipsel-unknown-linux-musl install directory")
+-v("musl-root-mips64", "target.mips64-unknown-linux-muslabi64.musl-root",
+- "mips64-unknown-linux-muslabi64 install directory")
+-v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root",
+- "mips64el-unknown-linux-muslabi64 install directory")
+ 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 210084cf5ea6..56c188a75c52 100644
+--- a/src/bootstrap/lib.rs
++++ b/src/bootstrap/lib.rs
+@@ -1153,25 +1153,6 @@ impl Build {
+ }
+ }
+
+- /// Returns the "musl root" for this `target`, if defined
+- fn musl_root(&self, target: TargetSelection) -> Option<&Path> {
+- self.config
+- .target_config
+- .get(&target)
+- .and_then(|t| t.musl_root.as_ref())
+- .or_else(|| self.config.musl_root.as_ref())
+- .map(|p| &**p)
+- }
+-
+- /// Returns the "musl libdir" for this `target`.
+- fn musl_libdir(&self, target: TargetSelection) -> Option<PathBuf> {
+- let t = self.config.target_config.get(&target)?;
+- if let libdir @ Some(_) = &t.musl_libdir {
+- return libdir.clone();
+- }
+- self.musl_root(target).map(|root| root.join("lib"))
+- }
+-
+ /// Returns the sysroot for the wasi target, if defined
+ fn wasi_root(&self, target: TargetSelection) -> Option<&Path> {
+ self.config.target_config.get(&target).and_then(|t|
t.wasi_root.as_ref()).map(|p| &**p)
+diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
+index 4cfcf6ca407b..c51168779579 100644
+--- a/src/bootstrap/sanity.rs
++++ b/src/bootstrap/sanity.rs
+@@ -11,7 +11,6 @@
+ use std::collections::HashMap;
+ use std::env;
+ use std::ffi::{OsStr, OsString};
+-use std::fs;
+ use std::path::PathBuf;
+ use std::process::Command;
+
+@@ -190,28 +189,6 @@ than building it.
+ }
+ }
+
+- // Make sure musl-root is valid
+- if target.contains("musl") {
+- // If this is a native target (host is also musl) and no
musl-root is given,
+- // fall back to the system toolchain in /usr before giving up
+- if build.musl_root(*target).is_none() && build.config.build ==
*target {
+- let target =
build.config.target_config.entry(*target).or_default();
+- target.musl_root = Some("/usr".into());
+- }
+- match build.musl_libdir(*target) {
+- Some(libdir) => {
+- if fs::metadata(libdir.join("libc.a")).is_err() {
+- panic!("couldn't find libc.a in musl libdir: {}",
libdir.display());
+- }
+- }
+- None => panic!(
+- "when targeting MUSL either the rust.musl-root \
+- option or the target.$TARGET.musl-root option
must \
+- be specified in config.toml"
+- ),
+- }
+- }
+-
+ if need_cmake && target.contains("msvc") {
+ // There are three builds of cmake on windows: MSVC, MinGW, and
+ // Cygwin. The Cygwin build does not have generators for Visual
+--
+2.30.0
+
diff --git a/devel/rust/patches/0006-Link-with-ssp_nonshared.patch
b/devel/rust/patches/0006-Link-with-ssp_nonshared.patch
new file mode 100644
index 0000000..ce5465a
--- /dev/null
+++ b/devel/rust/patches/0006-Link-with-ssp_nonshared.patch
@@ -0,0 +1,30 @@
+From 7002d81e5e161c4d43301ebfb1d535a7a5685587 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Wed, 21 Sep 2022 08:07:25 +0200
+Subject: [PATCH 06/10] Link with libssp_nonshared and libexecinfo
+
+[ismael AT iodev.co.uk: Adjusted based on patches from Void and Alpine for
1.63.0]
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ library/std/build.rs | 2 ++
+ library/unwind/build.rs | 3 +++
+ vendor/libc/src/unix/mod.rs | 6 +++---
+ 3 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/library/std/src/sys/unix/mod.rs
b/library/std/src/sys/unix/mod.rs
+index 34a023b02..934a87570 100644
+--- a/library/std/src/sys/unix/mod.rs
++++ b/library/std/src/sys/unix/mod.rs
+@@ -297,6 +297,10 @@ cfg_if::cfg_if! {
+ #[link(name = "dl")]
+ #[link(name = "log")]
+ extern "C" {}
++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
++ #[link(name = "ssp_nonshared")]
++ #[link(name = "execinfo")]
++ extern "C" {}
+ } else if #[cfg(target_os = "freebsd")] {
+ #[link(name = "execinfo")]
+ #[link(name = "pthread")]
+--
+2.30.0
diff --git
a/devel/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch

b/devel/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
new file mode 100644
index 0000000..3720335
--- /dev/null
+++
b/devel/rust/patches/0010-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch
@@ -0,0 +1,33 @@
+From 7e100ca9dad23efa1aafccd8faf86ec5fa85c351 Mon Sep 17 00:00:00 2001
+From: q66 <daniel AT octaforge.org>
+Date: Sun, 3 May 2020 18:02:03 +0200
+Subject: [PATCH 10/15] Fix dynamic linkage of musl libc for the libc crate
+
+Origin: Void Linux
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ vendor/libc/src/unix/mod.rs | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
+index ecee44411..7ae05f24e 100644
+--- a/vendor/libc/src/unix/mod.rs
++++ b/vendor/libc/src/unix/mod.rs
+@@ -337,11 +337,11 @@ cfg_if! {
+ #[link(name = "c", cfg(not(target_feature = "crt-static")))]
+ extern {}
+ } else if #[cfg(target_env = "musl")] {
++ #[link(name = "c")]
++ extern {}
+ #[cfg_attr(feature = "rustc-dep-of-std",
+- link(name = "c", kind = "static", modifiers = "-bundle",
++ link(name = "gcc", kind = "static", modifiers =
"-bundle",
+ cfg(target_feature = "crt-static")))]
+- #[cfg_attr(feature = "rustc-dep-of-std",
+- link(name = "c", cfg(not(target_feature =
"crt-static"))))]
+ extern {}
+ } else if #[cfg(target_os = "emscripten")] {
+ #[link(name = "c")]
+--
+2.37.2
+



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (84868cfe8da033d4d5057ff92f1de51d9a210095), Ismael Luceno, 09/21/2022

Archive powered by MHonArc 2.6.24.

Top of Page