rust: update to 1.43.1, switch to llvm10

Also remove option static_llvm and add option bindist, which
helps simplify building bootstrap tarballs.
This commit is contained in:
q66 2020-05-03 18:12:41 +02:00 committed by Daniel Kolesa
parent a89f74c80d
commit 2cab55965b
21 changed files with 302 additions and 276 deletions

View file

@ -1,26 +1,26 @@
From b10e30c5f8a71f0efd871d0e5114f44d04a879fe Mon Sep 17 00:00:00 2001
From 4443eca0d6b3ba599832b2f73a5350fdd0c90d10 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 8 Sep 2017 00:04:29 -0500
Subject: [PATCH 01/16] Fix LLVM build
Subject: [PATCH 01/15] Fix LLVM build
---
src/bootstrap/lib.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 080bef68..e9b7976d 100644
index a476d25f..c7e63990 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -752,7 +752,8 @@ impl Build {
// cc-rs because the build scripts will determine that for themselves.
let mut base = self.cc[&target].args().iter()
.map(|s| s.to_string_lossy().into_owned())
- .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
+ .filter(|s| !s.starts_with("-O") && !s.starts_with("/O")
+ && !s.starts_with("-static"))
.collect::<Vec<String>>();
@@ -768,7 +768,8 @@ impl Build {
.args()
.iter()
.map(|s| s.to_string_lossy().into_owned())
- .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
+ .filter(|s| !s.starts_with("-O") && !s.starts_with("/O")
+ && !s.starts_with("-static"))
.collect::<Vec<String>>();
// If we're compiling on macOS then we add a few unconditional flags
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From c4c6747beb14cc96e7ce9d88018cef42533155df Mon Sep 17 00:00:00 2001
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/16] Allow rustdoc to work when cross-compiling on musl
Subject: [PATCH 02/15] Allow rustdoc to work when cross-compiling on musl
musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
---
@ -9,7 +9,7 @@ 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 6937fb92..ce787609 100644
index 04345867..8156d5ec 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -22,9 +22,6 @@ fn main() {
@ -22,16 +22,16 @@ index 6937fb92..ce787609 100644
//FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox`
//arguments here
let mut cmd = Command::new(rustdoc);
@@ -36,7 +33,7 @@ fn main() {
@@ -35,7 +32,7 @@ fn main() {
.arg("dox")
.arg("--sysroot")
.arg(&sysroot)
.env(bootstrap::util::dylib_path_var(),
- env::join_paths(&dylib_path).unwrap());
+ PathBuf::from(libdir.clone()));
- .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
@@ -87,7 +84,7 @@ fn main() {
@@ -83,7 +80,7 @@ fn main() {
eprintln!(
"rustdoc command: {:?}={:?} {:?}",
bootstrap::util::dylib_path_var(),
@ -41,5 +41,5 @@ index 6937fb92..ce787609 100644
);
eprintln!("sysroot: {:?}", sysroot);
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From 33aff948106db1150cc7c1f457e74c4dbf95f74a Mon Sep 17 00:00:00 2001
From baa7ce46f19e3584d70e47c8df28c084e76446da Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 8 Sep 2017 00:05:18 -0500
Subject: [PATCH 03/16] Require static native libraries when linking static
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
@ -16,10 +16,10 @@ Fixes #54243
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 a2b50ea8..3250ec4d 100644
index 0dd2f029..f22b4277 100644
--- a/src/librustc_codegen_ssa/back/link.rs
+++ b/src/librustc_codegen_ssa/back/link.rs
@@ -1610,9 +1610,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
@@ -1741,9 +1741,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
}
}
@ -30,8 +30,8 @@ index a2b50ea8..3250ec4d 100644
//
// 1. The upstream crate is an rlib. In this case we *must* link in the
// native dependency because the rlib is just an archive.
@@ -1659,7 +1657,19 @@ pub fn add_upstream_native_libraries(
continue
@@ -1792,7 +1790,19 @@ pub fn add_upstream_native_libraries(
continue;
}
match lib.kind {
- NativeLibraryKind::NativeUnknown => cmd.link_dylib(name),
@ -52,5 +52,5 @@ index a2b50ea8..3250ec4d 100644
NativeLibraryKind::NativeStaticNobundle => {
// Link "static-nobundle" native libs only if the crate they originate from
--
2.25.0
2.26.2

View file

@ -1,24 +1,24 @@
From 06b84a9e3d7514ac23953ad76242710444d2a0c1 Mon Sep 17 00:00:00 2001
From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 21 Dec 2019 16:46:22 +0100
Subject: [PATCH 04/16] Remove -nostdlib and musl_root from musl targets
Date: Sun, 3 May 2020 17:53:33 +0200
Subject: [PATCH 04/15] Remove -nostdlib and musl_root from musl targets
---
config.toml.example | 3 ---
src/bootstrap/cc_detect.rs | 27 +++-----------------
src/bootstrap/cc_detect.rs | 25 ++----------------
src/bootstrap/compile.rs | 22 +---------------
src/bootstrap/config.rs | 7 ------
src/bootstrap/configure.py | 28 ---------------------
src/bootstrap/lib.rs | 8 ------
src/bootstrap/sanity.rs | 24 ------------------
src/bootstrap/lib.rs | 10 --------
src/bootstrap/sanity.rs | 22 ----------------
src/librustc_target/spec/linux_musl_base.rs | 16 ------------
8 files changed, 4 insertions(+), 131 deletions(-)
8 files changed, 3 insertions(+), 130 deletions(-)
diff --git a/config.toml.example b/config.toml.example
index 5152a6c9..1d411c5c 100644
index ce21b634..f14a5660 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -340,9 +340,6 @@
@@ -352,9 +352,6 @@
# nightly features
#channel = "dev"
@ -29,10 +29,10 @@ index 5152a6c9..1d411c5c 100644
# 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 a4cb81d3..b4247e74 100644
index a236edf9..54c3cc64 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
@@ -86,7 +86,7 @@ pub fn find(build: &mut Build) {
@@ -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 {
@ -41,7 +41,7 @@ index a4cb81d3..b4247e74 100644
}
let compiler = cfg.get_compiler();
@@ -109,7 +109,7 @@ pub fn find(build: &mut Build) {
@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
@ -50,17 +50,15 @@ index a4cb81d3..b4247e74 100644
true
} else {
false
@@ -136,8 +136,7 @@ pub fn find(build: &mut Build) {
fn set_compiler(cfg: &mut cc::Build,
compiler: Language,
target: Interned<String>,
- config: Option<&Target>,
- build: &Build) {
+ config: Option<&Target>) {
@@ -154,7 +154,6 @@ fn set_compiler(
compiler: Language,
target: Interned<String>,
config: Option<&Target>,
- build: &Build,
) {
match &*target {
// When compiling for android we may have the NDK configured in the
// config.toml in which case we look there. Otherwise the default
@@ -177,26 +176,6 @@ fn set_compiler(cfg: &mut cc::Build,
@@ -196,26 +195,6 @@ fn set_compiler(
}
}
@ -88,10 +86,10 @@ index a4cb81d3..b4247e74 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 831053bc..3e49d459 100644
index 65a00db3..01fd2cf3 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -130,18 +130,7 @@ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target:
@@ -125,18 +125,7 @@ fn copy_third_party_objects(
target_deps.push(target);
};
@ -111,7 +109,7 @@ index 831053bc..3e49d459 100644
let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");
copy_and_stamp(&srcdir, "crt1.o");
}
@@ -227,15 +216,6 @@ pub fn std_cargo(builder: &Builder<'_>,
@@ -213,15 +202,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: Interned<String>, cargo: &mut Ca
.arg("--manifest-path")
.arg(builder.src.join("src/libtest/Cargo.toml"));
@ -128,10 +126,10 @@ index 831053bc..3e49d459 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 5f2ef01b..c291d3a0 100644
index 56164b74..8c46334a 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -130,8 +130,6 @@ pub struct Config {
@@ -134,8 +134,6 @@ pub struct Config {
pub print_step_timings: bool,
pub missing_tools: bool,
@ -140,7 +138,7 @@ index 5f2ef01b..c291d3a0 100644
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
@@ -166,7 +164,6 @@ pub struct Target {
@@ -171,7 +169,6 @@ pub struct Target {
pub linker: Option<PathBuf>,
pub ndk: Option<PathBuf>,
pub crt_static: Option<bool>,
@ -148,7 +146,7 @@ index 5f2ef01b..c291d3a0 100644
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
@@ -306,7 +303,6 @@ struct Rust {
@@ -322,7 +319,6 @@ struct Rust {
parallel_compiler: Option<bool>,
default_linker: Option<String>,
channel: Option<String>,
@ -156,15 +154,15 @@ index 5f2ef01b..c291d3a0 100644
rpath: Option<bool>,
verbose_tests: Option<bool>,
optimize_tests: Option<bool>,
@@ -340,7 +336,6 @@ struct TomlTarget {
@@ -359,7 +355,6 @@ struct TomlTarget {
llvm_filecheck: Option<String>,
android_ndk: Option<String>,
crt_static: Option<bool>,
- musl_root: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
}
@@ -559,7 +554,6 @@ impl Config {
no_std: Option<bool>,
@@ -585,7 +580,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.clone();
@ -172,19 +170,19 @@ index 5f2ef01b..c291d3a0 100644
config.save_toolstates = rust.save_toolstates.clone().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);
@@ -595,7 +589,6 @@ impl Config {
@@ -625,7 +619,6 @@ impl Config {
target.ranlib = cfg.ranlib.clone().map(PathBuf::from);
target.linker = cfg.linker.clone().map(PathBuf::from);
target.crt_static = cfg.crt_static.clone();
target.crt_static = cfg.crt_static;
- target.musl_root = cfg.musl_root.clone().map(PathBuf::from);
target.wasi_root = cfg.wasi_root.clone().map(PathBuf::from);
target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from);
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index bb6041d7..73f3781c 100755
index 2a46c563..025928b9 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",
@@ -110,34 +110,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")
@ -220,29 +218,31 @@ index bb6041d7..73f3781c 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 e9b7976d..c4203e83 100644
index c7e63990..77bbb2cd 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -827,14 +827,6 @@ impl Build {
@@ -845,16 +845,6 @@ impl Build {
}
}
- /// Returns the "musl root" for this `target`, if defined
- fn musl_root(&self, target: Interned<String>) -> Option<&Path> {
- self.config.target_config.get(&target)
- self.config
- .target_config
- .get(&target)
- .and_then(|t| t.musl_root.as_ref())
- .or(self.config.musl_root.as_ref())
- .or_else(|| self.config.musl_root.as_ref())
- .map(|p| &**p)
- }
-
/// Returns the sysroot for the wasi target, if defined
fn wasi_root(&self, target: Interned<String>) -> Option<&Path> {
self.config.target_config.get(&target)
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 bffe748f..3b109548 100644
index 530e74da..8ec9f046 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -187,30 +187,6 @@ pub fn check(build: &mut Build) {
@@ -201,28 +201,6 @@ pub fn check(build: &mut Build) {
}
}
@ -251,22 +251,20 @@ index bffe748f..3b109548 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.clone()).or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_root(*target) {
- Some(root) => {
- if fs::metadata(root.join("lib/libc.a")).is_err() {
- panic!("couldn't find libc.a in musl dir: {}",
- root.join("lib").display());
- panic!("couldn't find libc.a in musl dir: {}", root.join("lib").display());
- }
- }
- None => {
- panic!("when targeting MUSL either the rust.musl-root \
- None => panic!(
- "when targeting MUSL either the rust.musl-root \
- option or the target.$TARGET.musl-root option must \
- be specified in config.toml")
- }
- be specified in config.toml"
- ),
- }
- }
-
@ -307,5 +305,5 @@ index e294e639..58ae91a9 100644
base.crt_static_default = true;
// These targets allow the user to choose between static and dynamic linking.
--
2.25.0
2.26.2

View file

@ -1,25 +1,24 @@
From 6c6ccb3928deffd97a75ef2d9417aae467cd7031 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 21 Dec 2019 16:49:07 +0100
Subject: [PATCH 05/16] Prefer libgcc_eh over libunwind for musl
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
+ @q66 changes to smaeul's original patch for Void's musl setup
---
src/libunwind/build.rs | 17 ++---------------
src/libunwind/build.rs | 16 ++--------------
src/libunwind/lib.rs | 2 +-
2 files changed, 3 insertions(+), 16 deletions(-)
2 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index b8db16f8..0c69b9d2 100644
index a24808b3..a1250889 100644
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -5,15 +5,11 @@ fn main() {
@@ -5,15 +5,12 @@ fn main() {
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")) {
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("linux") {
@ -31,7 +30,7 @@ index b8db16f8..0c69b9d2 100644
println!("cargo:rustc-link-lib=gcc_s");
}
} else if target.contains("freebsd") {
@@ -105,15 +101,6 @@ mod llvm_libunwind {
@@ -105,15 +102,6 @@ mod llvm_libunwind {
cfg.file(root.join("src").join(src));
}
@ -48,18 +47,18 @@ index b8db16f8..0c69b9d2 100644
}
}
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
index 8d916447..6d653d41 100644
index 18d41be7..17f73d69 100644
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
@@ -21,7 +21,7 @@ cfg_if::cfg_if! {
@@ -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 {}
extern "C" {}
--
2.25.0
2.26.2

View file

@ -1,62 +0,0 @@
From d54189d6441d59ba623b561438e3ce0664ab2101 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 21 Dec 2019 16:55:07 +0100
Subject: [PATCH 06/16] Fix zero-sized aggregate ABI on powerpc
For targets that pass zero-sized aggregates indirectly (generally
those that pass all aggregates indirectly), we must allocate a register
for passing the address of the ZST. Clean up the existing cases and add
powerpc, which requires this as well.
While there are not currently musl targets for s390x or sparc64, they
would have the same ABI as gnu targets, so remove the env == "gnu" check
in the Linux case.
Ideally, since it is a property of the C ABI, the `!rust_abi` case would
be handled entirely in `adjust_c_abi`. However, that would require
updating each implementation of `compute_abi_info` to handle ZSTs.
---
src/librustc/ty/layout.rs | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs
index c7278dc4..2e5ea499 100644
--- a/src/librustc/ty/layout.rs
+++ b/src/librustc/ty/layout.rs
@@ -2576,12 +2576,11 @@ where
};
let target = &cx.tcx().sess.target.target;
- let win_x64_gnu =
- target.target_os == "windows" && target.arch == "x86_64" && target.target_env == "gnu";
- let linux_s390x =
- target.target_os == "linux" && target.arch == "s390x" && target.target_env == "gnu";
- let linux_sparc64 =
- target.target_os == "linux" && target.arch == "sparc64" && target.target_env == "gnu";
+ let indirect_zst = match target.arch.as_ref() {
+ "powerpc" | "s390x" | "sparc64" => true,
+ "x86_64" => target.target_os == "windows" && target.target_env == "gnu",
+ _ => false,
+ };
let rust_abi = match sig.abi {
RustIntrinsic | PlatformIntrinsic | Rust | RustCall => true,
_ => false,
@@ -2650,11 +2649,10 @@ where
let is_return = arg_idx.is_none();
let mut arg = mk_arg_type(ty, arg_idx);
if arg.layout.is_zst() {
- // For some forsaken reason, x86_64-pc-windows-gnu
- // doesn't ignore zero-sized struct arguments.
- // The same is true for s390x-unknown-linux-gnu
- // and sparc64-unknown-linux-gnu.
- if is_return || rust_abi || (!win_x64_gnu && !linux_s390x && !linux_sparc64) {
+ // FIXME: The C ABI case should be handled in adjust_for_cabi.
+ // Zero-sized struct arguments cannot be ignored in the C ABI
+ // if they are passed indirectly.
+ if is_return || rust_abi || !indirect_zst {
arg.mode = PassMode::Ignore;
}
}
--
2.25.0

View file

@ -1,7 +1,7 @@
From 07274f2e91b0d91102dcb5397783295d7a27b8b2 Mon Sep 17 00:00:00 2001
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 07/16] test/use-extern-for-plugins: Don't assume multilib
Subject: [PATCH 06/15] test/use-extern-for-plugins: Don't assume multilib
---
src/test/run-make-fulldeps/use-extern-for-plugins/Makefile | 7 +------
@ -26,5 +26,5 @@ index 838b1a27..94fa9f6d 100644
all:
$(RUSTC) foo.rs -C extra-filename=-host
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From d1ac85fbff21dc1d808308cc6f5a90b0cc562f2f Mon Sep 17 00:00:00 2001
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 08/16] test/sysroot-crates-are-unstable: Fix test when rpath
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
@ -21,5 +21,5 @@ index a35174b3..9e770706 100644
- python2.7 test.py
+ env '$(HOST_RPATH_ENV)' python2.7 test.py
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From 6cbefd6ad105c833052919319db3564966572ceb Mon Sep 17 00:00:00 2001
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 09/16] Ignore broken and non-applicable tests
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)
@ -62,7 +62,7 @@ index 9e770706..6d92ec5c 100644
all:
diff --git a/src/test/ui/env-funky-keys.rs b/src/test/ui/env-funky-keys.rs
index 4faceb53..09764dc3 100644
index c5c824ac..f3fe047a 100644
--- a/src/test/ui/env-funky-keys.rs
+++ b/src/test/ui/env-funky-keys.rs
@@ -1,6 +1,7 @@
@ -87,5 +87,5 @@ index b28f742a..3ee4ccce 100644
// Test that the simd_bitmask intrinsic produces correct results.
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From cdb82589b4be62c11186e4645a5fd358f5c55421 Mon Sep 17 00:00:00 2001
From f5dad49f112151bb0ee74570e971bd475cbec128 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 21 Dec 2019 17:01:59 +0100
Subject: [PATCH 10/16] Link stage2 tools dynamically to libstd
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.
@ -14,10 +14,10 @@ be statically linked for convenience.
1 file changed, 2 insertions(+)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 8b0ad169..4bc13ac2 100644
index eb0199fd..0ec7cbd8 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1228,6 +1228,8 @@ impl<'a> Builder<'a> {
@@ -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");
@ -25,7 +25,7 @@ index 8b0ad169..4bc13ac2 100644
+ rustflags.arg("-Cprefer-dynamic");
}
Cargo {
// When building incrementally we default to a lower ThinLTO import limit
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From be61ad716d24f7fb0ee52b234cbf922d09bc686a Mon Sep 17 00:00:00 2001
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 11/16] Move debugger scripts to /usr/share/rust
Subject: [PATCH 10/15] Move debugger scripts to /usr/share/rust
---
src/bootstrap/dist.rs | 2 +-
@ -10,10 +10,10 @@ Subject: [PATCH 11/16] Move debugger scripts to /usr/share/rust
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 02533944..375f2413 100644
index 8215211e..05a173b4 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -593,7 +593,7 @@ impl Step for DebuggerScripts {
@@ -603,7 +603,7 @@ impl Step for DebuggerScripts {
fn run(self, builder: &Builder<'_>) {
let host = self.host;
let sysroot = self.sysroot;
@ -49,5 +49,5 @@ index 7b9b40e6..e471db36 100755
category_enable="type category enable Rust"
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From f277b9c07cd6d096fad370a76c6dfdfb03aa3d1e Mon Sep 17 00:00:00 2001
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 12/16] Dynamically link libc on musl by default
Subject: [PATCH 11/15] Dynamically link libc on musl by default
---
src/librustc_target/spec/linux_musl_base.rs | 3 +--
@ -22,5 +22,5 @@ index 58ae91a9..1fae72d6 100644
base.crt_static_respected = true;
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From 191b56a4e8c307e531a446f8cceb4ecc732beace Mon Sep 17 00:00:00 2001
From e363a0e0ff7ffc8bd83f72ec1a20d289996b6370 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 21 Dec 2019 17:04:55 +0100
Subject: [PATCH 13/16] Fix dynamic linkage of musl libc for the libc crate
Date: Sun, 3 May 2020 18:02:03 +0200
Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate
---
vendor/libc/src/lib.rs | 1 +
@ -9,7 +9,7 @@ Subject: [PATCH 13/16] 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 3255303e..bfbd2d7a 100644
index 0b1496af..7f7e85a7 100644
--- a/vendor/libc/src/lib.rs
+++ b/vendor/libc/src/lib.rs
@@ -33,6 +33,7 @@
@ -18,8 +18,8 @@ index 3255303e..bfbd2d7a 100644
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
+#![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
@ -40,5 +40,5 @@ index 238da24b..ffb05ee7 100644
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
--
2.25.0
2.26.2

View file

@ -1,7 +1,7 @@
From a5843bb05ebd94b8acaa7a011c1db7abdc112e5c Mon Sep 17 00:00:00 2001
From d74af8923022dd369315ada0a06e467dffd127cf Mon Sep 17 00:00:00 2001
From: Michael Hudson-Doyle <michael.hudson@canonical.com>
Date: Wed, 13 Mar 2019 15:55:30 +1300
Subject: [PATCH 14/16] round result of (highest as f64).log(2.0)
Subject: [PATCH 13/15] round result of (highest as f64).log(2.0)
Even though (1024f64).log(2.0) has an exact, representable, value, with
rustc 1.32 on i386 it comes out as +9.999999999999999985 with
@ -25,5 +25,5 @@ index 9c9f237c..153031a2 100644
let uints = (0..(highest + 1))
.chain((first2..64).map(|i| 2u64.pow(i)))
--
2.25.0
2.26.2

View file

@ -0,0 +1,31 @@
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/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
index 9b4f03b3..d0167838 100644
--- a/src/librustc_llvm/build.rs
+++ b/src/librustc_llvm/build.rs
@@ -217,9 +217,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));
+ 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));
+ println!("cargo:rustc-link-search=native={}{}",
+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
}
} else if lib.starts_with("-LIBPATH:") {
println!("cargo:rustc-link-search=native={}", &lib[9..]);
--
2.26.2

View file

@ -1,36 +1,43 @@
From 923d16b37c381d73ce0f88403256b26af3edf1bd Mon Sep 17 00:00:00 2001
From c6b54a373e74a1e4ce64f349b5b69105f2bc1a49 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 21 Dec 2019 17:06:55 +0100
Subject: [PATCH 16/16] Use ELFv2 ABI on all powerpc64 targets
Date: Sun, 3 May 2020 18:08:09 +0200
Subject: [PATCH 15/15] Use ELFv2 ABI on all powerpc64 targets
This patches librustc_target so that ELFv2 is used everywhere, matching our
LLVM. While this is not perfect (it does not allow rustc to compile legacy
binaries), rustc never requests specific ABI from llvm in the first place,
so at least match the environment we have.
---
src/librustc_target/abi/call/powerpc64.rs | 2 +-
src/librustc_target/abi/call/powerpc64.rs | 9 +--------
src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +-----
2 files changed, 2 insertions(+), 6 deletions(-)
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 fe459480..997593b9 100644
index 93c4e97d..96b02486 100644
--- a/src/librustc_target/abi/call/powerpc64.rs
+++ b/src/librustc_target/abi/call/powerpc64.rs
@@ -117,7 +117,7 @@ pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
where Ty: TyLayoutMethods<'a, C> + Copy,
C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec
@@ -119,14 +119,7 @@ where
Ty: TyLayoutMethods<'a, C> + Copy,
C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec,
{
- let abi = if cx.target_spec().target_env == "musl" {
+ let abi = if cx.target_spec().target_env == "musl" || cx.target_spec().target_env == "gnu" {
ELFv2
} else {
match cx.data_layout().endian {
- ELFv2
- } else {
- match cx.data_layout().endian {
- Endian::Big => ELFv1,
- Endian::Little => ELFv2,
- }
- };
+ let abi = ELFv2;
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 89e68ab3..77659cdd 100644
index 5306d905..c63eed85 100644
--- a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
+++ b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
@@ -1,4 +1,4 @@
-use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult, RelroLevel};
-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
@ -47,5 +54,5 @@ index 89e68ab3..77659cdd 100644
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
target_endian: "big".to_string(),
--
2.25.0
2.26.2

View file

@ -1,28 +0,0 @@
From e83770856411e2ff780551143fc6c26a8552741e Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 21 Dec 2019 17:06:17 +0100
Subject: [PATCH 15/16] Void: fix linkage against host/target LLVM in cross
setups
---
src/librustc_llvm/build.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
index c5d5f066..91799142 100644
--- a/src/librustc_llvm/build.rs
+++ b/src/librustc_llvm/build.rs
@@ -225,8 +225,8 @@ fn main() {
println!("cargo:rustc-link-search=native={}", &lib[9..]);
} else if is_crossed {
if lib.starts_with("-L") {
- println!("cargo:rustc-link-search=native={}",
- lib[2..].replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
}
} else if lib.starts_with("-l") {
println!("cargo:rustc-link-lib={}", &lib[2..]);
--
2.25.0

View file

@ -0,0 +1,28 @@
Upstream: Yes
From 497f879b1e24c369362bcd821959ffabc50a8a31 Mon Sep 17 00:00:00 2001
From: Nikita Popov <nikita.ppv@gmail.com>
Date: Mon, 2 Mar 2020 22:37:55 +0100
Subject: [PATCH] Update CreateMemSet() usage for LLVM 10
---
src/rustllvm/RustWrapper.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 25cfee3373dc4..799adb418822d 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B,
LLVMValueRef Dst, unsigned DstAlign,
LLVMValueRef Val,
LLVMValueRef Size, bool IsVolatile) {
+#if LLVM_VERSION_GE(10, 0)
+ return wrap(unwrap(B)->CreateMemSet(
+ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile));
+#else
return wrap(unwrap(B)->CreateMemSet(
unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
+#endif
}
extern "C" LLVMValueRef

View file

@ -0,0 +1,28 @@
Reason: Fixes LLVM10
Upstream: Yes
From a94fa896cc92d5e0678376cf5aa8b64af0899732 Mon Sep 17 00:00:00 2001
From: Nikita Popov <nikita.ppv@gmail.com>
Date: Tue, 4 Feb 2020 20:35:50 +0100
Subject: [PATCH] Fix timeTraceProfilerInitialize for LLVM 10
---
src/rustllvm/PassWrapper.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 90d24d20737db..9e8614e3b6d34 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() {
}
extern "C" void LLVMTimeTraceProfilerInitialize() {
-#if LLVM_VERSION_GE(9, 0)
+#if LLVM_VERSION_GE(10, 0)
+ timeTraceProfilerInitialize(
+ /* TimeTraceGranularity */ 0,
+ /* ProcName */ "rustc");
+#elif LLVM_VERSION_GE(9, 0)
timeTraceProfilerInitialize();
#endif
}

View file

@ -0,0 +1,11 @@
--- rustc-1.41.0-src/src/libstd/build.rs.orig 2020-02-08 17:05:40.390387794 +0200
+++ rustc-1.41.0-src/src/libstd/build.rs 2020-02-08 17:09:46.844426452 +0200
@@ -11,6 +11,8 @@
println!("cargo:rustc-link-lib=dl");
println!("cargo:rustc-link-lib=rt");
println!("cargo:rustc-link-lib=pthread");
+ } else {
+ println!("cargo:rustc-link-lib=ssp_nonshared");
}
} else if target.contains("freebsd") {
println!("cargo:rustc-link-lib=execinfo");

View file

@ -4,31 +4,32 @@
# Permission to use rust and cargo trademark is granted.
# See: https://github.com/rust-lang/core-team/issues/4
pkgname=rust
version=1.41.1
revision=2
_rust_dist_version=1.40.0
_cargo_dist_version=0.41.0
version=1.43.1
revision=1
_rust_dist_version=1.43.1
_cargo_dist_version=0.44.0
# Always make sure custom distfiles used for bootstrap are
# uploaded to https://alpha.de.repo.voidlinux.org/distfiles/
wrksrc="rustc-${version}-src"
hostmakedepends="cmake curl pkg-config python3 tar"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm9"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm10"
depends="rust-std"
short_desc="Safe, concurrent, practical systems language"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
checksum=38c93d016e6d3e083aa15e8f65511d3b4983072c0218a529f5ee94dd1de84573
checksum=cde177b4a8c687da96f20de27630a1eb55c9d146a15e4c900d5c31cd3c3ac41d
lib32disabled=yes
patch_args="-Np1"
build_options="static_llvm"
build_options="bindist"
desc_option_bindist="Generate tarballs for bootstrap"
_bootstrap_dir="stage0-bootstrap"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" cargo llvm9"
hostmakedepends+=" cargo llvm10"
# These are required for building the buildhost's stage0/1
hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
else
@ -50,57 +51,57 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
257e4789043098a5e3b4fa85ea988019f37d640a10f83d39ada00fb23e057b8a
beab29565d12a6b9db4ef471c34d4c034295760095f7edc3f7b6c51fc08589a0
c48bc132f4025ff39b1b6dc52aef9d406c3f926ce05fe92d943ceab7a5fd6058"
b415a406443cafa85e426d56d02fb52231b8d78ad1fec33b79b757d8ef4ed64c
9913d3e21efc13445e3b71f6e1103c63b130544e1f28a99a0bb642276ebca985
c7b4045b2001be2e97b0b08dfaee02097aea0e8a9983b42585d733cfa1e69683"
;;
x86_64)
checksum+="
b1c00618b7a98156e88b14682508a503284f85748eab23de749a20dcc8847111
5a0b14a51f51b0194f70a2023749d9cb49c3b2e11f0d4c8232960b91fad336ac
9b6ae643fa240c5ecbc1dc390f4020b6a683f25bac6f7437ebd4b9d32a8d0b6c"
a18b89572ff2e55eb9e0428efcdb60eacd82fe28c4d825d169b0ffc9e3c55ceb
dabc62db53c2e7ffeba2824d4c52a938486b04c01a93ecba00c5d529868f6cfc
84ba23058542691dae8157beec6a7679a420643eb6a708134bb1dfb01cbdebea"
;;
x86_64-musl)
checksum+="
769b9e31557fcc0ea2a661f88b679d3dbd62b537807c7b3c75ac6816a1be4fa3
c647bb7f399b3d18e345b2dab1fb073470582a9298e83d8648f6661544df7279
848646326474392bdac70a5bfa06efda4c36e2bbbf088f07456f98c7575844e1"
be982dc01b5c86a3f2b0b99a2ca0e13b3cea698ee6f1db9fa024de5c8b35a75d
f3b55147ff6e01448699eaf0875d7956ea38eeef42a19cda9d555e814470e823
653cb60214d6f1000c9a7775111dccd093c0118e7f7bf5f2f1f53a7e5e2420b3"
;;
ppc64le)
checksum+="
aa07a07ad272de825da8c18ad8dc4143a25bd28e5538d68c3bced53f060432b4
4eb3141fb6c3d3e101b5d4493664c9a01d4bb9eebdf4b96f5c26a81188c2452d
7705f21d938a72ba6f01818661b2dea29183209940a335f18d1761e1e03d3710"
8fd21a9eac7e27a5f7af9d9357455d1ff5aef01d84b4025a773caaae6e0a6db7
235bdaf836a0bd139257d6cc0566e0c3d4d1e07c04304ed9a8d200299aaa4a48
4f90cd6cbcf9e9d6ba11830e093092e4e6c3d156ffde2e729933869b7a039ff9"
;;
ppc64le-musl)
checksum+="
2c8ffeaa23d8ae0e1776af068bd92ba5cd15973696956a2b58c215a940721e67
c40f696c8afdcaafec50ddc29b9d8c836efa01b681e8ca48d09fcf79576ee039
0fbe481d284a14b84cc63ccb50caeb248200f238d2c3e449c2b8a8bf49c951ce"
2c32096c0f1b3a756cc29d6ecaf89296148a7a99d43baa0141bee490b353b502
fa87695bdede026b031010716fafbe2890cbff00acc3042fd372dd7cc5eb46a7
a85e8c9714a8bb7c17cd23993c677f51d9e0d6f5e85ab10f53ec1639b19bbbd4"
;;
ppc64)
checksum+="
0f4d02f2d21d8f4b23829502130c89599f2315bb9adcee4f1b5109ee68a187ab
8edd65b1f53485caa134d1625131e76f7ca072366cc5df3e2761a39f52f7e83f
23a7967b0c1c762cdbea4f850cacbb462e386977203c0d5ff060275c526d80d7"
4aa250cd14553ae3a438cd7a7290a79b899d1fbec9fc60985bbce070b500883e
2cd6e88be42db44338c18fa6e3170ffea679ee73825826112cdbf6dd9ed0619a
983e2fbec9c4bfe66bab37ad64cdd5b47918378e421d9bf639e938f120650199"
;;
ppc64-musl)
checksum+="
4645a4bb0d78da07c8dba1edc2769382a94dc3d8fbdd48e105a5c8dd20170e21
0dbf82f8c24140f17fda36811861c9c3aa361f2256c5274a11eb4a1f183c7f3a
d5a808fdb50068a14d6578f052c9e21ae7881d4ecdcf9e098c5e2c2b1ae65786"
f3c4fb775e63248914fece31199312dd2f69660f10b696ebbc56d41d4bc4ac2c
c3d580c71e5a716056347513588d4445bdb8225e2ee5d9f2cf87c5bb4357bcb1
f974893d1cac6c799345bece08c7f796eb50e1a77c4b9bc2a6451d161a57c660"
;;
ppc)
checksum+="
40121c3a6ec199338e7139e03e917a93290b7623334740d4d25cd1c8092f3de1
c2b17cfe8b25d23b348b40e5802a4e369f691abe6ddbd4372df0d660eb100398
295030192cf5b7e1fce75845a1961619a5f701185400ad816cf950d4e18f0646"
109d6af5d05cfbde5a476d07cf8b3093a974b0c76922bf8cd1046c5e11f5caaa
a90152808c82f863f3c14647ebfbb6ae66d065ea4577be1036f6dc229c1e7e89
48f4419300fe758ebe024e6449a5ca1dff07803047a815b3d3909170baa7adcc"
;;
ppc-musl)
checksum+="
c5b743370ce140e95d413b20734d26ac22697b99455262cef801883f5c732019
8061486273c602ac29c3e98aaa3a6d1114d16b9973e051f127e922232fef2270
91cc5d6f0192f68d5053fb460dd8347b28cb29b4a63a6e648d6b754795b5c4e8"
3d5211d6c5cf241b3d3dba343c027d05ff04765e2dd4175168095a86e7c9de22
04a5cdb4f18ccae3eb9059c84adf7a7778484e89c8404ba67cde814019ec5b57
bbb93a757e75d09cb5f6d6dd837e32212acd8888426406352eccf52f329386f1"
;;
esac
fi
@ -127,7 +128,7 @@ _clear_vendor_checksums() {
post_patch() {
rm -rf src/llvm-project
if [ "$build_option_static_llvm" ]; then
if [ "$build_option_bindist" ]; then
for x in ${FILESDIR}/patches/static-llvm/*.patch; do
msg_normal "Applying patch $x\n"
patch -sNp1 -i ${x}
@ -167,7 +168,11 @@ do_configure() {
# 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
# packaging but is useful when building bootstrap binaries
_use_rpath="false"
if [ "$build_option_bindist" ]; then
_use_rpath="true"
else
_use_rpath="false"
fi
cat > config.toml <<- EOF
[build]
@ -232,7 +237,7 @@ 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_static_llvm" ]; then
if [ ! "$build_option_bindist" ]; then
export LLVM_LINK_SHARED=1
fi
export RUST_BACKTRACE=1
@ -268,6 +273,15 @@ do_check() {
}
do_install() {
if [ "$build_option_bindist" ]; then
mkdir -p ${XBPS_SRCDISTDIR}/distfiles
install -m 0644 \
build/dist/rustc-${version}-${RUST_TARGET}.tar.xz \
build/dist/rust-std-${version}-${RUST_TARGET}.tar.xz \
${XBPS_SRCDISTDIR}/distfiles
exit 1
fi
vmkdir usr
tar xf build/dist/rustc-${version}-${RUST_TARGET}.tar.gz \
-C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in