rust: update to 1.38.0

This commit is contained in:
q66 2019-10-04 02:32:46 +02:00 committed by Johannes
parent 291f97e03a
commit aa6157e4a5
19 changed files with 518 additions and 258 deletions

View file

@ -1,17 +1,17 @@
From 59faa3f7b9b07d986bcd810d750daad956bd612b Mon Sep 17 00:00:00 2001
From 0a19456e2445def4cfe99dd02cf8292c1db5d4d4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 8 Sep 2017 00:04:29 -0500
Subject: [PATCH 02/12] Fix LLVM build
Subject: [PATCH 02/16] 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 ca4489655..7618a6e6d 100644
index 4d297fa918a..867df81d972 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -774,7 +774,8 @@ impl Build {
@@ -769,7 +769,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())
@ -22,5 +22,5 @@ index ca4489655..7618a6e6d 100644
// If we're compiling on macOS then we add a few unconditional flags
--
2.22.0
2.21.0

View file

@ -1,7 +1,7 @@
From 681f46ea92719a419c3dadbe3376062cc5bde8b8 Mon Sep 17 00:00:00 2001
From 2200debf48b6ef4c87e258cf8a968a89903f8723 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 2 Dec 2017 17:25:44 -0600
Subject: [PATCH 03/12] Allow rustdoc to work when cross-compiling on musl
Subject: [PATCH 03/16] 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 1c9f6e1ab..7e90be8d8 100644
index 1c9f6e1ab28..7e90be8d8cc 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -23,9 +23,6 @@ fn main() {
@ -41,5 +41,5 @@ index 1c9f6e1ab..7e90be8d8 100644
);
eprintln!("sysroot: {:?}", sysroot);
--
2.22.0
2.21.0

View file

