rust: update to 1.57.0
- separate bootstrap into packages (cleans up template mess) - sync patches from chimera linux (only relevant ones) - drop bootstrap for BE ppc musl targets i don't do anymore - some minor patch updates from ericonr Closes https://github.com/void-linux/void-packages/pull/32555
This commit is contained in:
parent
8cccea89d6
commit
ce3b8aef99
23 changed files with 326 additions and 646 deletions
|
@ -1,5 +1,5 @@
|
|||
diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
|
||||
index 2fc9ab29f..276736159 100644
|
||||
index 2fc9ab29f92..27673615968 100644
|
||||
--- a/compiler/rustc_target/src/spec/crt_objects.rs
|
||||
+++ b/compiler/rustc_target/src/spec/crt_objects.rs
|
||||
@@ -62,28 +62,6 @@ pub(super) fn all(obj: &str) -> CrtObjects {
|
||||
|
@ -32,7 +32,7 @@ index 2fc9ab29f..276736159 100644
|
|||
new(&[
|
||||
(LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]),
|
||||
diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
|
||||
index 5038a967d..b3c0e5bc4 100644
|
||||
index 5038a967d0a..b3c0e5bc416 100644
|
||||
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
|
||||
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
|
||||
@@ -1,16 +1,9 @@
|
||||
|
@ -53,10 +53,10 @@ index 5038a967d..b3c0e5bc4 100644
|
|||
base
|
||||
}
|
||||
diff --git a/config.toml.example b/config.toml.example
|
||||
index 6e5584797..5be9882a8 100644
|
||||
index 61e57eee782..77943129204 100644
|
||||
--- a/config.toml.example
|
||||
+++ b/config.toml.example
|
||||
@@ -638,15 +638,6 @@ changelog-seen = 2
|
||||
@@ -668,15 +668,6 @@ changelog-seen = 2
|
||||
# only use static libraries. If unset, the target's default linkage is used.
|
||||
#crt-static = <platform-specific> (bool)
|
||||
|
||||
|
@ -73,7 +73,7 @@ index 6e5584797..5be9882a8 100644
|
|||
# `wasm32-wasi` target. If you are building wasm32-wasi target, make sure to
|
||||
# create a `[target.wasm32-wasi]` section and move this field there.
|
||||
diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
|
||||
index e750c2963..f6ba3032b 100644
|
||||
index e750c2963dd..f6ba3032b0d 100644
|
||||
--- a/src/bootstrap/cc_detect.rs
|
||||
+++ b/src/bootstrap/cc_detect.rs
|
||||
@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) {
|
||||
|
@ -130,14 +130,13 @@ index e750c2963..f6ba3032b 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
|
||||
index ee3527b6b..0a8b78327 100644
|
||||
index e9cc7662e63..4971534ba0e 100644
|
||||
--- a/src/bootstrap/compile.rs
|
||||
+++ b/src/bootstrap/compile.rs
|
||||
@@ -179,34 +179,7 @@ fn copy_self_contained_objects(
|
||||
let mut target_deps = vec![];
|
||||
@@ -199,36 +199,7 @@ fn copy_self_contained_objects(
|
||||
|
||||
// Copies the CRT objects.
|
||||
- //
|
||||
//
|
||||
- // rustc historically provides a more self-contained installation for musl targets
|
||||
- // not requiring the presence of a native musl toolchain. For example, it can fall back
|
||||
- // to using gcc from a glibc-targeting toolchain for linking.
|
||||
|
@ -164,12 +163,15 @@ index ee3527b6b..0a8b78327 100644
|
|||
- builder.copy(&src, &target);
|
||||
- target_deps.push((target, DependencyType::TargetSelfContained));
|
||||
- }
|
||||
-
|
||||
- let libunwind_path = copy_llvm_libunwind(builder, target, &libdir_self_contained);
|
||||
- target_deps.push((libunwind_path, DependencyType::TargetSelfContained));
|
||||
- } else if target.ends_with("-wasi") {
|
||||
+ if target.ends_with("-wasi") {
|
||||
let srcdir = builder
|
||||
.wasi_root(target)
|
||||
.unwrap_or_else(|| {
|
||||
@@ -288,15 +261,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
|
||||
@@ -312,15 +283,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
|
||||
.arg("--manifest-path")
|
||||
.arg(builder.src.join("library/test/Cargo.toml"));
|
||||
|
||||
|
@ -186,10 +188,10 @@ index ee3527b6b..0a8b78327 100644
|
|||
if let Some(p) = builder.wasi_root(target) {
|
||||
let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap());
|
||||
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
|
||||
index 483816b98..7517d757c 100644
|
||||
index e658d958d0a..914b1390b37 100644
|
||||
--- a/src/bootstrap/config.rs
|
||||
+++ b/src/bootstrap/config.rs
|
||||
@@ -165,7 +165,6 @@ pub struct Config {
|
||||
@@ -172,7 +172,6 @@ pub struct Config {
|
||||
pub missing_tools: bool,
|
||||
|
||||
// Fallback musl-root for all targets
|
||||
|
@ -197,7 +199,7 @@ index 483816b98..7517d757c 100644
|
|||
pub prefix: Option<PathBuf>,
|
||||
pub sysconfdir: Option<PathBuf>,
|
||||
pub datadir: Option<PathBuf>,
|
||||
@@ -291,8 +290,6 @@ pub struct Target {
|
||||
@@ -298,8 +297,6 @@ pub struct Target {
|
||||
pub sanitizers: Option<bool>,
|
||||
pub profiler: Option<bool>,
|
||||
pub crt_static: Option<bool>,
|
||||
|
@ -206,7 +208,7 @@ index 483816b98..7517d757c 100644
|
|||
pub wasi_root: Option<PathBuf>,
|
||||
pub qemu_rootfs: Option<PathBuf>,
|
||||
pub no_std: bool,
|
||||
@@ -481,7 +478,6 @@ struct Rust {
|
||||
@@ -493,7 +490,6 @@ struct Rust {
|
||||
default_linker: Option<String>,
|
||||
channel: Option<String>,
|
||||
description: Option<String>,
|
||||
|
@ -214,7 +216,7 @@ index 483816b98..7517d757c 100644
|
|||
rpath: Option<bool>,
|
||||
verbose_tests: Option<bool>,
|
||||
optimize_tests: Option<bool>,
|
||||
@@ -524,8 +520,6 @@ struct TomlTarget {
|
||||
@@ -536,8 +532,6 @@ struct TomlTarget {
|
||||
sanitizers: Option<bool>,
|
||||
profiler: Option<bool>,
|
||||
crt_static: Option<bool>,
|
||||
|
@ -223,7 +225,7 @@ index 483816b98..7517d757c 100644
|
|||
wasi_root: Option<String>,
|
||||
qemu_rootfs: Option<String>,
|
||||
no_std: Option<bool>,
|
||||
@@ -846,7 +840,6 @@ impl Config {
|
||||
@@ -872,7 +866,6 @@ pub fn parse(args: &[String]) -> Config {
|
||||
set(&mut config.llvm_tools_enabled, rust.llvm_tools);
|
||||
config.rustc_parallel = rust.parallel_compiler.unwrap_or(false);
|
||||
config.rustc_default_linker = rust.default_linker;
|
||||
|
@ -231,7 +233,7 @@ index 483816b98..7517d757c 100644
|
|||
config.save_toolstates = rust.save_toolstates.map(PathBuf::from);
|
||||
set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings));
|
||||
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
|
||||
@@ -892,8 +885,6 @@ impl Config {
|
||||
@@ -918,8 +911,6 @@ pub fn parse(args: &[String]) -> Config {
|
||||
target.ranlib = cfg.ranlib.map(PathBuf::from);
|
||||
target.linker = cfg.linker.map(PathBuf::from);
|
||||
target.crt_static = cfg.crt_static;
|
||||
|
@ -241,10 +243,10 @@ index 483816b98..7517d757c 100644
|
|||
target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
|
||||
target.sanitizers = cfg.sanitizers;
|
||||
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
|
||||
index 999882a1c..7ccc2b73c 100755
|
||||
index 94424cb4548..9ae0cc053e3 100755
|
||||
--- a/src/bootstrap/configure.py
|
||||
+++ b/src/bootstrap/configure.py
|
||||
@@ -109,34 +109,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
|
||||
@@ -114,34 +114,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
|
||||
"aarch64-linux-android NDK standalone path")
|
||||
v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk",
|
||||
"x86_64-linux-android NDK standalone path")
|
||||
|
@ -280,10 +282,18 @@ index 999882a1c..7ccc2b73c 100755
|
|||
"rootfs in qemu testing, you probably don't want to use this")
|
||||
v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs",
|
||||
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
|
||||
index 24da44b93..c08bc6d94 100644
|
||||
index 2d4e1527897..3abe9f4a143 100644
|
||||
--- a/src/bootstrap/lib.rs
|
||||
+++ b/src/bootstrap/lib.rs
|
||||
@@ -927,25 +927,6 @@ impl Build {
|
||||
@@ -277,7 +277,6 @@ pub struct Build {
|
||||
struct Crate {
|
||||
name: Interned<String>,
|
||||
deps: HashSet<Interned<String>>,
|
||||
- id: String,
|
||||
path: PathBuf,
|
||||
}
|
||||
|
||||
@@ -1056,25 +1055,6 @@ fn crt_static(&self, target: TargetSelection) -> Option<bool> {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,11 +319,40 @@ index 24da44b93..c08bc6d94 100644
|
|||
/// Returns the sysroot for the wasi target, if defined
|
||||
fn wasi_root(&self, target: TargetSelection) -> Option<&Path> {
|
||||
self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p)
|
||||
diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs
|
||||
index a38391c7b88..65e229697dc 100644
|
||||
--- a/src/bootstrap/metadata.rs
|
||||
+++ b/src/bootstrap/metadata.rs
|
||||
@@ -14,7 +14,6 @@ struct Output {
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Package {
|
||||
- id: String,
|
||||
name: String,
|
||||
source: Option<String>,
|
||||
manifest_path: String,
|
||||
@@ -50,7 +49,7 @@ pub fn build(build: &mut Build) {
|
||||
.filter(|dep| dep.source.is_none())
|
||||
.map(|dep| INTERNER.intern_string(dep.name))
|
||||
.collect();
|
||||
- build.crates.insert(name, Crate { name, id: package.id, deps, path });
|
||||
+ build.crates.insert(name, Crate { name, deps, path });
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
|
||||
index ed0cbdf97..44937aed9 100644
|
||||
index d7db2cef24f..a791177956d 100644
|
||||
--- a/src/bootstrap/sanity.rs
|
||||
+++ b/src/bootstrap/sanity.rs
|
||||
@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) {
|
||||
@@ -11,7 +11,6 @@
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::ffi::{OsStr, OsString};
|
||||
-use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
|
||||
@@ -178,28 +177,6 @@ pub fn check(build: &mut Build) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,6 +378,6 @@ index ed0cbdf97..44937aed9 100644
|
|||
- }
|
||||
- }
|
||||
-
|
||||
if target.contains("msvc") {
|
||||
if need_cmake && target.contains("msvc") {
|
||||
// There are three builds of cmake on windows: MSVC, MinGW, and
|
||||
// Cygwin. The Cygwin build does not have generators for Visual
|
|
@ -1,52 +0,0 @@
|
|||
From baa7ce46f19e3584d70e47c8df28c084e76446da Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Sun, 3 May 2020 17:48:47 +0200
|
||||
Subject: [PATCH 03/15] Require static native libraries when linking static
|
||||
executables
|
||||
|
||||
On ELF targets like Linux, gcc/ld will create a dynamically-linked
|
||||
executable without warning, even when passed `-static`, when asked to
|
||||
link to a `.so`. Avoid this confusing and unintended behavior by always
|
||||
using the static version of libraries when trying to link static
|
||||
executables.
|
||||
|
||||
Fixes #54243
|
||||
---
|
||||
src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++----
|
||||
1 file changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
index 8bc4e6442..52ff7a52e 100644
|
||||
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
@@ -2081,8 +2081,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
|
||||
}
|
||||
}
|
||||
|
||||
-/// Link in all of our upstream crates' native dependencies. Remember that all of these upstream
|
||||
-/// native dependencies are all non-static dependencies. We've got two cases then:
|
||||
+/// Link in all of our upstream crates' native dependencies. We have two cases:
|
||||
///
|
||||
/// 1. The upstream crate is an rlib. In this case we *must* link in the native dependency because
|
||||
/// the rlib is just an archive.
|
||||
@@ -2015,7 +2013,19 @@
|
||||
continue;
|
||||
}
|
||||
match lib.kind {
|
||||
- NativeLibKind::Dylib | NativeLibKind::Unspecified => cmd.link_dylib(name),
|
||||
+ NativeLibKind::Dylib | NativeLibKind::Unspecified => {
|
||||
+ // On some targets, like Linux, linking a static executable inhibits using
|
||||
+ // dylibs at all. Force native libraries to be static, even if for example
|
||||
+ // an upstream rlib was originally linked against a native shared library.
|
||||
+ if crate_type == config::CrateType::Executable
|
||||
+ && sess.crt_static(Some(crate_type))
|
||||
+ && !sess.target.options.crt_static_allows_dylibs
|
||||
+ {
|
||||
+ cmd.link_staticlib(name)
|
||||
+ } else {
|
||||
+ cmd.link_dylib(name)
|
||||
+ }
|
||||
+ },
|
||||
NativeLibKind::Framework => cmd.link_framework(name),
|
||||
NativeLibKind::StaticNoBundle => {
|
||||
// Link "static-nobundle" native libs only if the crate they originate from
|
|
@ -0,0 +1,69 @@
|
|||
From f9a680688a685ec47ee5ec001574d9b91b4ba35e Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Mon, 20 Dec 2021 00:45:35 +0100
|
||||
Subject: [PATCH 3/9] move debugger scripts to /usr/share/rust
|
||||
|
||||
---
|
||||
src/bootstrap/dist.rs | 2 +-
|
||||
src/etc/rust-gdb | 2 +-
|
||||
src/etc/rust-gdbgui | 2 +-
|
||||
src/etc/rust-lldb | 4 ++--
|
||||
4 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
|
||||
index d4875cfe1..e8b61b8a2 100644
|
||||
--- a/src/bootstrap/dist.rs
|
||||
+++ b/src/bootstrap/dist.rs
|
||||
@@ -499,7 +499,7 @@ impl Step for DebuggerScripts {
|
||||
fn run(self, builder: &Builder<'_>) {
|
||||
let host = self.host;
|
||||
let sysroot = self.sysroot;
|
||||
- let dst = sysroot.join("lib/rustlib/etc");
|
||||
+ let dst = sysroot.join("share/rust");
|
||||
t!(fs::create_dir_all(&dst));
|
||||
let cp_debugger_script = |file: &str| {
|
||||
builder.install(&builder.src.join("src/etc/").join(file), &dst, 0o644);
|
||||
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
|
||||
index b950cea79..559bfe3f1 100755
|
||||
--- a/src/etc/rust-gdb
|
||||
+++ b/src/etc/rust-gdb
|
||||
@@ -12,7 +12,7 @@ fi
|
||||
|
||||
# Find out where the pretty printer Python module is
|
||||
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
|
||||
-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
|
||||
+GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust"
|
||||
|
||||
# Run GDB with the additional arguments that load the pretty printers
|
||||
# Set the environment variable `RUST_GDB` to overwrite the call to a
|
||||
diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui
|
||||
index 9744913b6..8722acdcc 100755
|
||||
--- a/src/etc/rust-gdbgui
|
||||
+++ b/src/etc/rust-gdbgui
|
||||
@@ -41,7 +41,7 @@ fi
|
||||
|
||||
# Find out where the pretty printer Python module is
|
||||
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
|
||||
-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
|
||||
+GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust"
|
||||
|
||||
# Set the environment variable `RUST_GDB` to overwrite the call to a
|
||||
# different/specific command (defaults to `gdb`).
|
||||
diff --git a/src/etc/rust-lldb b/src/etc/rust-lldb
|
||||
index bce72f1ba..8abb01245 100755
|
||||
--- a/src/etc/rust-lldb
|
||||
+++ b/src/etc/rust-lldb
|
||||
@@ -30,8 +30,8 @@ EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
-script_import="command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_lookup.py\""
|
||||
-commands_file="$RUSTC_SYSROOT/lib/rustlib/etc/lldb_commands"
|
||||
+script_import="command script import \"$RUSTC_SYSROOT/share/rust/lldb_lookup.py\""
|
||||
+commands_file="$RUSTC_SYSROOT/share/rust/lldb_commands"
|
||||
|
||||
# Call LLDB with the commands added to the argument list
|
||||
exec "$lldb" --one-line-before-file "$script_import" --source-before-file "$commands_file" "$@"
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
From d5a6a431024790c911d04fd54381c515fb05819e Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Mon, 20 Dec 2021 00:55:18 +0100
|
||||
Subject: [PATCH 4/9] fix shebang on install-template.sh
|
||||
|
||||
---
|
||||
src/tools/rust-installer/install-template.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/tools/rust-installer/install-template.sh b/src/tools/rust-installer/install-template.sh
|
||||
index e68be8911..beaa90f7b 100644
|
||||
--- a/src/tools/rust-installer/install-template.sh
|
||||
+++ b/src/tools/rust-installer/install-template.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
# file at the top-level directory of this distribution and at
|
||||
# http://rust-lang.org/COPYRIGHT.
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -13,51 +13,12 @@ diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
|
|||
index 9182e349b19..0377fbb58fc 100644
|
||||
--- a/library/unwind/src/lib.rs
|
||||
+++ b/library/unwind/src/lib.rs
|
||||
@@ -23,6 +23,6 @@ cfg_if::cfg_if! {
|
||||
}
|
||||
|
||||
#[cfg(target_env = "musl")]
|
||||
-#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
|
||||
+#[link(name = "gcc_eh", cfg(target_feature = "crt-static"))]
|
||||
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
|
||||
extern {}
|
||||
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
|
||||
index f24d957..28828e5 100644
|
||||
--- a/library/unwind/build.rs
|
||||
+++ b/library/unwind/build.rs
|
||||
@@ -5,17 +5,12 @@
|
||||
let target = env::var("TARGET").expect("TARGET was not set");
|
||||
|
||||
if cfg!(feature = "llvm-libunwind")
|
||||
- && ((target.contains("linux") && !target.contains("musl")) || target.contains("fuchsia"))
|
||||
+ && (target.contains("linux") || target.contains("fuchsia"))
|
||||
{
|
||||
// Build the unwinding from libunwind C/C++ source code.
|
||||
llvm_libunwind::compile();
|
||||
} else if target.contains("x86_64-fortanix-unknown-sgx") {
|
||||
llvm_libunwind::compile();
|
||||
- } else if target.contains("linux") {
|
||||
- // linking for Linux is handled in lib.rs
|
||||
- if target.contains("musl") {
|
||||
- llvm_libunwind::compile();
|
||||
- }
|
||||
} else if target.contains("freebsd") {
|
||||
println!("cargo:rustc-link-lib=gcc_s");
|
||||
} else if target.contains("rumprun") {
|
||||
@@ -143,15 +138,6 @@
|
||||
cfg.file(root.join("src").join(src));
|
||||
}
|
||||
|
||||
- if target_env == "musl" {
|
||||
- // use the same C compiler command to compile C++ code so we do not need to setup the
|
||||
- // C++ compiler env variables on the builders
|
||||
- cfg.cpp(false);
|
||||
- // linking for musl is handled in lib.rs
|
||||
- cfg.cargo_metadata(false);
|
||||
- println!("cargo:rustc-link-search=native={}", env::var("OUT_DIR").unwrap());
|
||||
- }
|
||||
-
|
||||
cfg.compile("unwind");
|
||||
@@ -51,7 +51,7 @@
|
||||
#[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
|
||||
extern "C" {}
|
||||
} else {
|
||||
- #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
|
||||
+ #[link(name = "gcc_eh", cfg(target_feature = "crt-static"))]
|
||||
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
|
||||
extern "C" {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
From 227096bde5283269aa1d1002860b6ec54d2cf284 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Brechtmann <johannes.brechtmann@gmail.com>
|
||||
Date: Sun, 22 Nov 2020 16:00:50 +0100
|
||||
Subject: [PATCH] Revert "Include libunwind in the rust-src component."
|
||||
From fc69414484327e4dbff138dd0834fc3bde626008 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Mon, 20 Dec 2021 01:44:54 +0100
|
||||
Subject: [PATCH 6/9] do not install libunwind source (removed)
|
||||
|
||||
This reverts commit 9f27f3796d3487411ab035803a0757d69040649c.
|
||||
---
|
||||
src/bootstrap/dist.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
|
||||
index b2a590307a2..020cd665a0e 100644
|
||||
index e8b61b8a2..02d24a77d 100644
|
||||
--- a/src/bootstrap/dist.rs
|
||||
+++ b/src/bootstrap/dist.rs
|
||||
@@ -1016,7 +1016,7 @@ impl Step for Src {
|
||||
@@ -849,7 +849,7 @@ impl Step for Src {
|
||||
copy_src_dirs(
|
||||
builder,
|
||||
&builder.src,
|
||||
|
@ -22,5 +21,5 @@ index b2a590307a2..020cd665a0e 100644
|
|||
// not needed and contains symlinks which rustup currently
|
||||
// chokes on when unpacking.
|
||||
--
|
||||
2.29.2
|
||||
2.34.1
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From e44838dabefa1a62578895b4465717f7be8a7a86 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Sat, 6 Oct 2018 04:01:48 +0000
|
||||
Subject: [PATCH 06/15] test/use-extern-for-plugins: Don't assume multilib
|
||||
|
||||
---
|
||||
src/test/run-make-fulldeps/use-extern-for-plugins/Makefile | 7 +------
|
||||
1 file changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
|
||||
index 838b1a27..94fa9f6d 100644
|
||||
--- a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
|
||||
+++ b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
|
||||
@@ -4,12 +4,7 @@
|
||||
# ignore-openbsd
|
||||
# ignore-sunos
|
||||
|
||||
-HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
|
||||
-ifeq ($(findstring i686,$(HOST)),i686)
|
||||
-TARGET := $(subst i686,x86_64,$(HOST))
|
||||
-else
|
||||
-TARGET := $(subst x86_64,i686,$(HOST))
|
||||
-endif
|
||||
+TARGET := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs -C extra-filename=-host
|
||||
--
|
||||
2.26.2
|
||||
|
|
@ -1,18 +1,17 @@
|
|||
From a78859bb6690e0ad285d1892d7a40796a40ac287 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Sat, 2 Dec 2017 17:25:44 -0600
|
||||
Subject: [PATCH 02/15] Allow rustdoc to work when cross-compiling on musl
|
||||
From 81ba387384e8ce0aa9bb9b4bd76014d922d85de8 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Mon, 20 Dec 2021 01:48:14 +0100
|
||||
Subject: [PATCH 7/9] fix rustdoc when cross-compiling
|
||||
|
||||
musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
|
||||
---
|
||||
src/bootstrap/bin/rustdoc.rs | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
|
||||
index cba17c8e6..45cbdd81b 100644
|
||||
index e4396d530..cb2312028 100644
|
||||
--- a/src/bootstrap/bin/rustdoc.rs
|
||||
+++ b/src/bootstrap/bin/rustdoc.rs
|
||||
@@ -20,9 +20,6 @@ fn main() {
|
||||
@@ -20,14 +20,11 @@ fn main() {
|
||||
Err(_) => 0,
|
||||
};
|
||||
|
||||
|
@ -22,16 +21,13 @@ index cba17c8e6..45cbdd81b 100644
|
|||
let mut cmd = Command::new(rustdoc);
|
||||
cmd.args(&args)
|
||||
.arg("--sysroot")
|
||||
@@ -35,7 +32,7 @@ fn main() {
|
||||
.arg("dox")
|
||||
.arg("--sysroot")
|
||||
.arg(&sysroot)
|
||||
- .env(bootstrap::util::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
|
||||
+ .env(bootstrap::util::dylib_path_var(), PathBuf::from(libdir.clone()));
|
||||
|
||||
// Force all crates compiled by this compiler to (a) be unstable and (b)
|
||||
// allow the `rustc_private` feature to link to other unstable crates
|
||||
@@ -83,7 +80,7 @@ fn main() {
|
||||
@@ -60,7 +57,7 @@ fn main() {
|
||||
eprintln!(
|
||||
"rustdoc command: {:?}={:?} {:?}",
|
||||
bootstrap::util::dylib_path_var(),
|
||||
|
@ -41,5 +37,5 @@ index cba17c8e6..45cbdd81b 100644
|
|||
);
|
||||
eprintln!("sysroot: {:?}", sysroot);
|
||||
--
|
||||
2.26.2
|
||||
2.34.1
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
From cde014a1108b7d1cea85100cad48b12297267405 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Mon, 17 Sep 2018 01:32:20 +0000
|
||||
Subject: [PATCH 07/15] test/sysroot-crates-are-unstable: Fix test when rpath
|
||||
is disabled
|
||||
|
||||
Without this environment var, the test can't run rustc to find
|
||||
the sysroot path.
|
||||
---
|
||||
.../run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
|
||||
index a35174b3..9e770706 100644
|
||||
--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
|
||||
+++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
|
||||
@@ -1,2 +1,4 @@
|
||||
+-include ../tools.mk
|
||||
+
|
||||
all:
|
||||
- '$(PYTHON)' test.py
|
||||
+ env '$(HOST_RPATH_ENV)' '$(PYTHON)' test.py
|
||||
--
|
||||
2.26.2
|
|
@ -1,77 +0,0 @@
|
|||
From c63745a2777648d530898bae5af9d25266472b05 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Sat, 21 Dec 2019 17:00:40 +0100
|
||||
Subject: [PATCH 08/15] Ignore broken and non-applicable tests
|
||||
|
||||
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, #56475
|
||||
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
|
||||
long-linker-command-lines: takes >10 minutes to run (but still passes)
|
||||
simd-intrinsic-generic-bitmask.rs: broken on BE, #59356
|
||||
simd-intrinsic-generic-select.rs: broken on BE, #59356
|
||||
sparc-struct-abi: no sparc target
|
||||
sysroot-crates-are-unstable: can't run rustc without RPATH
|
||||
---
|
||||
src/test/codegen/sparc-struct-abi.rs | 1 +
|
||||
src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile | 2 ++
|
||||
src/test/run-make-fulldeps/long-linker-command-lines/Makefile | 2 ++
|
||||
src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 2 ++
|
||||
src/test/ui/env-funky-keys.rs | 1 +
|
||||
src/test/ui/simd/simd-intrinsic-generic-bitmask.rs | 2 ++
|
||||
6 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/test/codegen/sparc-struct-abi.rs b/src/test/codegen/sparc-struct-abi.rs
|
||||
index 78e5b14a..6f93e932 100644
|
||||
--- a/src/test/codegen/sparc-struct-abi.rs
|
||||
+++ b/src/test/codegen/sparc-struct-abi.rs
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
// only-sparc64
|
||||
// compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib
|
||||
+// ignore-test
|
||||
#![feature(no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
|
||||
index f124ca2a..363b18f0 100644
|
||||
--- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
|
||||
+++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
|
||||
@@ -1,3 +1,5 @@
|
||||
+# ignore-aarch64
|
||||
+
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
|
||||
index 5876fbc9..5f167ece 100644
|
||||
--- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
|
||||
+++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
|
||||
@@ -1,3 +1,5 @@
|
||||
+# ignore-test
|
||||
+
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
|
||||
index 9e770706..6d92ec5c 100644
|
||||
--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
|
||||
+++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
|
||||
@@ -1,3 +1,5 @@
|
||||
+# ignore-test
|
||||
+
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
diff --git a/src/test/ui/env-funky-keys.rs b/src/test/ui/env-funky-keys.rs
|
||||
index c5c824ac..f3fe047a 100644
|
||||
--- a/src/test/ui/env-funky-keys.rs
|
||||
+++ b/src/test/ui/env-funky-keys.rs
|
||||
@@ -1,6 +1,7 @@
|
||||
// run-pass
|
||||
// Ignore this test on Android, because it segfaults there.
|
||||
|
||||
+// ignore-test
|
||||
// ignore-android
|
||||
// ignore-windows
|
||||
// ignore-cloudabi no execve
|
||||
2.26.2
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From 1c4a66621a5fa34c78fc020084e4166f3af7cbb5 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Mon, 20 Dec 2021 01:48:49 +0100
|
||||
Subject: [PATCH 8/9] link stage 2 tools dynamically to libstd
|
||||
|
||||
stage 2 tools are the ones that are distributed, and we distribute
|
||||
them together with the rust libs so there is no need to worry
|
||||
about unstable ABI
|
||||
---
|
||||
src/bootstrap/builder.rs | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||
index 6750f7a54..de771280e 100644
|
||||
--- a/src/bootstrap/builder.rs
|
||||
+++ b/src/bootstrap/builder.rs
|
||||
@@ -1520,6 +1520,8 @@ impl<'a> Builder<'a> {
|
||||
// linking all deps statically into the dylib.
|
||||
if matches!(mode, Mode::Std | Mode::Rustc) {
|
||||
rustflags.arg("-Cprefer-dynamic");
|
||||
+ } else if stage >= 2 {
|
||||
+ rustflags.arg("-Cprefer-dynamic");
|
||||
}
|
||||
|
||||
// When building incrementally we default to a lower ThinLTO import limit
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From f5dad49f112151bb0ee74570e971bd475cbec128 Mon Sep 17 00:00:00 2001
|
||||
From: q66 <daniel@octaforge.org>
|
||||
Date: Sun, 3 May 2020 18:00:09 +0200
|
||||
Subject: [PATCH 09/15] Link stage2 tools dynamically to libstd
|
||||
|
||||
Replaces an older patch by Samuel Holland. The RUSTC_NO_PREFER_DYNAMIC
|
||||
env var was removed and replaced with the following logic in builder.rs.
|
||||
|
||||
The idea for this patch is to link stage2 tools dynamically as these will
|
||||
be distributed (if built). Intermediate tools from previous stages will
|
||||
be statically linked for convenience.
|
||||
---
|
||||
src/bootstrap/builder.rs | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||
index eb0199fd..0ec7cbd8 100644
|
||||
--- a/src/bootstrap/builder.rs
|
||||
+++ b/src/bootstrap/builder.rs
|
||||
@@ -1236,6 +1236,8 @@ impl<'a> Builder<'a> {
|
||||
// linking all deps statically into the dylib.
|
||||
if let Mode::Std | Mode::Rustc | Mode::Codegen = mode {
|
||||
rustflags.arg("-Cprefer-dynamic");
|
||||
+ } else if stage >= 2 {
|
||||
+ rustflags.arg("-Cprefer-dynamic");
|
||||
}
|
||||
|
||||
// When building incrementally we default to a lower ThinLTO import limit
|
||||
--
|
||||
2.26.2
|
||||
|
|
@ -1,18 +1,8 @@
|
|||
From 07efbc3bdd67de4e13b0f3f4df853a9de0800ec3 Mon Sep 17 00:00:00 2001
|
||||
From: q66 <daniel@octaforge.org>
|
||||
Date: Sun, 3 May 2020 18:05:22 +0200
|
||||
Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
|
||||
setups
|
||||
|
||||
---
|
||||
src/librustc_llvm/build.rs | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
|
||||
index 621363bed..01322e1d2 100644
|
||||
index 36a6d2cc3..af4e1219f 100644
|
||||
--- a/compiler/rustc_llvm/build.rs
|
||||
+++ b/compiler/rustc_llvm/build.rs
|
||||
@@ -242,9 +242,11 @@ fn main() {
|
||||
@@ -230,9 +230,11 @@ fn main() {
|
||||
for lib in output(&mut cmd).split_whitespace() {
|
||||
if is_crossed {
|
||||
if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
|
||||
|
@ -27,5 +17,5 @@ index 621363bed..01322e1d2 100644
|
|||
} else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") {
|
||||
println!("cargo:rustc-link-search=native={}", stripped);
|
||||
--
|
||||
2.26.2
|
||||
2.34.1
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
From 9b0c14783127e195d7bd54ca2c0c498a46714964 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Holland <samuel@sholland.org>
|
||||
Date: Mon, 17 Sep 2018 02:09:10 +0000
|
||||
Subject: [PATCH 10/15] Move debugger scripts to /usr/share/rust
|
||||
|
||||
---
|
||||
src/bootstrap/dist.rs | 2 +-
|
||||
src/etc/rust-gdb | 2 +-
|
||||
src/etc/rust-lldb | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
|
||||
index 8215211e..05a173b4 100644
|
||||
--- a/src/bootstrap/dist.rs
|
||||
+++ b/src/bootstrap/dist.rs
|
||||
@@ -603,7 +603,7 @@ impl Step for DebuggerScripts {
|
||||
fn run(self, builder: &Builder<'_>) {
|
||||
let host = self.host;
|
||||
let sysroot = self.sysroot;
|
||||
- let dst = sysroot.join("lib/rustlib/etc");
|
||||
+ let dst = sysroot.join("share/rust");
|
||||
t!(fs::create_dir_all(&dst));
|
||||
let cp_debugger_script = |file: &str| {
|
||||
builder.install(&builder.src.join("src/etc/").join(file), &dst, 0o644);
|
||||
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
|
||||
index 23ba93da..dc51b16c 100755
|
||||
--- a/src/etc/rust-gdb
|
||||
+++ b/src/etc/rust-gdb
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
# Find out where the pretty printer Python module is
|
||||
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
|
||||
-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
|
||||
+GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust"
|
||||
|
||||
# Run GDB with the additional arguments that load the pretty printers
|
||||
# Set the environment variable `RUST_GDB` to overwrite the call to a
|
|
@ -8,22 +8,6 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
|
|||
vendor/libc/src/unix/mod.rs | 6 +++---
|
||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs
|
||||
index 6bb71c552..22060a8d7 100644
|
||||
--- a/vendor/libc/src/lib.rs
|
||||
+++ b/vendor/libc/src/lib.rs
|
||||
@@ -24,10 +24,7 @@
|
||||
#![deny(missing_copy_implementations, safe_packed_borrows)]
|
||||
#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
|
||||
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
|
||||
-#![cfg_attr(
|
||||
- any(feature = "rustc-dep-of-std", target_os = "redox"),
|
||||
- feature(static_nobundle)
|
||||
-)]
|
||||
+#![cfg_attr(feature = "rustc-dep-of-std", feature(static_nobundle))]
|
||||
#![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))]
|
||||
|
||||
#[macro_use]
|
||||
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
|
||||
index 238da24b..ffb05ee7 100644
|
||||
--- a/vendor/libc/src/unix/mod.rs
|
||||
|
|
|
@ -9,14 +9,14 @@ Fixes #81334.
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||
index f39e89a9d01f7..061d7ed5ee08b 100644
|
||||
index 6750f7a549d..6032a685776 100644
|
||||
--- a/src/bootstrap/builder.rs
|
||||
+++ b/src/bootstrap/builder.rs
|
||||
@@ -1237,7 +1237,7 @@ impl<'a> Builder<'a> {
|
||||
@@ -1299,7 +1299,7 @@ pub fn cargo(
|
||||
// efficient initial-exec TLS model. This doesn't work with `dlopen`,
|
||||
// so we can't use it by default in general, but we can use it for tools
|
||||
// and our own internal libraries.
|
||||
- if !mode.must_support_dlopen() {
|
||||
- if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") {
|
||||
+ if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") && !target.triple.starts_with("powerpcle-") {
|
||||
rustflags.arg("-Ztls-model=initial-exec");
|
||||
}
|
||||
|
|
23
srcpkgs/rust/patches/ld-library-path.patch
Normal file
23
srcpkgs/rust/patches/ld-library-path.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
commit 798e44e67c0bac6509b7915767450b0381c94017
|
||||
Author: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Tue Dec 21 00:48:29 2021 +0100
|
||||
|
||||
do not export LD_LIBRARY_PATH
|
||||
|
||||
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
|
||||
index 0170be967..f7a9ec785 100644
|
||||
--- a/src/bootstrap/bootstrap.py
|
||||
+++ b/src/bootstrap/bootstrap.py
|
||||
@@ -924,12 +924,6 @@ class RustBuild(object):
|
||||
del env["CARGO_BUILD_TARGET"]
|
||||
env["CARGO_TARGET_DIR"] = build_dir
|
||||
env["RUSTC"] = self.rustc(True)
|
||||
- env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(True), "lib") + \
|
||||
- (os.pathsep + env["LD_LIBRARY_PATH"]) \
|
||||
- if "LD_LIBRARY_PATH" in env else ""
|
||||
- env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(True), "lib") + \
|
||||
- (os.pathsep + env["DYLD_LIBRARY_PATH"]) \
|
||||
- if "DYLD_LIBRARY_PATH" in env else ""
|
||||
env["LIBRARY_PATH"] = os.path.join(self.bin_root(True), "lib") + \
|
||||
(os.pathsep + env["LIBRARY_PATH"]) \
|
||||
if "LIBRARY_PATH" in env else ""
|
67
srcpkgs/rust/patches/native-sysroot.patch
Normal file
67
srcpkgs/rust/patches/native-sysroot.patch
Normal file
|
@ -0,0 +1,67 @@
|
|||
commit 57ed964d186212739fa436f103bd923a2309f341
|
||||
Author: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Tue Dec 21 02:46:30 2021 +0100
|
||||
|
||||
allow specifying native sysroot to use for linkage
|
||||
|
||||
This allows us to get around the linker attempting to use
|
||||
incompatible libs.
|
||||
|
||||
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
|
||||
index de771280e..5faaf9439 100644
|
||||
--- a/src/bootstrap/builder.rs
|
||||
+++ b/src/bootstrap/builder.rs
|
||||
@@ -1166,6 +1166,10 @@ impl<'a> Builder<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
+ if let Some(sysroot) = self.native_sysroot(target) {
|
||||
+ rustflags.arg(&format!("-Clink-args=--sysroot={}", sysroot.display()));
|
||||
+ }
|
||||
+
|
||||
if let Some(host_linker) = self.linker(compiler.host) {
|
||||
cargo.env("RUSTC_HOST_LINKER", host_linker);
|
||||
}
|
||||
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
|
||||
index 06b7a8c55..d8e9275ad 100644
|
||||
--- a/src/bootstrap/config.rs
|
||||
+++ b/src/bootstrap/config.rs
|
||||
@@ -292,6 +292,7 @@ pub struct Target {
|
||||
pub ar: Option<PathBuf>,
|
||||
pub ranlib: Option<PathBuf>,
|
||||
pub linker: Option<PathBuf>,
|
||||
+ pub sysroot: Option<PathBuf>,
|
||||
pub ndk: Option<PathBuf>,
|
||||
pub sanitizers: Option<bool>,
|
||||
pub profiler: Option<bool>,
|
||||
@@ -525,6 +526,7 @@ struct TomlTarget {
|
||||
ar: Option<String>,
|
||||
ranlib: Option<String>,
|
||||
linker: Option<String>,
|
||||
+ sysroot: Option<String>,
|
||||
llvm_config: Option<String>,
|
||||
llvm_filecheck: Option<String>,
|
||||
android_ndk: Option<String>,
|
||||
@@ -909,6 +911,7 @@ impl Config {
|
||||
target.ar = cfg.ar.map(PathBuf::from);
|
||||
target.ranlib = cfg.ranlib.map(PathBuf::from);
|
||||
target.linker = cfg.linker.map(PathBuf::from);
|
||||
+ target.sysroot = cfg.sysroot.map(PathBuf::from);
|
||||
target.crt_static = cfg.crt_static;
|
||||
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
|
||||
target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
|
||||
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
|
||||
index b930f3cd7..06e782520 100644
|
||||
--- a/src/bootstrap/lib.rs
|
||||
+++ b/src/bootstrap/lib.rs
|
||||
@@ -1056,6 +1056,10 @@ impl Build {
|
||||
}
|
||||
}
|
||||
|
||||
+ fn native_sysroot(&self, target: TargetSelection) -> Option<&Path> {
|
||||
+ self.config.target_config.get(&target).and_then(|c| c.sysroot.as_ref()).map(|p| &**p)
|
||||
+ }
|
||||
+
|
||||
/// 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)
|
|
@ -6,7 +6,7 @@
|
|||
extern "C" {}
|
||||
+ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
|
||||
+ #[link(name = "ssp_nonshared")]
|
||||
+ #[link(name = "execinfo")]
|
||||
+ #[link(name = "execinfo")]
|
||||
+ extern "C" {}
|
||||
} else if #[cfg(target_os = "freebsd")] {
|
||||
#[link(name = "execinfo")]
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
From dc1de5be2b7908adb493b36f5079064083ed9507 Mon Sep 17 00:00:00 2001
|
||||
From: q66 <daniel@octaforge.org>
|
||||
Date: Sat, 3 Jul 2021 19:00:46 +0200
|
||||
Subject: [PATCH 1/2] cc-1.0.60: fix powerpcle being matched as as msvc
|
||||
|
||||
---
|
||||
vendor/cc-1.0.60/src/lib.rs | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/vendor/cc-1.0.60/src/lib.rs b/vendor/cc-1.0.60/src/lib.rs
|
||||
index aff6be86..f428ecbb 100644
|
||||
--- a/vendor/cc-1.0.60/src/lib.rs
|
||||
+++ b/vendor/cc-1.0.60/src/lib.rs
|
||||
@@ -2556,11 +2556,7 @@ impl Tool {
|
||||
let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) {
|
||||
if fname.contains("clang-cl") {
|
||||
ToolFamily::Msvc { clang_cl: true }
|
||||
- } else if fname.contains("cl")
|
||||
- && !fname.contains("cloudabi")
|
||||
- && !fname.contains("uclibc")
|
||||
- && !fname.contains("clang")
|
||||
- {
|
||||
+ } else if fname.ends_with("cl") || fname == "cl.exe" {
|
||||
ToolFamily::Msvc { clang_cl: false }
|
||||
} else if fname.contains("clang") {
|
||||
match clang_driver {
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From bf983e79364d2d1c4a22857fadae8fcdc6646ef3 Mon Sep 17 00:00:00 2001
|
||||
From: q66 <daniel@octaforge.org>
|
||||
Date: Sun, 4 Jul 2021 02:17:26 +0200
|
||||
Subject: [PATCH] gcc: fix powerpcle being matched as msvc
|
||||
|
||||
---
|
||||
vendor/gcc/src/lib.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/vendor/gcc/src/lib.rs b/vendor/gcc/src/lib.rs
|
||||
index 7980281f..05787ceb 100644
|
||||
--- a/vendor/gcc/src/lib.rs
|
||||
+++ b/vendor/gcc/src/lib.rs
|
||||
@@ -1549,7 +1549,7 @@ impl Tool {
|
||||
let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) {
|
||||
if fname.contains("clang") {
|
||||
ToolFamily::Clang
|
||||
- } else if fname.contains("cl") && !fname.contains("uclibc") {
|
||||
+ } else if fname.ends_with("cl") || fname == "cl.exe" {
|
||||
ToolFamily::Msvc
|
||||
} else {
|
||||
ToolFamily::Gnu
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -30,11 +30,7 @@ Subject: [PATCH] initial ppcle port
|
|||
src/test/ui/target-feature/gate.rs | 1 +
|
||||
src/test/ui/target-feature/invalid-attribute.rs | 1 +
|
||||
src/tools/compiletest/src/util.rs | 1 +
|
||||
vendor/cc-1.0.60/src/lib.rs | 1 +
|
||||
vendor/cc/src/lib.rs | 1 +
|
||||
vendor/gcc/src/lib.rs | 3 ++-
|
||||
vendor/jemallocator/benches/roundtrip.rs | 3 ++-
|
||||
vendor/jemallocator/src/lib.rs | 3 ++-
|
||||
vendor/rustc-ap-rustc_target/src/spec/mod.rs | 2 ++
|
||||
.../src/spec/powerpcle_unknown_linux_gnu.rs | 15 +++++++++++++++
|
||||
.../src/spec/powerpcle_unknown_linux_musl.rs | 15 +++++++++++++++
|
||||
|
@ -57,9 +53,9 @@ index c2e9dba6..8147a3c3 100644
|
|||
target.os == "linux" && target.arch == "powerpc" && target_env_gnu_like;
|
||||
+ let linux_powerpcle_gnu_like =
|
||||
+ target.os == "linux" && target.arch == "powerpcle" && target_env_gnu_like;
|
||||
use SpecAbi::*;
|
||||
let rust_abi = matches!(sig.abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall);
|
||||
|
||||
// Handle safe Rust thin and fat pointers.
|
||||
@@ -2850,7 +2852,8 @@ where
|
||||
|| (!win_x64_gnu
|
||||
&& !linux_s390x_gnu_like
|
||||
|
@ -394,18 +390,6 @@ index 7dbd7094..08c9de3c 100644
|
|||
("powerpc64", "powerpc64"),
|
||||
("powerpc64le", "powerpc64"),
|
||||
("riscv64gc", "riscv64"),
|
||||
diff --git a/vendor/cc-1.0.60/src/lib.rs b/vendor/cc-1.0.60/src/lib.rs
|
||||
index f428ecbb..841e459a 100644
|
||||
--- a/vendor/cc-1.0.60/src/lib.rs
|
||||
+++ b/vendor/cc-1.0.60/src/lib.rs
|
||||
@@ -2302,6 +2302,7 @@ impl Build {
|
||||
"mipsisa64r6-unknown-linux-gnuabi64" => Some("mipsisa64r6-linux-gnuabi64"),
|
||||
"mipsisa64r6el-unknown-linux-gnuabi64" => Some("mipsisa64r6el-linux-gnuabi64"),
|
||||
"powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
|
||||
+ "powerpcle-unknown-linux-gnu" => Some("powerpcle-linux-gnu"),
|
||||
"powerpc-unknown-linux-gnuspe" => Some("powerpc-linux-gnuspe"),
|
||||
"powerpc-unknown-netbsd" => Some("powerpc--netbsd"),
|
||||
"powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
|
||||
diff --git a/vendor/cc/src/lib.rs b/vendor/cc/src/lib.rs
|
||||
index 5051b296..286c2fb7 100644
|
||||
--- a/vendor/cc/src/lib.rs
|
||||
|
@ -418,48 +402,6 @@ index 5051b296..286c2fb7 100644
|
|||
"powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
|
||||
"powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"),
|
||||
"riscv32i-unknown-none-elf" => self.find_working_gnu_prefix(&[
|
||||
diff --git a/vendor/gcc/src/lib.rs b/vendor/gcc/src/lib.rs
|
||||
index 1fe73012..7980281f 100644
|
||||
--- a/vendor/gcc/src/lib.rs
|
||||
+++ b/vendor/gcc/src/lib.rs
|
||||
@@ -1367,7 +1367,8 @@ impl Build {
|
||||
"mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"),
|
||||
"powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
|
||||
"powerpc-unknown-netbsd" => Some("powerpc--netbsd"),
|
||||
- "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"),
|
||||
+ "powerpcle-unknown-linux-gnu" => Some("powerpcle-linux-gnu"),
|
||||
+ "powerpc64-unknown-linux-gnu" => Some("powerpc64-linux-gnu"),
|
||||
"powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"),
|
||||
"s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"),
|
||||
"sparc64-unknown-netbsd" => Some("sparc64--netbsd"),
|
||||
diff --git a/vendor/jemallocator/benches/roundtrip.rs b/vendor/jemallocator/benches/roundtrip.rs
|
||||
index eddbb6bb..db81596b 100644
|
||||
--- a/vendor/jemallocator/benches/roundtrip.rs
|
||||
+++ b/vendor/jemallocator/benches/roundtrip.rs
|
||||
@@ -26,7 +26,8 @@ static A: Jemalloc = Jemalloc;
|
||||
target_arch = "arm",
|
||||
target_arch = "mips",
|
||||
target_arch = "mipsel",
|
||||
- target_arch = "powerpc"
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpcle"
|
||||
)))]
|
||||
const MIN_ALIGN: usize = 8;
|
||||
#[cfg(all(any(
|
||||
diff --git a/vendor/jemallocator/src/lib.rs b/vendor/jemallocator/src/lib.rs
|
||||
index f0a3692d..43889c55 100644
|
||||
--- a/vendor/jemallocator/src/lib.rs
|
||||
+++ b/vendor/jemallocator/src/lib.rs
|
||||
@@ -37,7 +37,8 @@ use libc::{c_int, c_void};
|
||||
target_arch = "arm",
|
||||
target_arch = "mips",
|
||||
target_arch = "mipsel",
|
||||
- target_arch = "powerpc"
|
||||
+ target_arch = "powerpc",
|
||||
+ target_arch = "powerpcle"
|
||||
)))]
|
||||
const MIN_ALIGN: usize = 8;
|
||||
#[cfg(all(any(
|
||||
diff --git a/vendor/rustc-ap-rustc_target/src/spec/mod.rs b/vendor/rustc-ap-rustc_target/src/spec/mod.rs
|
||||
index 2af46693..986d84e0 100644
|
||||
--- a/vendor/rustc-ap-rustc_target/src/spec/mod.rs
|
||||
|
|
|
@ -8,11 +8,10 @@
|
|||
# uploaded to https://alpha.de.repo.voidlinux.org/distfiles/
|
||||
#
|
||||
pkgname=rust
|
||||
version=1.53.0
|
||||
version=1.57.0
|
||||
revision=1
|
||||
_rust_dist_version=1.53.0
|
||||
wrksrc="rustc-${version}-src"
|
||||
hostmakedepends="cmake curl pkg-config python3 tar"
|
||||
hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap"
|
||||
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12"
|
||||
depends="rust-std"
|
||||
short_desc="Safe, concurrent, practical systems language"
|
||||
|
@ -20,8 +19,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=5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9
|
||||
checksum=3546f9c3b91b1f8b8efd26c94d6b50312c08210397b4072ed2748e2bd4445c1a
|
||||
lib32disabled=yes
|
||||
make_check=no # CBA for now
|
||||
|
||||
build_options="bindist"
|
||||
desc_option_bindist="Generate tarballs for bootstrap"
|
||||
|
@ -33,143 +33,14 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
|
|||
makedepends+=" libexecinfo-devel"
|
||||
fi
|
||||
|
||||
# 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="${_rust_dist_version}"
|
||||
|
||||
# 32-bit gnu ppc needs custom bootstrap because of patches
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64*|i686|ppc64le) ;;
|
||||
ppc*)
|
||||
# custom bootstrap tarballs still use cargo versioning, so override
|
||||
_bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles"
|
||||
_cargo_dist_version="0.54.0"
|
||||
;;
|
||||
esac
|
||||
|
||||
# always use external binary cargo; this allows us to break
|
||||
# the cargo<->rust cycle that appears when cross-compiling
|
||||
distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz"
|
||||
|
||||
case "$XBPS_MACHINE" in
|
||||
i686)
|
||||
checksum+="
|
||||
deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927"
|
||||
;;
|
||||
x86_64)
|
||||
checksum+="
|
||||
e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b"
|
||||
;;
|
||||
x86_64-musl)
|
||||
checksum+="
|
||||
ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b"
|
||||
;;
|
||||
ppc64le)
|
||||
checksum+="
|
||||
ca1d94161c3a4021bca170ba4ca059b5606fcd70934aca89d8cea43746880ba7"
|
||||
;;
|
||||
ppc64le-musl)
|
||||
checksum+="
|
||||
1181b721addeb2aa471bf71549a7fb09f27167c382b480cefba272f770b9f039"
|
||||
;;
|
||||
ppc64)
|
||||
checksum+="
|
||||
7d9b0428d4cd8cdd76582b3113476228013ec0b674802f18b4b5e8bbefcd3ab2"
|
||||
;;
|
||||
ppc64-musl)
|
||||
checksum+="
|
||||
695d687c19a729504ac8b57a42e395258a8b801753baf1b0b17755d7f38f7eaa"
|
||||
;;
|
||||
ppc)
|
||||
checksum+="
|
||||
176f178b9e55f399311edb4888d931e5f696766f655cc9648ae4b6ef1bdc8369"
|
||||
;;
|
||||
ppc-musl)
|
||||
checksum+="
|
||||
234cf0792407065f4c5c4276886846cee2ecfb37eea1171c2c6e4a0fba7d324c"
|
||||
;;
|
||||
*) broken="cargo bootstrap binary unavailable for ${XBPS_MACHINE}";;
|
||||
esac
|
||||
|
||||
_bootstrap_dir="stage0-bootstrap"
|
||||
|
||||
# as for the rust compiler, just depend on self when crosscompiling...
|
||||
# this is because if we do that, we can skip stage0 build and considerably
|
||||
# cut down the build time (the local-rebuild property is enabled for cross)
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
hostmakedepends+=" rust llvm12"
|
||||
# These are required for building the buildhost's stage0/1
|
||||
hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
|
||||
else
|
||||
distfiles+="
|
||||
${_bootstrap_url}/rustc-${_rust_dist_version}-${RUST_BUILD}.tar.xz
|
||||
${_bootstrap_url}/rust-std-${_rust_dist_version}-${RUST_BUILD}.tar.xz"
|
||||
|
||||
case "$XBPS_MACHINE" in
|
||||
i686)
|
||||
checksum+="
|
||||
93b05456ea8500864e020cfbb1dfbe0a93651406432b6950013f87b91ea6ff47
|
||||
d63690da8adb531bb92e76e211b37d3cf941fa841eaaaa210cce4cd6301ca64a"
|
||||
;;
|
||||
x86_64)
|
||||
checksum+="
|
||||
9c2f0443a546dd18f1f020c7711a7b9864432545ceb812e79315c1e76508b193
|
||||
66d5257bbd194db08e67ca63a74cc80cdc4a36eaa30bf7dfe65861d9deaff7f7"
|
||||
;;
|
||||
x86_64-musl)
|
||||
checksum+="
|
||||
50de8b4bcb0819ec0ca363e0aa53fc1c55bc85f53bc82da8dce20a132da7e7d9
|
||||
413449866616b1cd048da1356a41d977bf4e037cce114f07c3afbb0497b3e4c6"
|
||||
;;
|
||||
ppc64le)
|
||||
checksum+="
|
||||
7624a5bf09bcaddc90851928d604e78ad9896b041ad1124b064a716b7250b42b
|
||||
d29a9c16a52f3a5767733597efdb9cc1e3cb390961b11cf1d1792b48939de5ed"
|
||||
;;
|
||||
ppc64le-musl)
|
||||
checksum+="
|
||||
09cd44fed6bf2d7ac0d180fc1374022deeb08be1d245ee26d1cfccc62658d22f
|
||||
c283d604807f1c00e95a5122352941a64a26c3031ff41b80d395ac01ab55aa80"
|
||||
;;
|
||||
ppc64)
|
||||
checksum+="
|
||||
3136af38b2413524f02bbf1377c32c82f5f3791c5f78b926d7d74ef667349a69
|
||||
a01e07e15e151f5c6fdd7f3f167fa96326ea8fffdce402a3dbb9687f33ae5ccc"
|
||||
;;
|
||||
ppc64-musl)
|
||||
checksum+="
|
||||
5dbcb8ca33874d7a82543b4f9d9f1c51e5680a998b0b572119e8be6b8ae4f566
|
||||
5f03e215507313d14fc5275ba6951d3d7590634909def352504f52ad57c24dc3"
|
||||
;;
|
||||
ppc)
|
||||
checksum+="
|
||||
be6ca5e02c04329b082eaf717ba2ea370d676a93e520cd5988883ea2ed8cb750
|
||||
6006f7f78e30810e8b929ab5ab97cf5e4488a25f7fe6a49a1a548dd4745281e0"
|
||||
;;
|
||||
ppc-musl)
|
||||
checksum+="
|
||||
6ecf74e3718bfc03a09ece82a246c9fe268bbb9a7d96cb7d65b579a824e5e1d9
|
||||
17d14e51263e253ba082fc0b05f887dad7d16c705304514aa3268904ac472d29"
|
||||
;;
|
||||
*) broken="rust bootstrap binaries unavailable for ${XBPS_MACHINE}";;
|
||||
esac
|
||||
hostmakedepends+=" rust-bootstrap"
|
||||
fi
|
||||
|
||||
post_extract() {
|
||||
mkdir -p "${wrksrc}/${_bootstrap_dir}/bin"
|
||||
if [ -z "$CROSS_BUILD" ]; then
|
||||
../rust-std-${_rust_dist_version}-${RUST_BUILD}/install.sh \
|
||||
--destdir="${wrksrc}/${_bootstrap_dir}" --prefix=/ --disable-ldconfig
|
||||
../rustc-${_rust_dist_version}-${RUST_BUILD}/install.sh \
|
||||
--destdir="${wrksrc}/${_bootstrap_dir}" --prefix=/ --disable-ldconfig
|
||||
fi
|
||||
# cargo may not be packaged like the rest
|
||||
cp ../cargo-${_cargo_dist_version}-${RUST_BUILD}/cargo/bin/cargo \
|
||||
"${wrksrc}/${_bootstrap_dir}/bin"
|
||||
}
|
||||
|
||||
# we need this because cargo verifies checksums of all files in vendor
|
||||
# crates when it builds and gives us no way to override or update the
|
||||
# file sanely... so just clear out the file list
|
||||
|
@ -189,39 +60,27 @@ post_patch() {
|
|||
# clear out all the checksum nonsense of patched vendor crates
|
||||
_clear_vendor_checksums libc
|
||||
_clear_vendor_checksums typenum
|
||||
_clear_vendor_checksums cc-1.0.60
|
||||
_clear_vendor_checksums gcc
|
||||
_clear_vendor_checksums cc
|
||||
_clear_vendor_checksums jemallocator
|
||||
_clear_vendor_checksums rustc-ap-rustc_target
|
||||
_clear_vendor_checksums target-lexicon
|
||||
_clear_vendor_checksums tikv-jemallocator
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
local _cargo_root _rust_root _local_rebuild _use_debug _use_debug_rustc _use_rpath _use_docs
|
||||
local _local_rebuild _use_debug _use_debug_rustc _use_rpath _use_docs _llvm_shared
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
_rust_root="/usr"
|
||||
_local_rebuild="true"
|
||||
else
|
||||
_rust_root="${wrksrc}/${_bootstrap_dir}"
|
||||
_local_rebuild="false"
|
||||
fi
|
||||
|
||||
_cargo_root="${wrksrc}/${_bootstrap_dir}"
|
||||
|
||||
# disable rustc debug info as it bloats up rust-std significantly
|
||||
# set to 1 or 2 if you wish to have debug info for rustc, it won't
|
||||
# link on 32-bit platforms though (too big)
|
||||
_use_debug_rustc="0"
|
||||
|
||||
# use stdlib debug level 2 for all platforms when generating debug
|
||||
if [ -n "$XBPS_DEBUG_PKGS" ]; then
|
||||
_use_debug="2"
|
||||
else
|
||||
_use_debug="0"
|
||||
fi
|
||||
# just disable debug for now
|
||||
_use_debug="0"
|
||||
|
||||
# if true, the binaries will be built with rpath, so the binaries will be
|
||||
# usable directly from the build directory, this is not desirable for
|
||||
|
@ -229,18 +88,24 @@ do_configure() {
|
|||
if [ "$build_option_bindist" ]; then
|
||||
_use_rpath="true"
|
||||
_use_docs="false"
|
||||
_llvm_shared="false"
|
||||
else
|
||||
_use_rpath="false"
|
||||
_use_docs="true"
|
||||
_llvm_shared="true"
|
||||
fi
|
||||
|
||||
cat > config.toml <<- EOF
|
||||
changelog-seen = 2
|
||||
[llvm]
|
||||
ninja = false
|
||||
link-shared = ${_llvm_shared}
|
||||
[build]
|
||||
build = "${RUST_BUILD}"
|
||||
host = [ "${RUST_TARGET}" ]
|
||||
target = [ "${RUST_TARGET}" ]
|
||||
cargo = "${_cargo_root}/bin/cargo"
|
||||
rustc = "${_rust_root}/bin/rustc"
|
||||
cargo = "/usr/bin/cargo"
|
||||
rustc = "/usr/bin/rustc"
|
||||
submodules = false
|
||||
python = "python3"
|
||||
locked-deps = true
|
||||
|
@ -253,13 +118,13 @@ do_configure() {
|
|||
[install]
|
||||
prefix = "/usr"
|
||||
[rust]
|
||||
optimize = true
|
||||
debug = false
|
||||
codegen-units = 1
|
||||
codegen-units-std = 1
|
||||
debug-assertions = false
|
||||
debuginfo-level = ${_use_debug}
|
||||
debuginfo-level-rustc = ${_use_debug_rustc}
|
||||
debuginfo-level-tests = 0
|
||||
backtrace = true
|
||||
incremental = false
|
||||
parallel-compiler = false
|
||||
channel = "stable"
|
||||
|
@ -289,6 +154,7 @@ do_configure() {
|
|||
cxx = "${CXX}"
|
||||
ar = "${AR}"
|
||||
linker = "${CC}"
|
||||
sysroot = "${XBPS_CROSS_BASE}"
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
@ -297,17 +163,16 @@ do_configure() {
|
|||
# for it during stage1. Otherwise it attemps to use CFLAGS, which are the CFLAGS
|
||||
# of the cross host.
|
||||
do_build() {
|
||||
if [ ! "$build_option_bindist" ]; then
|
||||
export LLVM_LINK_SHARED=1
|
||||
fi
|
||||
export RUST_BACKTRACE=1
|
||||
export CARGO_HOME="$wrksrc/.cargo"
|
||||
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
# prevent sysroot from leaking in
|
||||
export RUSTFLAGS=""
|
||||
|
||||
env CFLAGS_${RUST_BUILD}="${CFLAGS_host}" \
|
||||
python3 x.py dist --jobs $XBPS_MAKEJOBS
|
||||
CXXFLAGS_${RUST_BUILD}="${CXXFLAGS_host}" \
|
||||
CFLAGS_${RUST_TARGET}="${CFLAGS}" \
|
||||
CXXFLAGS_${RUST_TARGET}="${CXXFLAGS}" \
|
||||
python3 x.py dist --jobs $XBPS_MAKEJOBS
|
||||
}
|
||||
|
||||
do_check() {
|
||||
|
|
Loading…
Add table
Reference in a new issue