@ -1,7 +1,7 @@
From b0de26f4cef75c63a7901990ed92fe0616a971fc Mon Sep 17 00:00:00 2001
From 10bd267ac2621267e1f537a5a7df34cb87354cd3 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 8 Sep 2017 00:05:18 -0500
Subject: [PATCH 04/12] Require static native libraries when linking static
Subject: [PATCH 04/16] 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 d5a56f6a0..bb06d80d8 100644
index e3d297e7862..974e8c0239b 100644
--- a/src/librustc_codegen_ssa/back/link.rs
+++ b/src/librustc_codegen_ssa/back/link.rs
@@ -1548,9 +1548,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(cmd: &mut dyn Linker,
@@ -1571,9 +1571,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(cmd: &mut dyn Linker,
}
}
@ -30,7 +30,7 @@ index d5a56f6a0..bb06d80d8 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.
@@ -1593,7 +1591,19 @@ pub fn add_upstream_native_libraries(cmd: &mut dyn Linker,
@@ -1616,7 +1614,19 @@ pub fn add_upstream_native_libraries(cmd: &mut dyn Linker,
continue
}
match lib.kind {
@ -52,5 +52,5 @@ index d5a56f6a0..bb06d80d8 100644
NativeLibraryKind::NativeStaticNobundle => {
// Link "static-nobundle" native libs only if the crate they originate from
--
2.22.0
2.21.0

View file

@ -1,7 +1,7 @@
From 9e646efacc9459f05bcefe9ad6d8e65dd06ba2d7 Mon Sep 17 00:00:00 2001
From e8ef432c23ea9fb70b28bea07042b33f1050569b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 8 Sep 2017 22:11:14 -0500
Subject: [PATCH 05/12] Remove -nostdlib and musl_root from musl targets
Subject: [PATCH 05/16] Remove -nostdlib and musl_root from musl targets
---
config.toml.example | 6 ----
@ -20,10 +20,10 @@ Subject: [PATCH 05/12] Remove -nostdlib and musl_root from musl targets
13 files changed, 4 insertions(+), 152 deletions(-)
diff --git a/config.toml.example b/config.toml.example
index 556625b53..3c6f18728 100644
index c14adf8ce33..8ec8d2bbbb7 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -474,12 +474,6 @@
@@ -479,12 +479,6 @@
# only use static libraries. If unset, the target's default linkage is used.
#crt-static = false
@ -37,10 +37,10 @@ index 556625b53..3c6f18728 100644
#wasi-root = "..."
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 821c37dc2..906af787f 100644
index 595deb07ec8..c077dc1581e 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -122,16 +122,6 @@ fn main() {
@@ -145,16 +145,6 @@ fn main() {
cmd.arg("-Cprefer-dynamic");
}
@ -58,7 +58,7 @@ index 821c37dc2..906af787f 100644
let mut root = OsString::from("native=");
root.push(&s);
diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
index dfc243b70..848d1d4b2 100644
index 400375cd201..0394ab7a8a7 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
@@ -84,7 +84,7 @@ pub fn find(build: &mut Build) {
@ -70,16 +70,16 @@ index dfc243b70..848d1d4b2 100644
}
let compiler = cfg.get_compiler();
@@ -113,7 +113,7 @@ pub fn find(build: &mut Build) {
if let Some(cxx) = config.and_then(|c| c.cxx.as_ref()) {
@@ -107,7 +107,7 @@ pub fn find(build: &mut Build) {
cfg.compiler(cxx);
true
} else if build.hosts.contains(&target) || build.build == target {
- set_compiler(&mut cfg, Language::CPlusPlus, target, config, build);
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config);
true
} else {
- set_compiler(&mut cfg, Language::CPlusPlus, host, config, build);
+ set_compiler(&mut cfg, Language::CPlusPlus, host, config);
}
let compiler = cfg.get_compiler();
build.verbose(&format!("CXX_{} = {:?}", host, compiler.path()));
@@ -124,8 +124,7 @@ pub fn find(build: &mut Build) {
false
@@ -134,8 +134,7 @@ pub fn find(build: &mut Build) {
fn set_compiler(cfg: &mut cc::Build,
compiler: Language,
target: Interned<String>,
@ -89,7 +89,7 @@ index dfc243b70..848d1d4b2 100644
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
@@ -165,26 +164,6 @@ fn set_compiler(cfg: &mut cc::Build,
@@ -175,26 +174,6 @@ fn set_compiler(cfg: &mut cc::Build,
}
}
@ -117,10 +117,10 @@ index dfc243b70..848d1d4b2 100644
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index e1cdd226f..05442c6c6 100644
index 576267e6948..8e5de3907f6 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -115,20 +115,7 @@ impl Step for Std {
@@ -116,20 +116,7 @@ impl Step for Std {
fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>) {
let libdir = builder.sysroot_libdir(*compiler, target);
@ -142,7 +142,7 @@ index e1cdd226f..05442c6c6 100644
for &obj in &["crt1.o"] {
builder.copy(
&builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj),
@@ -191,12 +178,6 @@ pub fn std_cargo(builder: &Builder<'_>,
@@ -219,12 +206,6 @@ pub fn std_cargo(builder: &Builder<'_>,
.arg("--manifest-path")
.arg(builder.src.join("src/libstd/Cargo.toml"));
@ -156,10 +156,10 @@ index e1cdd226f..05442c6c6 100644
if let Some(p) = builder.wasi_root(target) {
cargo.env("WASI_ROOT", p);
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index b1d009a67..cc567839f 100644
index 66f504ea924..5bb211501b1 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -135,8 +135,6 @@ pub struct Config {
@@ -133,8 +133,6 @@ pub struct Config {
pub print_step_timings: bool,
pub missing_tools: bool,
@ -168,7 +168,7 @@ index b1d009a67..cc567839f 100644
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
@@ -171,7 +169,6 @@ pub struct Target {
@@ -169,7 +167,6 @@ pub struct Target {
pub linker: Option<PathBuf>,
pub ndk: Option<PathBuf>,
pub crt_static: Option<bool>,
@ -176,15 +176,15 @@ index b1d009a67..cc567839f 100644
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
@@ -308,7 +305,6 @@ struct Rust {
@@ -307,7 +304,6 @@ struct Rust {
backtrace: Option<bool>,
default_linker: Option<String>,
channel: Option<String>,
- musl_root: Option<String>,
rpath: Option<bool>,
optimize_tests: Option<bool>,
debuginfo_tests: Option<bool>,
@@ -348,7 +344,6 @@ struct TomlTarget {
codegen_tests: Option<bool>,
@@ -346,7 +342,6 @@ struct TomlTarget {
linker: Option<String>,
android_ndk: Option<String>,
crt_static: Option<bool>,
@ -192,7 +192,7 @@ index b1d009a67..cc567839f 100644
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
}
@@ -568,7 +563,6 @@ impl Config {
@@ -569,7 +564,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();
@ -200,7 +200,7 @@ index b1d009a67..cc567839f 100644
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
@@ -611,7 +605,6 @@ impl Config {
@@ -607,7 +601,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();
@ -209,10 +209,10 @@ index b1d009a67..cc567839f 100644
target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from);
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index ade8afee7..f9ccf7aed 100755
index 907983d43ad..e91f6fcbe4b 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -111,28 +111,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
@@ -110,30 +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")
@ -230,7 +230,9 @@ index ade8afee7..f9ccf7aed 100755
- "arm-unknown-linux-musleabihf install directory")
-v("musl-root-armv5te", "target.armv5te-unknown-linux-musleabi.musl-root",
- "armv5te-unknown-linux-musleabi install directory")
-v("musl-root-armv7", "target.armv7-unknown-linux-musleabihf.musl-root",
-v("musl-root-armv7", "target.armv7-unknown-linux-musleabi.musl-root",
- "armv7-unknown-linux-musleabi install directory")
-v("musl-root-armv7hf", "target.armv7-unknown-linux-musleabihf.musl-root",
- "armv7-unknown-linux-musleabihf install directory")
-v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root",
- "aarch64-unknown-linux-musl install directory")
@ -242,10 +244,10 @@ index ade8afee7..f9ccf7aed 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 7618a6e6d..49cdb526e 100644
index 867df81d972..4fb57aa6db6 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -852,14 +852,6 @@ impl Build {
@@ -847,14 +847,6 @@ impl Build {
}
}
@ -261,7 +263,7 @@ index 7618a6e6d..49cdb526e 100644
fn wasi_root(&self, target: Interned<String>) -> Option<&Path> {
self.config.target_config.get(&target)
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index dc65fb9b7..060ba6d9e 100644
index dc65fb9b797..060ba6d9e42 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -176,34 +176,6 @@ pub fn check(build: &mut Build) {
@ -299,63 +301,8 @@ index dc65fb9b7..060ba6d9e 100644
if target.contains("msvc") {
// There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual
diff --git a/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile b/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
index ba2d32a92..412c37fdd 100644
--- a/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
+++ b/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
@@ -30,8 +30,6 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV RUST_CONFIGURE_ARGS \
- --musl-root-i586=/musl-i586 \
- --musl-root-i686=/musl-i686 \
--enable-extended \
--disable-docs
diff --git a/src/ci/docker/dist-various-1/Dockerfile b/src/ci/docker/dist-various-1/Dockerfile
index a722a4183..44e6728de 100644
--- a/src/ci/docker/dist-various-1/Dockerfile
+++ b/src/ci/docker/dist-various-1/Dockerfile
@@ -132,13 +132,6 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
ENV RUST_CONFIGURE_ARGS \
- --musl-root-armv5te=/musl-armv5te \
- --musl-root-arm=/musl-arm \
- --musl-root-armhf=/musl-armhf \
- --musl-root-armv7=/musl-armv7 \
- --musl-root-aarch64=/musl-aarch64 \
- --musl-root-mips=/musl-mips \
- --musl-root-mipsel=/musl-mipsel \
--enable-emscripten \
--disable-docs
diff --git a/src/ci/docker/dist-x86_64-musl/Dockerfile b/src/ci/docker/dist-x86_64-musl/Dockerfile
index 385eefde8..81d4f7737 100644
--- a/src/ci/docker/dist-x86_64-musl/Dockerfile
+++ b/src/ci/docker/dist-x86_64-musl/Dockerfile
@@ -31,7 +31,6 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=x86_64-unknown-linux-musl
ENV RUST_CONFIGURE_ARGS \
- --musl-root-x86_64=/usr/local/x86_64-linux-musl \
--enable-extended \
--disable-docs \
--set target.x86_64-unknown-linux-musl.crt-static=false \
diff --git a/src/ci/docker/test-various/Dockerfile b/src/ci/docker/test-various/Dockerfile
index 611a24a69..99c2b866b 100644
--- a/src/ci/docker/test-various/Dockerfile
+++ b/src/ci/docker/test-various/Dockerfile
@@ -31,7 +31,6 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV RUST_CONFIGURE_ARGS \
- --musl-root-x86_64=/usr/local/x86_64-linux-musl \
--set build.nodejs=/node-v9.2.0-linux-x64/bin/node \
--set rust.lld
diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
index e294e6398..58ae91a96 100644
index e294e63982d..58ae91a96aa 100644
--- a/src/librustc_target/spec/linux_musl_base.rs
+++ b/src/librustc_target/spec/linux_musl_base.rs
@@ -3,28 +3,12 @@ use crate::spec::{LinkerFlavor, TargetOptions};
@ -388,5 +335,5 @@ index e294e6398..58ae91a96 100644
base.crt_static_default = true;
// These targets allow the user to choose between static and dynamic linking.
--
2.22.0
2.21.0

View file

@ -1,17 +1,17 @@
From b8815ecb4ec9ecf7c2469703005bede91c0f6f82 Mon Sep 17 00:00:00 2001
From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 9 Sep 2017 00:14:16 -0500
Subject: [PATCH 06/12] Prefer libgcc_eh over libunwind for musl
Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl
---
src/libunwind/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
index 0ccffea31..935175dd8 100644
index 9182e349b19..0377fbb58fc 100644
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
@@ -26,6 +26,6 @@ cfg_if! {
@@ -23,6 +23,6 @@ cfg_if::cfg_if! {
}
#[cfg(target_env = "musl")]
@ -20,5 +20,5 @@ index 0ccffea31..935175dd8 100644
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
extern {}
--
2.22.0
2.21.0

View file

@ -0,0 +1,93 @@
From c9a914f48652de22832a40ef9639ff8d57c57f31 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 4 Sep 2019 20:40:18 -0500
Subject: [PATCH 07/16] Fix C aggregate-passing ABI on powerpc
The existing code (which looks like it was copied from MIPS) passes
aggregates by value in registers. This is wrong. According to the SVR4
powerpc psABI, all aggregates are passed indirectly.
---
src/librustc_target/abi/call/mod.rs | 2 +-
src/librustc_target/abi/call/powerpc.rs | 41 ++++++-------------------
2 files changed, 11 insertions(+), 32 deletions(-)
diff --git a/src/librustc_target/abi/call/mod.rs b/src/librustc_target/abi/call/mod.rs
index fbbd120f934..f4d98177072 100644
--- a/src/librustc_target/abi/call/mod.rs
+++ b/src/librustc_target/abi/call/mod.rs
@@ -562,7 +562,7 @@ impl<'a, Ty> FnType<'a, Ty> {
"arm" => arm::compute_abi_info(cx, self),
"mips" => mips::compute_abi_info(cx, self),
"mips64" => mips64::compute_abi_info(cx, self),
- "powerpc" => powerpc::compute_abi_info(cx, self),
+ "powerpc" => powerpc::compute_abi_info(self),
"powerpc64" => powerpc64::compute_abi_info(cx, self),
"s390x" => s390x::compute_abi_info(cx, self),
"asmjs" => asmjs::compute_abi_info(cx, self),
diff --git a/src/librustc_target/abi/call/powerpc.rs b/src/librustc_target/abi/call/powerpc.rs
index d496abf8e8b..f20defd6f5b 100644
--- a/src/librustc_target/abi/call/powerpc.rs
+++ b/src/librustc_target/abi/call/powerpc.rs
@@ -1,49 +1,28 @@
-use crate::abi::call::{ArgType, FnType, Reg, Uniform};
-use crate::abi::{HasDataLayout, LayoutOf, Size, TyLayoutMethods};
+use crate::abi::call::{ArgType, FnType};
-fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'_, Ty>, offset: &mut Size)
- where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
-{
- if !ret.layout.is_aggregate() {
- ret.extend_integer_width_to(32);
- } else {
+fn classify_ret_ty<Ty>(ret: &mut ArgType<'_, Ty>) {
+ if ret.layout.is_aggregate() {
ret.make_indirect();
- *offset += cx.data_layout().pointer_size;
+ } else {
+ ret.extend_integer_width_to(32);
}
}
-fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'_, Ty>, offset: &mut Size)
- where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
-{
- let dl = cx.data_layout();
- let size = arg.layout.size;
- let align = arg.layout.align.max(dl.i32_align).min(dl.i64_align).abi;
-
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
if arg.layout.is_aggregate() {
- arg.cast_to(Uniform {
- unit: Reg::i32(),
- total: size
- });
- if !offset.is_aligned(align) {
- arg.pad_with(Reg::i32());
- }
+ arg.make_indirect();
} else {
arg.extend_integer_width_to(32);
}
-
- *offset = offset.align_to(align) + size.align_to(align);
}
-pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'_, Ty>)
- where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
-{
- let mut offset = Size::ZERO;
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>) {
if !fty.ret.is_ignore() {
- classify_ret_ty(cx, &mut fty.ret, &mut offset);
+ classify_ret_ty(&mut fty.ret);
}
for arg in &mut fty.args {
if arg.is_ignore() { continue; }
- classify_arg_ty(cx, arg, &mut offset);
+ classify_arg_ty(arg);
}
}
--
2.21.0

View file

@ -1,39 +0,0 @@
From 0401335b6e3724d4868c9c4b556f586c7fcf60b8 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Jul 2019 17:49:18 +0200
Subject: [PATCH 07/12] runtest: Fix proc-macro tests on musl hosts
---
src/tools/compiletest/src/runtest.rs | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 2082de7cb..03c7a4c58 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1649,9 +1649,6 @@ impl<'test> TestCx<'test> {
(true, None)
} else if self.config.target.contains("cloudabi")
|| self.config.target.contains("emscripten")
- || (self.config.target.contains("musl")
- && !aux_props.force_host
- && !self.config.host.contains("musl"))
|| self.config.target.contains("wasm32")
|| self.config.target.contains("nvptx")
{
@@ -1660,10 +1657,8 @@ impl<'test> TestCx<'test> {
// for the test suite (otherwise including libstd statically in all
// executables takes up quite a bit of space).
//
- // For targets like MUSL or Emscripten, however, there is no support for
- // dynamic libraries so we just go back to building a normal library. Note,
- // however, that for MUSL if the library is built with `force_host` then
- // it's ok to be a dylib as the host should always support dylibs.
+ // For targets like Emscripten, however, there is no support for
+ // dynamic libraries so we just go back to building a normal library.
(false, Some("lib"))
} else {
(true, Some("dylib"))
--
2.22.0

View file

@ -0,0 +1,62 @@
From f67f0ab40f1328e04916512b9af858ca1b7faa24 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 4 Sep 2019 20:44:30 -0500
Subject: [PATCH 08/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 4af26e19b37..163db9778e5 100644
--- a/src/librustc/ty/layout.rs
+++ b/src/librustc/ty/layout.rs
@@ -2667,12 +2667,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,
@@ -2742,11 +2741,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(IgnoreMode::Zst);
}
}
--
2.21.0

View file

@ -0,0 +1,48 @@
From 0b28aa018f3f64913101495ce9806d356230856e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 2 Sep 2019 22:10:10 -0500
Subject: [PATCH 09/16] compiletest: Match suffixed environments
---
src/tools/compiletest/src/header.rs | 2 +-
src/tools/compiletest/src/util.rs | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 52f777db2da..4bf3c1a8527 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -820,10 +820,10 @@ impl Config {
if name == "test" ||
util::matches_os(&self.target, name) || // target
+ util::matches_env(&self.target, name) || // env
name == util::get_arch(&self.target) || // architecture
name == util::get_pointer_width(&self.target) || // pointer width
name == self.stage_id.split('-').next().unwrap() || // stage
- Some(name) == util::get_env(&self.target) || // env
(self.target != self.host && name == "cross-compile") ||
match self.compare_mode {
Some(CompareMode::Nll) => name == "compare-mode-nll",
diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs
index 8caf5ca00f5..d23f4edc55d 100644
--- a/src/tools/compiletest/src/util.rs
+++ b/src/tools/compiletest/src/util.rs
@@ -101,8 +101,12 @@ pub fn get_arch(triple: &str) -> &'static str {
panic!("Cannot determine Architecture from triple");
}
-pub fn get_env(triple: &str) -> Option<&str> {
- triple.split('-').nth(3)
+pub fn matches_env(triple: &str, name: &str) -> bool {
+ if let Some(env) = triple.split('-').nth(3) {
+ env.starts_with(name)
+ } else {
+ false
+ }
}
pub fn get_pointer_width(triple: &str) -> &'static str {
--
2.21.0

View file

@ -0,0 +1,73 @@
From e6a01c436377109808cac2d49ec30968a02b561d Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 2 Sep 2019 22:09:15 -0500
Subject: [PATCH 10/16] test/c-variadic: Fix patterns on powerpc64
---
src/test/codegen/c-variadic.rs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/test/codegen/c-variadic.rs b/src/test/codegen/c-variadic.rs
index bb90a9653f5..6ef77ca483f 100644
--- a/src/test/codegen/c-variadic.rs
+++ b/src/test/codegen/c-variadic.rs
@@ -14,13 +14,13 @@ extern "C" {
#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_0() {
// Ensure that we correctly call foreign C-variadic functions.
- // CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0)
+ // CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM:i32( signext)?]] 0)
foreign_c_variadic_0(0);
- // CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42)
+ // CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM]] 0, [[PARAM]] 42)
foreign_c_variadic_0(0, 42i32);
- // CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024)
+ // CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024)
foreign_c_variadic_0(0, 42i32, 1024i32);
- // CHECK: invoke void (i32, ...) @foreign_c_variadic_0(i32 0, i32 42, i32 1024, i32 0)
+ // CHECK: invoke void (i32, ...) @foreign_c_variadic_0([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024, [[PARAM]] 0)
foreign_c_variadic_0(0, 42i32, 1024i32, 0i32);
}
@@ -34,18 +34,18 @@ pub unsafe extern "C" fn use_foreign_c_variadic_1_0(ap: VaList) {
#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_1_1(ap: VaList) {
- // CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 42)
+ // CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, [[PARAM]] 42)
foreign_c_variadic_1(ap, 42i32);
}
#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_1_2(ap: VaList) {
- // CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 2, i32 42)
+ // CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, [[PARAM]] 2, [[PARAM]] 42)
foreign_c_variadic_1(ap, 2i32, 42i32);
}
#[unwind(aborts)] // FIXME(#58794)
pub unsafe extern "C" fn use_foreign_c_variadic_1_3(ap: VaList) {
- // CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, i32 2, i32 42, i32 0)
+ // CHECK: invoke void ({{.*}}*, ...) @foreign_c_variadic_1({{.*}} %ap, [[PARAM]] 2, [[PARAM]] 42, [[PARAM]] 0)
foreign_c_variadic_1(ap, 2i32, 42i32, 0i32);
}
@@ -64,12 +64,12 @@ pub unsafe extern "C" fn c_variadic(n: i32, mut ap: ...) -> i32 {
// Ensure that we generate the correct `call` signature when calling a Rust
// defined C-variadic.
pub unsafe fn test_c_variadic_call() {
- // CHECK: call i32 (i32, ...) @c_variadic(i32 0)
+ // CHECK: call [[RET:(signext )?i32]] (i32, ...) @c_variadic([[PARAM]] 0)
c_variadic(0);
- // CHECK: call i32 (i32, ...) @c_variadic(i32 0, i32 42)
+ // CHECK: call [[RET]] (i32, ...) @c_variadic([[PARAM]] 0, [[PARAM]] 42)
c_variadic(0, 42i32);
- // CHECK: call i32 (i32, ...) @c_variadic(i32 0, i32 42, i32 1024)
+ // CHECK: call [[RET]] (i32, ...) @c_variadic([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024)
c_variadic(0, 42i32, 1024i32);
- // CHECK: call i32 (i32, ...) @c_variadic(i32 0, i32 42, i32 1024, i32 0)
+ // CHECK: call [[RET]] (i32, ...) @c_variadic([[PARAM]] 0, [[PARAM]] 42, [[PARAM]] 1024, [[PARAM]] 0)
c_variadic(0, 42i32, 1024i32, 0i32);
}
--
2.21.0

View file

@ -1,14 +1,14 @@
From a10b846716f923b3c5c28fc86e9b07103600ed52 Mon Sep 17 00:00:00 2001
From f0fce1130ffe6b5a7666979aedd956becc4d7c25 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Jul 2019 17:50:54 +0200
Subject: [PATCH 08/12] test/use-extern-for-plugins: Don't assume multilib
Date: Sat, 6 Oct 2018 04:01:48 +0000
Subject: [PATCH 11/16] 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 838b1a271..94fa9f6d0 100644
index 838b1a2719b..94fa9f6d067 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 @@
@ -26,5 +26,5 @@ index 838b1a271..94fa9f6d0 100644
all:
$(RUSTC) foo.rs -C extra-filename=-host
--
2.22.0
2.21.0

View file

@ -1,7 +1,7 @@
From 9f457d208f0e916a5fb61401f6558e1302b97fd5 Mon Sep 17 00:00:00 2001
From 93835653d45142c17adcf3087d2a8e512053bccf Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 17 Sep 2018 01:32:20 +0000
Subject: [PATCH 09/12] test/sysroot-crates-are-unstable: Fix test when rpath
Subject: [PATCH 12/16] test/sysroot-crates-are-unstable: Fix test when rpath
is disabled
Without this environment var, the test can't run rustc to find
@ -11,7 +11,7 @@ the sysroot path.
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 a35174b3c..9e7707068 100644
index a35174b3c2a..9e770706857 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 @@
@ -21,5 +21,5 @@ index a35174b3c..9e7707068 100644
- python2.7 test.py
+ env '$(HOST_RPATH_ENV)' python2.7 test.py
--
2.22.0
2.21.0

View file

@ -1,7 +1,7 @@
From 8c4cc90bccacf5ebbb837e5c72de47ab862238f4 Mon Sep 17 00:00:00 2001
From 8eb87a7b794e649003bc8f4bed6c6d6739f65e43 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 16 Sep 2018 16:38:48 +0000
Subject: [PATCH 10/12] Ignore broken and non-applicable tests
Subject: [PATCH 13/16] 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)
@ -13,15 +13,16 @@ 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/linker-output-non-utf8/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/run-pass/env-funky-keys.rs | 1 +
src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs | 2 ++
src/test/run-pass/simd/simd-intrinsic-generic-select.rs | 2 ++
7 files changed, 12 insertions(+)
8 files changed, 14 insertions(+)
diff --git a/src/test/codegen/sparc-struct-abi.rs b/src/test/codegen/sparc-struct-abi.rs
index 78e5b14a2..6f93e9328 100644
index 78e5b14a212..6f93e93286b 100644
--- a/src/test/codegen/sparc-struct-abi.rs
+++ b/src/test/codegen/sparc-struct-abi.rs
@@ -4,6 +4,7 @@
@ -33,7 +34,7 @@ index 78e5b14a2..6f93e9328 100644
#![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 f124ca2ab..363b18f09 100644
index f124ca2ab61..363b18f0985 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 @@
@ -42,8 +43,21 @@ index f124ca2ab..363b18f09 100644
-include ../tools.mk
all:
diff --git a/src/test/run-make-fulldeps/linker-output-non-utf8/Makefile b/src/test/run-make-fulldeps/linker-output-non-utf8/Makefile
index b47ce17ec8b..59c44fcf438 100644
--- a/src/test/run-make-fulldeps/linker-output-non-utf8/Makefile
+++ b/src/test/run-make-fulldeps/linker-output-non-utf8/Makefile
@@ -13,6 +13,8 @@
# This also does not work on Apple APFS due to the filesystem requiring
# valid UTF-8 paths.
+# ignore-musl
+
# The zzz it to allow humans to tab complete or glob this thing.
bad_dir := $(TMPDIR)/zzz$$'\xff'
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 5876fbc94..5f167ece1 100644
index 5876fbc94bc..5f167ece1a2 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 @@
@ -53,7 +67,7 @@ index 5876fbc94..5f167ece1 100644
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 9e7707068..6d92ec5ce 100644
index 9e770706857..6d92ec5cec8 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 @@
@ -63,9 +77,9 @@ index 9e7707068..6d92ec5ce 100644
all:
diff --git a/src/test/run-pass/env-funky-keys.rs b/src/test/run-pass/env-funky-keys.rs
index 3b236e2b3..7284d25de 100644
--- a/src/test/run-pass/env-funky-keys.rs
+++ b/src/test/run-pass/env-funky-keys.rs
index 3b236e2b3af..7284d25de48 100644
--- a/src/test/ui/env-funky-keys.rs
+++ b/src/test/ui/env-funky-keys.rs
@@ -1,5 +1,6 @@
// Ignore this test on Android, because it segfaults there.
@ -74,9 +88,9 @@ index 3b236e2b3..7284d25de 100644
// ignore-windows
// ignore-cloudabi no execve
diff --git a/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs b/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs
index b28f742a9..3ee4ccce7 100644
--- a/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs
+++ b/src/test/run-pass/simd/simd-intrinsic-generic-bitmask.rs
index b28f742a92e..3ee4ccce731 100644
--- a/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs
+++ b/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs
@@ -2,6 +2,8 @@
#![allow(non_camel_case_types)]
@ -86,19 +100,6 @@ index b28f742a9..3ee4ccce7 100644
// Test that the simd_bitmask intrinsic produces correct results.
diff --git a/src/test/run-pass/simd/simd-intrinsic-generic-select.rs b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs
index f79b14049..39080c8c9 100644
--- a/src/test/run-pass/simd/simd-intrinsic-generic-select.rs
+++ b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs
@@ -2,6 +2,8 @@
#![allow(non_camel_case_types)]
// ignore-emscripten
+// ignore-powerpc
+// ignore-powerpc64
// Test that the simd_select intrinsics produces correct results.
--
2.22.0
2.21.0

View file

@ -1,17 +1,17 @@
From 7171338ff6f967b6f2c30bdb8804c8f49670a0de Mon Sep 17 00:00:00 2001
From 8e160daedd1a8c928024db648c2f851cddbbd000 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 24 Sep 2018 23:42:23 +0000
Subject: [PATCH 11/12] Link stage 2 tools dynamically to libstd
Subject: [PATCH 14/16] Link stage 2 tools dynamically to libstd
---
src/bootstrap/tool.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index edcd68d01..b5acf43bb 100644
index bd77f7a91d9..70477b44032 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -209,7 +209,9 @@ pub fn prepare_tool_cargo(
@@ -210,7 +210,9 @@ pub fn prepare_tool_cargo(
// We don't want to build tools dynamically as they'll be running across
// stages and such and it's just easier if they're not dynamically linked.
@ -23,5 +23,5 @@ index edcd68d01..b5acf43bb 100644
if source_type == SourceType::Submodule {
cargo.env("RUSTC_EXTERNAL_TOOL", "1");
--
2.22.0
2.21.0

View file

@ -1,7 +1,7 @@
From 6b0dc5093cc23c74dcf1d3bf3a0772b08426785a Mon Sep 17 00:00:00 2001
From 1d81148c7b7c048cb1c586ece96bd326ae0f72ec Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 17 Sep 2018 02:09:10 +0000
Subject: [PATCH 12/12] Move debugger scripts to /usr/share/rust
Subject: [PATCH 15/16] Move debugger scripts to /usr/share/rust
---
src/bootstrap/dist.rs | 2 +-
@ -10,10 +10,10 @@ Subject: [PATCH 12/12] 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 b0616ff66..7a1225a93 100644
index 45bc77ec97d..9e82352ef65 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -597,7 +597,7 @@ impl Step for DebuggerScripts {
@@ -593,7 +593,7 @@ impl Step for DebuggerScripts {
fn run(self, builder: &Builder<'_>) {
let host = self.host;
let sysroot = self.sysroot;
@ -23,7 +23,7 @@ index b0616ff66..7a1225a93 100644
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 23ba93da8..dc51b16c5 100755
index 23ba93da8e5..dc51b16c572 100755
--- a/src/etc/rust-gdb
+++ b/src/etc/rust-gdb
@@ -4,7 +4,7 @@ set -e
@ -36,7 +36,7 @@ index 23ba93da8..dc51b16c5 100755
# 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-lldb b/src/etc/rust-lldb
index 424302d49..460e11921 100755
index 0eb99423df5..f069300dafe 100755
--- a/src/etc/rust-lldb
+++ b/src/etc/rust-lldb
@@ -26,7 +26,7 @@ display the contents of local variables!"
@ -49,5 +49,5 @@ index 424302d49..460e11921 100755
category_enable="type category enable Rust"
--
2.22.0
2.21.0

View file

@ -1,16 +1,16 @@
--- rustc-1.36.0-src/vendor/libc/src/lib.rs
+++ rustc-1.36.0-src/vendor/libc/src/lib.rs
@@ -26,6 +26,7 @@
--- rustc-1.38.0-src/vendor/libc/src/lib.rs
+++ rustc-1.38.0-src/vendor/libc/src/lib.rs
@@ -27,6 +27,7 @@
#![deny(missing_copy_implementations, safe_packed_borrows)]
#![no_std]
#![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))]
#[macro_use]
mod macros;
--- rustc-1.36.0-src/vendor/libc/src/unix/mod.rs
+++ rustc-1.36.0-src/vendor/libc/src/unix/mod.rs
@@ -307,11 +307,11 @@ cfg_if! {
--- rustc-1.38.0-src/vendor/libc/src/unix/mod.rs
+++ rustc-1.38.0-src/vendor/libc/src/unix/mod.rs
@@ -297,11 +297,11 @@ cfg_if! {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
} else if #[cfg(target_env = "musl")] {

View file

@ -0,0 +1,71 @@
Rust 1.38 can't bootstrap itself. It has some ridiculous warnings enabled
by default which break this (even though the compiler obviously needs to
be able to compile itself just fine, that's what stage1 is all about).
diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs
index bd1a87c..138b7f4 100644
--- a/src/bootstrap/bin/main.rs
+++ b/src/bootstrap/bin/main.rs
@@ -5,9 +5,6 @@
//! parent directory, and otherwise documentation can be found throughout the `build`
//! directory in each respective module.
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
use std::env;
use bootstrap::{Config, Build};
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 81e7e46..d3d84ca 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -15,9 +15,6 @@
//! switching compilers for the bootstrap and for build scripts will probably
//! never get replaced.
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
use std::env;
use std::ffi::OsString;
use std::io;
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
index 184c9b1..2a8397a 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -2,9 +2,6 @@
//!
//! See comments in `src/bootstrap/rustc.rs` for more information.
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
use std::env;
use std::process::Command;
use std::path::PathBuf;
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 76cc0dd..5eeed7c 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -103,9 +103,6 @@
//! More documentation can be found in each respective module below, and you can
//! also check out the `src/bootstrap/README.md` file for more information.
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
#![feature(core_intrinsics)]
#![feature(drain_filter)]
diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs
index a1aa189..f3f5913 100644
--- a/src/build_helper/lib.rs
+++ b/src/build_helper/lib.rs
@@ -1,6 +1,3 @@
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
use std::fs::File;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

View file

@ -1,11 +0,0 @@
This allows lzma-sys to build in a cross-compiling environment.
--- rustc-1.36.0-src/vendor/lzma-sys/build.rs
+++ rustc-1.36.0-src/vendor/lzma-sys/build.rs
@@ -101,6 +101,7 @@ fn main() {
}
cmd.env("CC", compiler.path())
.env("CFLAGS", cflags)
+ .env("LDFLAGS", "")
.current_dir(&dst.join("build"))
.arg(sanitize_sh(&src.join("configure")));
cmd.arg(format!("--prefix={}", sanitize_sh(&dst)));

View file

@ -1,22 +1,23 @@
# Template file for 'rust'
# partially adapted from Alpine/Adélie's Rust APKBUILD
pkgname=rust
version=1.36.0
version=1.38.0
revision=1
_rust_dist_version=1.36.0
_cargo_dist_version=0.37.0
_rust_dist_version=1.38.0
_cargo_dist_version=0.39.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"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm"
# using llvm9 results in broken executables for some targets
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm8"
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=04c4e4d7213d036d6aaed392841496d272146312c0290f728b7400fccd15bb1b
checksum=644263ca7c7106f8ee8fcde6bb16910d246b30668a74be20b8c7e0e9f4a52d80
lib32disabled=yes
patch_args="-Np1"
@ -25,14 +26,15 @@ build_options="static_llvm"
_bootstrap_dir="stage0-bootstrap"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" cargo llvm"
hostmakedepends+=" cargo llvm8"
# These are required for building the buildhost's stage0/1
hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
else
_bootstrap_url="https://static.rust-lang.org/dist"
# 32-bit ppc needs custom bootstrap for now because of patches
case "$XBPS_MACHINE" in
x86_64*|i686|ppc64le|ppc) ;;
x86_64*|i686|ppc64le) ;;
ppc*) _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" ;;
*) broken="unsupported host: ${XBPS_MACHINE}" ;;
esac
@ -46,57 +48,57 @@ else
case "$XBPS_MACHINE" in
i686)
checksum+="
ad86a75cc8a02a0129df480ccb28082985215f4b5558a42881777691ae1d3ff3
a78f7bdbce0a960f3334c6c639cbe96f05b9b74df26cda9a5161834098119217
6835a73e2ce17e11eda5393133dd7c78bc41bae5a09784e5327648f14340fd48"
183dca6a4d746b833804e658267c1a60cdb446a36d4e4f8d29b04cfd29d886d5
a3248cf8cf7e33afb0a2508c7c204ffe5db2e515c3d3d31ffd9a2146ffa3bad3
2996b0fb41506e87d9b07851f40b41fed94725cf53c3d251e4e1c78eea08df4c"
;;
x86_64)
checksum+="
fff0158da6f5af2a89936dc3e0c361077c06c2983eb310615e02f81ebbde1416
ce8e12684b568a8a4f7d346a743383429849cf3f028f5712ad3d3e31590c8db3
d20fa121951339d5492cf8862f8a7af59efc99d18f3c27b95ab6d4658b6a7d67"
0fedde3406cf3367ceb00f493698e6bfc3264bd7f7253c85de7a042b45f873fa
51b334337804baeff7524e5496d396f254894d7529860d236975e9ed8fcca371
80bcb1368ce98d13cb371df89cbbed9007fb98843f34d07f2abd2c03b8f2747a"
;;
x86_64-musl)
checksum+="
04c15e34bdfd17136b924baa4f93cfbfe64739964b57f5a13ada8e91f9239076
70d0cc38cc829603c81812c59435ef85456a93962bea20deb12f0634e87fbaf7
53975d91e11569f2255d8e30176f05f6976cd810725197a527b0e7ad547ca70c"
9bc0b51bdfca3ed7b298021e2ec768bd28ea3af138d9dc1854a70e3866f06c0d
efcc1779f9815c1d99010ef9eb66a2439f3993bc4d5accd7566e669d1b182373
1d7d881a5af73fb7c3f632278d47a7d174f8347673e2263c4cd6a2f7d0278733"
;;
ppc64le)
checksum+="
702818334ed9f01f60a433aa424784ec9b3785826cdaf03b0f69d03aded98df6
db7a9a06b8b1b84d6fe10bc1e2e136234e31bfaa77499b9df36e2d441ef1b856
4cda7686160f6981e936229703e8e2e756c74f390245f2ad9e356bbbed28a2c9"
d7c011dae42ba4498493488385d3ab00d793124866baa8310cc6414b66c9d2d2
937d2ece46539ba149cdce307718dadbc4b038a3c751bd75749430bd421a6249
456d019511cfe015152a7a4c1c2f518fdeb10e0c610c9bc3ef44d73861ca967e"
;;
ppc64le-musl)
checksum+="
e04239f9c0f230249412ca814f2f954e269c9724fe5741d87f6dc76ddaa15251
98e8b4e6335bdb8cd387c8681686e20d9aa230bcf16ba0ea7cf3c1818d964425
d2690135522db9fdc6efa2f432e5719b8b70abc94e91db278b84be834a75bf72"
37420069fc877a430c32b8b5a533483fdb7cc1a28d0d9e0c1f0579a111aec888
f4b6f37b1f914a2ca086a7e806d7552275a20982b139670ecb2bc1be2d33df2f
5725c42c8356443db15f378d88f2ccb67e363ebf4beacc96ae1eac9ba36f8fe7"
;;
ppc64)
checksum+="
4328cd52d37df39b78c6223a7a6d07129ef9861efa67dbdadbcfe6c991e0febf
800f27805adef749219f9507497dbadebdac2d5c50f951ca1426d4d447e7f318
8b2f7d5da611a21dd7e0b4238b9aca6ee32f1e49d8fe831435301f11a29b12de"
7821de7c49e6c26606f2248f8cd126bef92661e149f0a67cc87f08e359685d4e
b4d2a800fef9ca53208d16c5d5e215b01849d2f34eb476fa9d05457adf1b67ae
73a4f13b8edda6b4c9c1818341c5d936f7b11a04f892358039d072b80ccd41dc"
;;
ppc64-musl)
checksum+="
7cef3f67652607e4f6ed09ff6eb54ee0a7485ae5491a2c015ef9357aadc40295
6f2dc455113a12b2f5fcefbda6e225ad568e750b8f900de5d326cf2c05e45ec9
131db0127366665b2ae55327155c171e99c2eddfb4bcdd7e5cd2663ada109bd5"
a607da72ea9ae81149d563e5e07c03bfc9fcf819ad079f5193f86fcab376315c
4f3b8f8d3e07b27096224131816668c7f34a2d80b5f2c0353905dcd878c50f12
ac18707b8df5d1f64b7e15dabd73eb7a3b0f9ef5976ef7c6ceb462b5d3feb9cd"
;;
ppc)
checksum+="
6c47ae44afc4567fd5584ff8f23c6d0ee1680e66b2ce91cc891571e973097a99
b22c7104c1bea83aef920140a25be974c3e08dd600431901346908916be46f43
856fcb63f6ebeab67038fe3fc96ee0911353b1ee19cabcb0496c7d419de0d531"
e4f088461db79b75c55210a1c70fd3127675287138196322a8416d078045468d
94a2a2fc17adec46daf913e0c71280f03c12048f5224e39c7a77c533a4582f08
02c07b741062e75556f5993a05eefe6dace70fee4a45542f1c6997fa69624d7e"
;;
ppc-musl)
checksum+="
181c81346bc75d6316d08efa242f49c3d3e70fa0c480e673c9bc7209c63ca6e6
4449b886359efe7fb39d75a086fc25520730f96932588e120abbf04387ac8aad
119dba3538f6c1d1164b720b238acac598e1924d943ebbdf3c7113ec3cbd8a2a"
80428db030216eea9117d131acdb1293404e78b71d26746dceeed3bb30629d32
ca6253605d6eafafa9c2fbf27504b3c5d3f8efcaab69852a22ae080c265f03a9
b06306fc164bffa73afd2d21d96381a28d38446e58cf01a0d1585e92b4656a23"
;;
esac
fi
@ -132,13 +134,12 @@ post_patch() {
# clear out all the checksum nonsense of patched vendor crates
_clear_vendor_checksums libc
_clear_vendor_checksums lzma-sys
_clear_vendor_checksums typenum
_clear_vendor_checksums backtrace-sys
}
do_configure() {
local _rust_root _local_rebuild _use_debug _use_rpath
local _rust_root _local_rebuild _use_debug _use_debug_rustc _use_rpath
if [ "$CROSS_BUILD" ]; then
_rust_root="/usr"
@ -148,12 +149,18 @@ do_configure() {
_local_rebuild="false"
fi
# emit debug info, enabled when generating debug packages
# 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="true"
_use_debug="2"
else
_use_debug="false"
_use_debug="0"
fi
# 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
@ -179,15 +186,23 @@ do_configure() {
prefix = "/usr"
[rust]
codegen-units = 1
debuginfo = ${_use_debug}
debuginfo-lines = ${_use_debug}
debuginfo-only-std = ${_use_debug}
debuginfo-tools = ${_use_debug}
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"
rpath = ${_use_rpath}
verbose-tests = true
dist-src = false
jemalloc = false
llvm-libunwind = false
codegen-tests = false
[dist]
src-tarball = false
[target.${RUST_BUILD}]
llvm-config = "/usr/bin/llvm-config"
crt-static = false