From af802e87d4f99565b98d6c55d59519f79a1180b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 16 Apr 2021 03:34:16 -0300 Subject: [PATCH] rust: update to 1.53.0. - rebase patches - fix type of 'llvm-unwind' in config.toml - move linux_musl_base stuff to a single patch which makes it behave just line linux_gnu_base - copy new version of need-ssp_nonshared.patch from alpine - temporary workaround for the new rust-llvm-dwp binary: it's copied from the llvm toolchain and shoved into /usr/lib, but they copied the binary from the build machine - fix do_check (thanks cinerea0) - preliminary ppcle patches (q66) --- ...to-work-when-cross-compiling-on-musl.patch | 8 +- ...ative-libraries-when-linking-static-.patch | 21 +- ...dlib-and-musl_root-from-musl-targets.patch | 216 ++++--- ...fer-libgcc_eh-over-libunwind-on-musl.patch | 59 +- ...mically-link-libc-on-musl-by-default.patch | 26 - ...kage-of-musl-libc-for-the-libc-crate.patch | 12 +- ...-against-host-target-LLVM-in-cross-s.patch | 22 +- ...e-ELFv2-ABI-on-all-powerpc64-targets.patch | 31 +- srcpkgs/rust/patches/fix-ppc32.patch | 23 + .../need-ssp-nonshared-and-execinfo.patch | 13 + srcpkgs/rust/patches/need-ssp_nonshared.patch | 23 - srcpkgs/rust/patches/xxx-ppcle-ccrs.patch | 29 + srcpkgs/rust/patches/xxx-ppcle-gcc.patch | 25 + srcpkgs/rust/patches/xxx-ppcle.patch | 601 ++++++++++++++++++ srcpkgs/rust/template | 94 +-- 15 files changed, 937 insertions(+), 266 deletions(-) delete mode 100644 srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch create mode 100644 srcpkgs/rust/patches/fix-ppc32.patch create mode 100644 srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch delete mode 100644 srcpkgs/rust/patches/need-ssp_nonshared.patch create mode 100644 srcpkgs/rust/patches/xxx-ppcle-ccrs.patch create mode 100644 srcpkgs/rust/patches/xxx-ppcle-gcc.patch create mode 100644 srcpkgs/rust/patches/xxx-ppcle.patch diff --git a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch index 7687c35ce8..f72bd0e68a 100644 --- a/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch +++ b/srcpkgs/rust/patches/0002-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch @@ -9,19 +9,19 @@ musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH. 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs -index 04345867..8156d5ec 100644 +index cba17c8e6..45cbdd81b 100644 --- a/src/bootstrap/bin/rustdoc.rs +++ b/src/bootstrap/bin/rustdoc.rs -@@ -22,9 +22,6 @@ fn main() { +@@ -20,9 +20,6 @@ fn main() { Err(_) => 0, }; - let mut dylib_path = bootstrap::util::dylib_path(); - dylib_path.insert(0, PathBuf::from(libdir.clone())); - - //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox` - //arguments here let mut cmd = Command::new(rustdoc); + cmd.args(&args) + .arg("--sysroot") @@ -35,7 +32,7 @@ fn main() { .arg("dox") .arg("--sysroot") diff --git a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch b/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch index 1f345ca146..0fd1ca7d2d 100644 --- a/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch +++ b/srcpkgs/rust/patches/0003-Require-static-native-libraries-when-linking-static-.patch @@ -15,21 +15,20 @@ Fixes #54243 src/librustc_codegen_ssa/back/link.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs -index 0dd2f029..f22b4277 100644 +diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs +index 8bc4e6442..52ff7a52e 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -1964,9 +1964,7 @@ +@@ -2081,8 +2081,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>( } } --// Link in all of our upstream crates' native dependencies. Remember that --// all of these upstream native dependencies are all non-static --// dependencies. We've got two cases then: -+// Link in all of our upstream crates' native dependencies. We have two cases: - // - // 1. The upstream crate is an rlib. In this case we *must* link in the - // native dependency because the rlib is just an archive. +-/// Link in all of our upstream crates' native dependencies. Remember that all of these upstream +-/// native dependencies are all non-static dependencies. We've got two cases then: ++/// Link in all of our upstream crates' native dependencies. We have two cases: + /// + /// 1. The upstream crate is an rlib. In this case we *must* link in the native dependency because + /// the rlib is just an archive. @@ -2015,7 +2013,19 @@ continue; } @@ -41,7 +40,7 @@ index 0dd2f029..f22b4277 100644 + // an upstream rlib was originally linked against a native shared library. + if crate_type == config::CrateType::Executable + && sess.crt_static(Some(crate_type)) -+ && !sess.target.target.options.crt_static_allows_dylibs ++ && !sess.target.options.crt_static_allows_dylibs + { + cmd.link_staticlib(name) + } else { diff --git a/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch b/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch index 326ed1a4ed..85a8806e01 100644 --- a/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch +++ b/srcpkgs/rust/patches/0004-Remove-nostdlib-and-musl_root-from-musl-targets.patch @@ -1,42 +1,82 @@ -From 4654172e942b5b9250aff70101d54bc880060073 Mon Sep 17 00:00:00 2001 -From: Samuel Holland -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 | 25 ++---------------- - src/bootstrap/compile.rs | 22 +--------------- - src/bootstrap/config.rs | 7 ------ - src/bootstrap/configure.py | 28 --------------------- - src/bootstrap/lib.rs | 10 -------- - src/bootstrap/sanity.rs | 22 ---------------- - src/librustc_target/spec/linux_musl_base.rs | 16 ------------ - 8 files changed, 3 insertions(+), 130 deletions(-) - +diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs +index 2fc9ab29f..276736159 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 { + ]) + } + +-pub(super) fn pre_musl_fallback() -> CrtObjects { +- new(&[ +- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]), +- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]), +- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]), +- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]), +- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]), +- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]), +- ]) +-} +- +-pub(super) fn post_musl_fallback() -> CrtObjects { +- new(&[ +- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]), +- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]), +- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]), +- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]), +- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]), +- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]), +- ]) +-} +- + pub(super) fn pre_mingw_fallback() -> CrtObjects { + new(&[ + (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]), +diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs +index 5038a967d..b3c0e5bc4 100644 +--- a/compiler/rustc_target/src/spec/linux_musl_base.rs ++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs +@@ -1,16 +1,9 @@ +-use crate::spec::crt_objects::{self, CrtObjectsFallback}; + use crate::spec::TargetOptions; + + pub fn opts() -> TargetOptions { + let mut base = super::linux_base::opts(); + + base.env = "musl".to_string(); +- base.pre_link_objects_fallback = crt_objects::pre_musl_fallback(); +- base.post_link_objects_fallback = crt_objects::post_musl_fallback(); +- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl); +- +- // These targets statically link libc by default +- base.crt_static_default = true; + + base + } +diff --git a/config.toml.example b/config.toml.example +index 6e5584797..5be9882a8 100644 --- a/config.toml.example +++ b/config.toml.example -@@ -525,15 +525,6 @@ +@@ -638,15 +638,6 @@ changelog-seen = 2 # only use static libraries. If unset, the target's default linkage is used. - #crt-static = false + #crt-static = (bool) -# The root location of the musl installation directory. The library directory -# will also need to contain libunwind.a for an unwinding implementation. Note -# that this option only makes sense for musl targets that produce statically --# linked binaries --#musl-root = "..." +-# linked binaries. +-#musl-root = build.musl-root (path) - -# The full path to the musl libdir. -#musl-libdir = musl-root/lib - - # The root location of the `wasm32-wasi` sysroot. - #wasi-root = "..." - + # The root location of the `wasm32-wasi` sysroot. Only used for the + # `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 a236edf9..54c3cc64 100644 +index e750c2963..f6ba3032b 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs -@@ -97,7 +97,7 @@ pub fn find(build: &mut Build) { +@@ -98,7 +98,7 @@ pub fn find(build: &mut Build) { if let Some(cc) = config.and_then(|c| c.cc.as_ref()) { cfg.compiler(cc); } else { @@ -45,7 +85,7 @@ index a236edf9..54c3cc64 100644 } let compiler = cfg.get_compiler(); -@@ -125,7 +125,7 @@ pub fn find(build: &mut Build) { +@@ -126,7 +126,7 @@ pub fn find(build: &mut Build) { cfg.compiler(cxx); true } else if build.hosts.contains(&target) || build.build == target { @@ -53,16 +93,16 @@ index a236edf9..54c3cc64 100644 + set_compiler(&mut cfg, Language::CPlusPlus, target, config); true } else { - false -@@ -154,7 +154,6 @@ fn set_compiler( + // Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars). +@@ -157,7 +157,6 @@ fn set_compiler( compiler: Language, - target: Interned, + target: TargetSelection, config: Option<&Target>, - build: &Build, ) { - match &*target { + match &*target.triple { // When compiling for android we may have the NDK configured in the -@@ -196,26 +195,6 @@ fn set_compiler( +@@ -200,26 +199,6 @@ fn set_compiler( } } @@ -90,14 +130,13 @@ index a236edf9..54c3cc64 100644 } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs -index 65a00db3..01fd2cf3 100644 +index ee3527b6b..0a8b78327 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs -@@ -169,26 +169,7 @@ - t!(fs::create_dir_all(&libdir_self_contained)); +@@ -179,34 +179,7 @@ fn copy_self_contained_objects( let mut target_deps = vec![]; -- // Copies the CRT 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 @@ -105,7 +144,9 @@ index 65a00db3..01fd2cf3 100644 - // To do that we have to distribute musl startup objects as a part of Rust toolchain - // and link with them manually in the self-contained mode. - if target.contains("musl") { -- let srcdir = builder.musl_libdir(target).unwrap(); +- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| { +- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple) +- }); - for &obj in &["crt1.o", "Scrt1.o", "rcrt1.o", "crti.o", "crtn.o"] { - copy_and_stamp( - builder, @@ -116,14 +157,21 @@ index 65a00db3..01fd2cf3 100644 - DependencyType::TargetSelfContained, - ); - } +- let crt_path = builder.ensure(native::CrtBeginEnd { target }); +- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] { +- let src = crt_path.join(obj); +- let target = libdir_self_contained.join(obj); +- builder.copy(&src, &target); +- target_deps.push((target, DependencyType::TargetSelfContained)); +- } - } else if target.ends_with("-wasi") { + if target.ends_with("-wasi") { - let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi"); - copy_and_stamp( - builder, -@@ -263,15 +244,6 @@ + let srcdir = builder + .wasi_root(target) + .unwrap_or_else(|| { +@@ -288,15 +261,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car .arg("--manifest-path") - .arg(builder.src.join("src/libtest/Cargo.toml")); + .arg(builder.src.join("library/test/Cargo.toml")); - // Help the libc crate compile by assisting it in finding various - // sysroot native libraries. @@ -138,45 +186,44 @@ index 65a00db3..01fd2cf3 100644 if let Some(p) = builder.wasi_root(target) { let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap()); diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs -index 56164b74..8c46334a 100644 +index 483816b98..7517d757c 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs -@@ -154,8 +154,6 @@ - pub print_step_timings: bool, +@@ -165,7 +165,6 @@ pub struct Config { pub missing_tools: bool, - -- // Fallback musl-root for all targets + + // Fallback musl-root for all targets - pub musl_root: Option, pub prefix: Option, pub sysconfdir: Option, pub datadir: Option, -@@ -252,8 +250,6 @@ - pub linker: Option, - pub ndk: Option, +@@ -291,8 +290,6 @@ pub struct Target { + pub sanitizers: Option, + pub profiler: Option, pub crt_static: Option, - pub musl_root: Option, - pub musl_libdir: Option, pub wasi_root: Option, pub qemu_rootfs: Option, pub no_std: bool, -@@ -438,7 +434,6 @@ - parallel_compiler: Option, +@@ -481,7 +478,6 @@ struct Rust { default_linker: Option, channel: Option, + description: Option, - musl_root: Option, rpath: Option, verbose_tests: Option, optimize_tests: Option, -@@ -475,8 +470,6 @@ - llvm_filecheck: Option, - android_ndk: Option, +@@ -524,8 +520,6 @@ struct TomlTarget { + sanitizers: Option, + profiler: Option, crt_static: Option, - musl_root: Option, - musl_libdir: Option, wasi_root: Option, qemu_rootfs: Option, no_std: Option, -@@ -806,7 +799,6 @@ +@@ -846,7 +840,6 @@ impl Config { set(&mut config.llvm_tools_enabled, rust.llvm_tools); config.rustc_parallel = rust.parallel_compiler.unwrap_or(false); config.rustc_default_linker = rust.default_linker; @@ -184,7 +231,7 @@ index 56164b74..8c46334a 100644 config.save_toolstates = rust.save_toolstates.map(PathBuf::from); set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings)); set(&mut config.backtrace_on_ice, rust.backtrace_on_ice); -@@ -846,8 +838,6 @@ +@@ -892,8 +885,6 @@ impl Config { target.ranlib = cfg.ranlib.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from); target.crt_static = cfg.crt_static; @@ -192,12 +239,12 @@ index 56164b74..8c46334a 100644 - target.musl_libdir = cfg.musl_libdir.map(PathBuf::from); target.wasi_root = cfg.wasi_root.map(PathBuf::from); target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from); - + target.sanitizers = cfg.sanitizers; diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py -index 2a46c563..025928b9 100755 +index 999882a1c..7ccc2b73c 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py -@@ -110,34 +110,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk", +@@ -109,34 +109,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") @@ -232,9 +279,11 @@ index 2a46c563..025928b9 100755 v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs", "rootfs in qemu testing, you probably don't want to use this") v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs", +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 24da44b93..c08bc6d94 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs -@@ -876,25 +876,6 @@ +@@ -927,25 +927,6 @@ impl Build { } } @@ -261,10 +310,10 @@ index 2a46c563..025928b9 100755 fn wasi_root(&self, target: TargetSelection) -> Option<&Path> { self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs -index 530e74da..8ec9f046 100644 +index ed0cbdf97..44937aed9 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs -@@ -191,28 +191,6 @@ +@@ -182,28 +182,6 @@ pub fn check(build: &mut Build) { } } @@ -273,7 +322,7 @@ index 530e74da..8ec9f046 100644 - // If this is a native target (host is also musl) and no musl-root is given, - // fall back to the system toolchain in /usr before giving up - if build.musl_root(*target).is_none() && build.config.build == *target { -- let target = build.config.target_config.entry(target.clone()).or_default(); +- let target = build.config.target_config.entry(*target).or_default(); - target.musl_root = Some("/usr".into()); - } - match build.musl_libdir(*target) { @@ -293,44 +342,3 @@ index 530e74da..8ec9f046 100644 if target.contains("msvc") { // There are three builds of cmake on windows: MSVC, MinGW, and // Cygwin. The Cygwin build does not have generators for Visual -diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs -index e294e639..58ae91a9 100644 ---- a/compiler/rustc_target/src/spec/linux_musl_base.rs -+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs -@@ -10,10 +10,6 @@ - // argument is *not* necessary for normal builds, but it can't hurt! - base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".to_string()); - -- base.pre_link_objects_fallback = crt_objects::pre_musl_fallback(); -- base.post_link_objects_fallback = crt_objects::post_musl_fallback(); -- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl); -- - // These targets statically link libc by default - base.crt_static_default = true; - // These targets allow the user to choose between static and dynamic linking. ---- a/compiler/rustc_target/src/spec/crt_objects.rs.orig 2020-08-07 01:01:58.142394507 +0200 -+++ b/compiler/rustc_target/src/spec/crt_objects.rs 2020-08-07 01:02:25.030392771 +0200 -@@ -61,21 +61,6 @@ - ]) - } - --pub(super) fn pre_musl_fallback() -> CrtObjects { -- new(&[ -- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o"]), -- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o"]), -- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o"]), -- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o"]), -- (LinkOutputKind::DynamicDylib, &["crti.o"]), -- (LinkOutputKind::StaticDylib, &["crti.o"]), -- ]) --} -- --pub(super) fn post_musl_fallback() -> CrtObjects { -- all("crtn.o") --} -- - pub(super) fn pre_mingw_fallback() -> CrtObjects { - new(&[ - (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]), --- -2.26.2 diff --git a/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch index 6571cb3c22..58ffd07769 100644 --- a/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch +++ b/srcpkgs/rust/patches/0005-Prefer-libgcc_eh-over-libunwind-on-musl.patch @@ -1,18 +1,31 @@ -From a640bce17d908a0691d53f22e5257353f694d9b6 Mon Sep 17 00:00:00 2001 -From: q66 -Date: Sun, 3 May 2020 17:55:50 +0200 -Subject: [PATCH 05/15] Prefer libgcc_eh over libunwind on musl +Additions for build.rs by q66, necessary for our musl setup. + +From 1eb558f246269606c6d8d73824ef6b44fa10764e Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Sat, 9 Sep 2017 00:14:16 -0500 +Subject: [PATCH 06/16] Prefer libgcc_eh over libunwind for musl --- - src/libunwind/build.rs | 16 ++-------------- - src/libunwind/lib.rs | 2 +- - 2 files changed, 3 insertions(+), 15 deletions(-) + src/libunwind/lib.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs +index 9182e349b19..0377fbb58fc 100644 +--- a/library/unwind/src/lib.rs ++++ b/library/unwind/src/lib.rs +@@ -23,6 +23,6 @@ cfg_if::cfg_if! { + } + + #[cfg(target_env = "musl")] +-#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] ++#[link(name = "gcc_eh", cfg(target_feature = "crt-static"))] + #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] + extern {} diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs -index a24808b3..a1250889 100644 +index f24d957..28828e5 100644 --- a/library/unwind/build.rs +++ b/library/unwind/build.rs -@@ -5,17 +5,14 @@ +@@ -5,17 +5,12 @@ let target = env::var("TARGET").expect("TARGET was not set"); if cfg!(feature = "llvm-libunwind") @@ -23,16 +36,15 @@ index a24808b3..a1250889 100644 llvm_libunwind::compile(); } else if target.contains("x86_64-fortanix-unknown-sgx") { llvm_libunwind::compile(); - } else if target.contains("linux") { +- } else if target.contains("linux") { +- // linking for Linux is handled in lib.rs - if target.contains("musl") { -- // linking for musl is handled in lib.rs - llvm_libunwind::compile(); -- } else if !target.contains("android") { -+ if !target.contains("android") { - println!("cargo:rustc-link-lib=gcc_s"); - } +- } } else if target.contains("freebsd") { -@@ -145,15 +142,6 @@ + println!("cargo:rustc-link-lib=gcc_s"); + } else if target.contains("rumprun") { +@@ -143,15 +138,6 @@ cfg.file(root.join("src").join(src)); } @@ -48,19 +60,4 @@ index a24808b3..a1250889 100644 cfg.compile("unwind"); } } -diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs -index 18d41be7..17f73d69 100644 ---- a/library/unwind/src/lib.rs -+++ b/library/unwind/src/lib.rs -@@ -19,7 +19,7 @@ cfg_if::cfg_if! { - } - - #[cfg(target_env = "musl")] --#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] -+#[link(name = "gcc_eh", cfg(target_feature = "crt-static"))] - #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] - extern "C" {} - --- -2.26.2 diff --git a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch b/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch deleted file mode 100644 index 7f6ca13a95..0000000000 --- a/srcpkgs/rust/patches/0011-Dynamically-link-libc-on-musl-by-default.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d72ad9c226b4ed225c23d88ec5dbe6ba321b37ad Mon Sep 17 00:00:00 2001 -From: q66 -Date: Sat, 21 Dec 2019 17:04:13 +0100 -Subject: [PATCH 11/15] Dynamically link libc on musl by default - ---- - src/librustc_target/spec/linux_musl_base.rs | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs -index 58ae91a9..1fae72d6 100644 ---- a/compiler/rustc_target/src/spec/linux_musl_base.rs -+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs -@@ -1,11 +1,9 @@ --use crate::spec::crt_objects::{self, CrtObjectsFallback}; - use crate::spec::TargetOptions; - - pub fn opts() -> TargetOptions { - let mut base = super::linux_base::opts(); - -- // These targets statically link libc by default -- base.crt_static_default = true; -+ base.crt_static_default = false; - // These targets allow the user to choose between static and dynamic linking. - base.crt_static_respected = true; - diff --git a/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch b/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch index e4d4f145b6..3378ee3617 100644 --- a/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch +++ b/srcpkgs/rust/patches/0012-Fix-dynamic-linkage-of-musl-libc-for-the-libc-crate.patch @@ -9,17 +9,21 @@ Subject: [PATCH 12/15] Fix dynamic linkage of musl libc for the libc crate 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vendor/libc/src/lib.rs b/vendor/libc/src/lib.rs -index 0b1496af..7f7e85a7 100644 +index 6bb71c552..22060a8d7 100644 --- a/vendor/libc/src/lib.rs +++ b/vendor/libc/src/lib.rs -@@ -33,6 +33,7 @@ +@@ -24,10 +24,7 @@ #![deny(missing_copy_implementations, safe_packed_borrows)] - #![no_std] + #![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)] #![cfg_attr(feature = "rustc-dep-of-std", no_core)] +-#![cfg_attr( +- any(feature = "rustc-dep-of-std", target_os = "redox"), +- feature(static_nobundle) +-)] +#![cfg_attr(feature = "rustc-dep-of-std", feature(static_nobundle))] - #![cfg_attr(target_os = "redox", feature(static_nobundle))] #![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))] + #[macro_use] diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs index 238da24b..ffb05ee7 100644 --- a/vendor/libc/src/unix/mod.rs diff --git a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch index b4835eb3f4..692eb71142 100644 --- a/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch +++ b/srcpkgs/rust/patches/0014-Void-fix-linkage-against-host-target-LLVM-in-cross-s.patch @@ -8,24 +8,24 @@ Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross src/librustc_llvm/build.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs -index 9b4f03b3..d0167838 100644 +diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs +index 621363bed..01322e1d2 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs -@@ -217,9 +217,11 @@ fn main() { +@@ -242,9 +242,11 @@ fn main() { for lib in output(&mut cmd).split_whitespace() { if is_crossed { - if lib.starts_with("-LIBPATH:") { -- println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target)); + if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { +- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); + println!("cargo:rustc-link-search=native={}{}", -+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[9..]); - } else if lib.starts_with("-L") { -- println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target)); ++ env::var("XBPS_CROSS_BASE").unwrap(), stripped); + } else if let Some(stripped) = lib.strip_prefix("-L") { +- println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); + println!("cargo:rustc-link-search=native={}{}", -+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]); ++ env::var("XBPS_CROSS_BASE").unwrap(), stripped); } - } else if lib.starts_with("-LIBPATH:") { - println!("cargo:rustc-link-search=native={}", &lib[9..]); + } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { + println!("cargo:rustc-link-search=native={}", stripped); -- 2.26.2 diff --git a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch index a064d178ce..3f3bd3212b 100644 --- a/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch +++ b/srcpkgs/rust/patches/0015-Use-ELFv2-ABI-on-all-powerpc64-targets.patch @@ -12,15 +12,15 @@ so at least match the environment we have. src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs | 6 +----- 2 files changed, 2 insertions(+), 13 deletions(-) -diff --git a/src/librustc_target/abi/call/powerpc64.rs b/src/librustc_target/abi/call/powerpc64.rs -index 93c4e97d..96b02486 100644 +diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs +index 8c2a9d09a..2dcbf2c09 100644 --- a/compiler/rustc_target/src/abi/call/powerpc64.rs +++ b/compiler/rustc_target/src/abi/call/powerpc64.rs @@ -119,14 +119,7 @@ where - Ty: TyLayoutMethods<'a, C> + Copy, - C: LayoutOf> + HasDataLayout + HasTargetSpec, + Ty: TyAndLayoutMethods<'a, C> + Copy, + C: LayoutOf> + HasDataLayout + HasTargetSpec, { -- let abi = if cx.target_spec().target_env == "musl" { +- let abi = if cx.target_spec().env == "musl" { - ELFv2 - } else { - match cx.data_layout().endian { @@ -32,17 +32,18 @@ index 93c4e97d..96b02486 100644 if !fn_abi.ret.is_ignore() { classify_ret(cx, &mut fn_abi.ret, abi); -diff --git a/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs b/src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs -index 5306d905..c63eed85 100644 +diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs +index 751022c12..c4d55a62e 100644 --- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs -@@ -1,4 +1,4 @@ --use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult}; -+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; +@@ -1,5 +1,5 @@ + use crate::abi::Endian; +-use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions}; ++use crate::spec::{LinkerFlavor, Target, TargetOptions}; - pub fn target() -> TargetResult { - let mut base = super::linux_base::opts(); -@@ -6,10 +6,6 @@ pub fn target() -> TargetResult { + pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); +@@ -7,10 +7,6 @@ pub fn target() -> Target { base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); base.max_atomic_width = Some(64); @@ -50,9 +51,9 @@ index 5306d905..c63eed85 100644 - // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474 - base.relro_level = RelroLevel::Partial; - - Ok(Target { + Target { llvm_target: "powerpc64-unknown-linux-gnu".to_string(), - target_endian: "big".to_string(), + pointer_width: 64, -- 2.26.2 diff --git a/srcpkgs/rust/patches/fix-ppc32.patch b/srcpkgs/rust/patches/fix-ppc32.patch new file mode 100644 index 0000000000..c5208648a6 --- /dev/null +++ b/srcpkgs/rust/patches/fix-ppc32.patch @@ -0,0 +1,23 @@ +From 283619cf5ca25272b294525273ec42e9c7820edb Mon Sep 17 00:00:00 2001 +From: John Paul Adrian Glaubitz +Date: Sat, 29 May 2021 12:38:46 +0000 +Subject: [PATCH] bootstrap: Disable initial-exec TLS model on powerpc + +Fixes #81334. +--- + src/bootstrap/builder.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index f39e89a9d01f7..061d7ed5ee08b 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -1237,7 +1237,7 @@ impl<'a> Builder<'a> { + // 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-") && !target.triple.starts_with("powerpcle-") { + rustflags.arg("-Ztls-model=initial-exec"); + } + diff --git a/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch b/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch new file mode 100644 index 0000000000..8c24f04b20 --- /dev/null +++ b/srcpkgs/rust/patches/need-ssp-nonshared-and-execinfo.patch @@ -0,0 +1,13 @@ +--- a/library/std/src/sys/unix/mod.rs ++++ b/library/std/src/sys/unix/mod.rs +@@ -212,6 +212,10 @@ cfg_if::cfg_if! { + #[link(name = "log")] + #[link(name = "gcc")] + extern "C" {} ++ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] { ++ #[link(name = "ssp_nonshared")] ++ #[link(name = "execinfo")] ++ extern "C" {} + } else if #[cfg(target_os = "freebsd")] { + #[link(name = "execinfo")] + #[link(name = "pthread")] diff --git a/srcpkgs/rust/patches/need-ssp_nonshared.patch b/srcpkgs/rust/patches/need-ssp_nonshared.patch deleted file mode 100644 index 44c6dc2f26..0000000000 --- a/srcpkgs/rust/patches/need-ssp_nonshared.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- rustc-1.47.0-src/library/std/build.rs.orig -+++ rustc-1.47.0-src/library/std/build.rs -@@ -8,6 +8,8 @@ - println!("cargo:rustc-link-lib=dl"); - println!("cargo:rustc-link-lib=log"); - println!("cargo:rustc-link-lib=gcc"); -+ } else if target.contains("musl") { -+ println!("cargo:rustc-link-lib=ssp_nonshared"); - } - } else if target.contains("freebsd") { - println!("cargo:rustc-link-lib=execinfo"); ---- rustc-1.44.0-src/library/unwind/build.rs.orig -+++ rustc-1.44.0-src/library/unwind/build.rs -@@ -12,6 +12,9 @@ fn main() { - } else if target.contains("linux") { - if !target.contains("android") { - println!("cargo:rustc-link-lib=gcc_s"); -+ if target.contains("musl") { -+ println!("cargo:rustc-link-lib=ssp_nonshared"); -+ } - } - } else if target.contains("freebsd") { - println!("cargo:rustc-link-lib=gcc_s"); diff --git a/srcpkgs/rust/patches/xxx-ppcle-ccrs.patch b/srcpkgs/rust/patches/xxx-ppcle-ccrs.patch new file mode 100644 index 0000000000..06f57aaec5 --- /dev/null +++ b/srcpkgs/rust/patches/xxx-ppcle-ccrs.patch @@ -0,0 +1,29 @@ +From dc1de5be2b7908adb493b36f5079064083ed9507 Mon Sep 17 00:00:00 2001 +From: q66 +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 + diff --git a/srcpkgs/rust/patches/xxx-ppcle-gcc.patch b/srcpkgs/rust/patches/xxx-ppcle-gcc.patch new file mode 100644 index 0000000000..b4150fcd82 --- /dev/null +++ b/srcpkgs/rust/patches/xxx-ppcle-gcc.patch @@ -0,0 +1,25 @@ +From bf983e79364d2d1c4a22857fadae8fcdc6646ef3 Mon Sep 17 00:00:00 2001 +From: q66 +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 + diff --git a/srcpkgs/rust/patches/xxx-ppcle.patch b/srcpkgs/rust/patches/xxx-ppcle.patch new file mode 100644 index 0000000000..ab5c0c56c9 --- /dev/null +++ b/srcpkgs/rust/patches/xxx-ppcle.patch @@ -0,0 +1,601 @@ +From b92ce1ed0ac8d95831a43f4395544c17a0816c9b Mon Sep 17 00:00:00 2001 +From: Daniel Kolesa +Date: Sat, 3 Jul 2021 21:02:03 +0200 +Subject: [PATCH] initial ppcle port + +--- + compiler/rustc_middle/src/ty/layout.rs | 5 ++++- + compiler/rustc_target/src/spec/mod.rs | 2 ++ + .../src/spec/powerpcle_unknown_linux_gnu.rs | 15 +++++++++++++++ + .../src/spec/powerpcle_unknown_linux_musl.rs | 15 +++++++++++++++ + src/bootstrap/bootstrap.py | 2 ++ + .../codegen/abi-main-signature-16bit-c-int.rs | 1 + + src/test/codegen/fastcall-inreg.rs | 1 + + src/test/codegen/global_asm.rs | 1 + + src/test/codegen/global_asm_include.rs | 1 + + src/test/codegen/global_asm_x2.rs | 1 + + src/test/codegen/repr-transparent-aggregates-1.rs | 1 + + src/test/codegen/repr-transparent-aggregates-2.rs | 1 + + src/test/codegen/stack-probes.rs | 1 + + .../run-make-fulldeps/atomic-lock-free/Makefile | 2 ++ + src/test/ui/abi/stack-probes-lto.rs | 1 + + src/test/ui/abi/stack-probes.rs | 1 + + src/test/ui/borrowck/borrowck-asm.rs | 1 + + src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs | 1 + + src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs | 1 + + src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs | 1 + + src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs | 1 + + src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs | 1 + + src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs | 1 + + 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 +++++++++++++++ + vendor/target-lexicon/src/targets.rs | 7 +++++++ + vendor/tikv-jemallocator/benches/roundtrip.rs | 3 ++- + vendor/tikv-jemallocator/src/lib.rs | 3 ++- + 37 files changed, 111 insertions(+), 6 deletions(-) + create mode 100644 compiler/rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs + create mode 100644 compiler/rustc_target/src/spec/powerpcle_unknown_linux_musl.rs + create mode 100644 vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs + create mode 100644 vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_musl.rs + +diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs +index c2e9dba6..8147a3c3 100644 +--- a/compiler/rustc_middle/src/ty/layout.rs ++++ b/compiler/rustc_middle/src/ty/layout.rs +@@ -2753,6 +2753,8 @@ where + target.os == "linux" && target.arch == "sparc64" && target_env_gnu_like; + let linux_powerpc_gnu_like = + 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; + 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 + && !linux_sparc64_gnu_like +- && !linux_powerpc_gnu_like) ++ && !linux_powerpc_gnu_like ++ && !linux_powerpcle_gnu_like) + { + arg.mode = PassMode::Ignore; + } +diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs +index 2af46693..986d84e0 100644 +--- a/compiler/rustc_target/src/spec/mod.rs ++++ b/compiler/rustc_target/src/spec/mod.rs +@@ -716,6 +716,8 @@ supported_targets! { + ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu), + ("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe), + ("powerpc-unknown-linux-musl", powerpc_unknown_linux_musl), ++ ("powerpcle-unknown-linux-gnu", powerpcle_unknown_linux_gnu), ++ ("powerpcle-unknown-linux-musl", powerpcle_unknown_linux_musl), + ("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu), + ("powerpc64-unknown-linux-musl", powerpc64_unknown_linux_musl), + ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu), +diff --git a/compiler/rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs +new file mode 100644 +index 00000000..780c20a3 +--- /dev/null ++++ b/compiler/rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs +@@ -0,0 +1,15 @@ ++use crate::spec::{LinkerFlavor, Target, TargetOptions}; ++ ++pub fn target() -> Target { ++ let mut base = super::linux_gnu_base::opts(); ++ base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string()); ++ base.max_atomic_width = Some(32); ++ ++ Target { ++ llvm_target: "powerpcle-unknown-linux-gnu".to_string(), ++ pointer_width: 32, ++ data_layout: "e-m:e-p:32:32-i64:64-n32".to_string(), ++ arch: "powerpc".to_string(), ++ options: TargetOptions { mcount: "_mcount".to_string(), ..base }, ++ } ++} +diff --git a/compiler/rustc_target/src/spec/powerpcle_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/powerpcle_unknown_linux_musl.rs +new file mode 100644 +index 00000000..9b848ccf +--- /dev/null ++++ b/compiler/rustc_target/src/spec/powerpcle_unknown_linux_musl.rs +@@ -0,0 +1,15 @@ ++use crate::spec::{LinkerFlavor, Target, TargetOptions}; ++ ++pub fn target() -> Target { ++ let mut base = super::linux_musl_base::opts(); ++ base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string()); ++ base.max_atomic_width = Some(32); ++ ++ Target { ++ llvm_target: "powerpcle-unknown-linux-musl".to_string(), ++ pointer_width: 32, ++ data_layout: "e-m:e-p:32:32-i64:64-n32".to_string(), ++ arch: "powerpc".to_string(), ++ options: TargetOptions { mcount: "_mcount".to_string(), ..base }, ++ } ++} +diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py +index 4111420e..cd69a8ec 100644 +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -289,9 +289,11 @@ def default_build_triple(verbose): + 'i686': 'i686', + 'i786': 'i686', + 'powerpc': 'powerpc', ++ 'powerpcle': 'powerpcle', + 'powerpc64': 'powerpc64', + 'powerpc64le': 'powerpc64le', + 'ppc': 'powerpc', ++ 'ppcle': 'powerpcle', + 'ppc64': 'powerpc64', + 'ppc64le': 'powerpc64le', + 's390x': 's390x', +diff --git a/src/test/codegen/abi-main-signature-16bit-c-int.rs b/src/test/codegen/abi-main-signature-16bit-c-int.rs +index 4ed491df..82ec7755 100644 +--- a/src/test/codegen/abi-main-signature-16bit-c-int.rs ++++ b/src/test/codegen/abi-main-signature-16bit-c-int.rs +@@ -9,6 +9,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-riscv64 + // ignore-s390x +diff --git a/src/test/codegen/fastcall-inreg.rs b/src/test/codegen/fastcall-inreg.rs +index adbeae45..0fd0a9e6 100644 +--- a/src/test/codegen/fastcall-inreg.rs ++++ b/src/test/codegen/fastcall-inreg.rs +@@ -16,6 +16,7 @@ + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-powerpc ++// ignore-powerpcle + // ignore-r600 + // ignore-riscv64 + // ignore-amdgcn +diff --git a/src/test/codegen/global_asm.rs b/src/test/codegen/global_asm.rs +index 57d8aeb1..e0b1b692 100644 +--- a/src/test/codegen/global_asm.rs ++++ b/src/test/codegen/global_asm.rs +@@ -12,6 +12,7 @@ + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-powerpc ++// ignore-powerpcle + // ignore-r600 + // ignore-amdgcn + // ignore-sparc +diff --git a/src/test/codegen/global_asm_include.rs b/src/test/codegen/global_asm_include.rs +index 44402619..62ecfa6d 100644 +--- a/src/test/codegen/global_asm_include.rs ++++ b/src/test/codegen/global_asm_include.rs +@@ -12,6 +12,7 @@ + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-powerpc ++// ignore-powerpcle + // ignore-r600 + // ignore-amdgcn + // ignore-sparc +diff --git a/src/test/codegen/global_asm_x2.rs b/src/test/codegen/global_asm_x2.rs +index d632d0dd..29f97775 100644 +--- a/src/test/codegen/global_asm_x2.rs ++++ b/src/test/codegen/global_asm_x2.rs +@@ -12,6 +12,7 @@ + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-powerpc ++// ignore-powerpcle + // ignore-r600 + // ignore-amdgcn + // ignore-sparc +diff --git a/src/test/codegen/repr-transparent-aggregates-1.rs b/src/test/codegen/repr-transparent-aggregates-1.rs +index 3017adb4..632565bb 100644 +--- a/src/test/codegen/repr-transparent-aggregates-1.rs ++++ b/src/test/codegen/repr-transparent-aggregates-1.rs +@@ -7,6 +7,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-riscv64 see codegen/riscv-abi + // ignore-windows +diff --git a/src/test/codegen/repr-transparent-aggregates-2.rs b/src/test/codegen/repr-transparent-aggregates-2.rs +index 429d760b..57e75f95 100644 +--- a/src/test/codegen/repr-transparent-aggregates-2.rs ++++ b/src/test/codegen/repr-transparent-aggregates-2.rs +@@ -6,6 +6,7 @@ + // ignore-emscripten + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 see codegen/riscv-abi +diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs +index 9bd351df..29073eb5 100644 +--- a/src/test/codegen/stack-probes.rs ++++ b/src/test/codegen/stack-probes.rs +@@ -3,6 +3,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/run-make-fulldeps/atomic-lock-free/Makefile b/src/test/run-make-fulldeps/atomic-lock-free/Makefile +index 9e8b4fab..402d37a4 100644 +--- a/src/test/run-make-fulldeps/atomic-lock-free/Makefile ++++ b/src/test/run-make-fulldeps/atomic-lock-free/Makefile +@@ -36,6 +36,8 @@ ifeq ($(filter powerpc,$(LLVM_COMPONENTS)),powerpc) + nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add + $(RUSTC) --target=powerpc-unknown-linux-gnuspe atomic_lock_free.rs + nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add ++ $(RUSTC) --target=powerpcle-unknown-linux-gnu atomic_lock_free.rs ++ nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add + $(RUSTC) --target=powerpc64-unknown-linux-gnu atomic_lock_free.rs + nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add + $(RUSTC) --target=powerpc64le-unknown-linux-gnu atomic_lock_free.rs +diff --git a/src/test/ui/abi/stack-probes-lto.rs b/src/test/ui/abi/stack-probes-lto.rs +index 90df1f3f..8c6dda8b 100644 +--- a/src/test/ui/abi/stack-probes-lto.rs ++++ b/src/test/ui/abi/stack-probes-lto.rs +@@ -4,6 +4,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-s390x + // ignore-sparc + // ignore-sparc64 +diff --git a/src/test/ui/abi/stack-probes.rs b/src/test/ui/abi/stack-probes.rs +index e998dd0f..9472e538 100644 +--- a/src/test/ui/abi/stack-probes.rs ++++ b/src/test/ui/abi/stack-probes.rs +@@ -4,6 +4,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-s390x + // ignore-sparc + // ignore-sparc64 +diff --git a/src/test/ui/borrowck/borrowck-asm.rs b/src/test/ui/borrowck/borrowck-asm.rs +index a3f64524..faf9adb4 100644 +--- a/src/test/ui/borrowck/borrowck-asm.rs ++++ b/src/test/ui/borrowck/borrowck-asm.rs +@@ -1,6 +1,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs +index 2868d3d3..5c6e325b 100644 +--- a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs ++++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs +@@ -4,6 +4,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs +index e3bc7d29..49f53f67 100644 +--- a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs ++++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs +@@ -1,6 +1,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs +index daae0c81..fd505c86 100644 +--- a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs ++++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs +@@ -5,6 +5,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs +index 9c62532c..baa1c1ba 100644 +--- a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs ++++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs +@@ -1,6 +1,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs +index 72edb339..2fec991d 100644 +--- a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs ++++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs +@@ -1,6 +1,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs +index acf4cf9f..dfad0775 100644 +--- a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs ++++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs +@@ -1,6 +1,7 @@ + // ignore-s390x + // ignore-emscripten + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/target-feature/gate.rs b/src/test/ui/target-feature/gate.rs +index 164830fe..531a4b45 100644 +--- a/src/test/ui/target-feature/gate.rs ++++ b/src/test/ui/target-feature/gate.rs +@@ -5,6 +5,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/test/ui/target-feature/invalid-attribute.rs b/src/test/ui/target-feature/invalid-attribute.rs +index 5ea78215..47e7887a 100644 +--- a/src/test/ui/target-feature/invalid-attribute.rs ++++ b/src/test/ui/target-feature/invalid-attribute.rs +@@ -5,6 +5,7 @@ + // ignore-mips + // ignore-mips64 + // ignore-powerpc ++// ignore-powerpcle + // ignore-powerpc64 + // ignore-powerpc64le + // ignore-riscv64 +diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs +index 7dbd7094..08c9de3c 100644 +--- a/src/tools/compiletest/src/util.rs ++++ b/src/tools/compiletest/src/util.rs +@@ -67,6 +67,7 @@ const ARCH_TABLE: &[(&str, &str)] = &[ + ("msp430", "msp430"), + ("nvptx64", "nvptx64"), + ("powerpc", "powerpc"), ++ ("powerpcle", "powerpc"), + ("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 ++++ b/vendor/cc/src/lib.rs +@@ -2409,6 +2409,7 @@ impl Build { + "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"), + "powerpc-unknown-linux-gnuspe" => Some("powerpc-linux-gnuspe"), + "powerpc-unknown-netbsd" => Some("powerpc--netbsd"), ++ "powerpcle-unknown-linux-gnu" => Some("powerpcle-linux-gnu"), + "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 ++++ b/vendor/rustc-ap-rustc_target/src/spec/mod.rs +@@ -716,6 +716,8 @@ supported_targets! { + ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu), + ("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe), + ("powerpc-unknown-linux-musl", powerpc_unknown_linux_musl), ++ ("powerpcle-unknown-linux-gnu", powerpcle_unknown_linux_gnu), ++ ("powerpcle-unknown-linux-musl", powerpcle_unknown_linux_musl), + ("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu), + ("powerpc64-unknown-linux-musl", powerpc64_unknown_linux_musl), + ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu), +diff --git a/vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs +new file mode 100644 +index 00000000..780c20a3 +--- /dev/null ++++ b/vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_gnu.rs +@@ -0,0 +1,15 @@ ++use crate::spec::{LinkerFlavor, Target, TargetOptions}; ++ ++pub fn target() -> Target { ++ let mut base = super::linux_gnu_base::opts(); ++ base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string()); ++ base.max_atomic_width = Some(32); ++ ++ Target { ++ llvm_target: "powerpcle-unknown-linux-gnu".to_string(), ++ pointer_width: 32, ++ data_layout: "e-m:e-p:32:32-i64:64-n32".to_string(), ++ arch: "powerpc".to_string(), ++ options: TargetOptions { mcount: "_mcount".to_string(), ..base }, ++ } ++} +diff --git a/vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_musl.rs +new file mode 100644 +index 00000000..9b848ccf +--- /dev/null ++++ b/vendor/rustc-ap-rustc_target/src/spec/powerpcle_unknown_linux_musl.rs +@@ -0,0 +1,15 @@ ++use crate::spec::{LinkerFlavor, Target, TargetOptions}; ++ ++pub fn target() -> Target { ++ let mut base = super::linux_musl_base::opts(); ++ base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".to_string()); ++ base.max_atomic_width = Some(32); ++ ++ Target { ++ llvm_target: "powerpcle-unknown-linux-musl".to_string(), ++ pointer_width: 32, ++ data_layout: "e-m:e-p:32:32-i64:64-n32".to_string(), ++ arch: "powerpc".to_string(), ++ options: TargetOptions { mcount: "_mcount".to_string(), ..base }, ++ } ++} +diff --git a/vendor/target-lexicon/src/targets.rs b/vendor/target-lexicon/src/targets.rs +index 87c237aa..dc694010 100644 +--- a/vendor/target-lexicon/src/targets.rs ++++ b/vendor/target-lexicon/src/targets.rs +@@ -26,6 +26,7 @@ pub enum Architecture { + Msp430, + Nvptx64, + Powerpc, ++ Powerpcle, + Powerpc64, + Powerpc64le, + Riscv32(Riscv32Architecture), +@@ -517,6 +518,7 @@ impl Architecture { + | Mips64(Mips64Architecture::Mipsisa64r6el) + | Msp430 + | Nvptx64 ++ | Powerpcle + | Powerpc64le + | Riscv32(_) + | Riscv64(_) +@@ -553,6 +555,7 @@ impl Architecture { + | Sparc + | Wasm32 + | Mips32(_) ++ | Powerpcle + | Powerpc => Ok(PointerWidth::U32), + AmdGcn + | Powerpc64le +@@ -737,6 +740,7 @@ impl fmt::Display for Architecture { + Msp430 => f.write_str("msp430"), + Nvptx64 => f.write_str("nvptx64"), + Powerpc => f.write_str("powerpc"), ++ Powerpcle => f.write_str("powerpcle"), + Powerpc64 => f.write_str("powerpc64"), + Powerpc64le => f.write_str("powerpc64le"), + Riscv32(riscv32) => riscv32.fmt(f), +@@ -913,6 +917,7 @@ impl FromStr for Architecture { + "msp430" => Msp430, + "nvptx64" => Nvptx64, + "powerpc" => Powerpc, ++ "powerpcle" => Powerpcle, + "powerpc64" => Powerpc64, + "powerpc64le" => Powerpc64le, + "s390x" => S390x, +@@ -1380,6 +1385,8 @@ mod tests { + "powerpc-unknown-netbsd", + "powerpc-wrs-vxworks", + "powerpc-wrs-vxworks-spe", ++ "powerpcle-unknown-linux-gnu", ++ "powerpcle-unknown-linux-musl", + "powerpc64-unknown-freebsd", + "powerpc64-unknown-linux-gnu", + "powerpc64-unknown-linux-musl", +diff --git a/vendor/tikv-jemallocator/benches/roundtrip.rs b/vendor/tikv-jemallocator/benches/roundtrip.rs +index 40b8005f..bc4df023 100644 +--- a/vendor/tikv-jemallocator/benches/roundtrip.rs ++++ b/vendor/tikv-jemallocator/benches/roundtrip.rs +@@ -22,7 +22,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/tikv-jemallocator/src/lib.rs b/vendor/tikv-jemallocator/src/lib.rs +index 9a489b62..1ed12b26 100644 +--- a/vendor/tikv-jemallocator/src/lib.rs ++++ b/vendor/tikv-jemallocator/src/lib.rs +@@ -44,7 +44,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 ALIGNOF_MAX_ALIGN_T: usize = 8; + #[cfg(all(any( +-- +2.32.0 + diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 92ed8935ab..f31ea7b87b 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -8,24 +8,31 @@ # uploaded to https://alpha.de.repo.voidlinux.org/distfiles/ # pkgname=rust -version=1.48.0 +version=1.53.0 revision=1 -_rust_dist_version=1.48.0 +_rust_dist_version=1.53.0 wrksrc="rustc-${version}-src" hostmakedepends="cmake curl pkg-config python3 tar" -makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm11" +makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm12" depends="rust-std" short_desc="Safe, concurrent, practical systems language" maintainer="Enno Boland " license="MIT, Apache-2.0" homepage="https://www.rust-lang.org/" distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz" -checksum="0e763e6db47d5d6f91583284d2f989eacc49b84794d1443355b85c58d67ae43b" +checksum=5cf7ca39a10f6bf4e0b0bd15e3b9a61ce721f301e12d148262e5ba968ab825b9 lib32disabled=yes build_options="bindist" desc_option_bindist="Generate tarballs for bootstrap" +if [ "$XBPS_LIBC" = "musl" ]; then + hostmakedepends+=" libexecinfo-devel" +fi +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" @@ -37,7 +44,7 @@ case "$XBPS_MACHINE" in ppc*) # custom bootstrap tarballs still use cargo versioning, so override _bootstrap_url="https://alpha.de.repo.voidlinux.org/distfiles" - _cargo_dist_version="0.49.0" + _cargo_dist_version="0.54.0" ;; esac @@ -48,39 +55,39 @@ distfiles+=" ${_bootstrap_url}/cargo-${_cargo_dist_version}-${RUST_BUILD}.tar.xz case "$XBPS_MACHINE" in i686) checksum+=" - 1eab76df91e87198632605752d0dd66f3d84b502cbd1f982f6db3d0d8d943cdb" + deebb4a4de22a60f0dec5d5b84e8dfe6ce039835935dae96477a79468aefd927" ;; x86_64) checksum+=" - b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055" + e4437f6c83574fc60e183f4df439190f7610e4a669476802795645da66fbb83b" ;; x86_64-musl) checksum+=" - 8728cb7515e593f6fcf3c7afba826a92cd227a35b8e936bae892b95482d4fb90" + ca236408cb2c35b8c3f7c2b4e9f1e69422ed24153f445192eafb6462351e5c2b" ;; ppc64le) checksum+=" - 675321cf812a132ce707261d03aab2f5ff64788ae66b45d03bc281514f5d53ec" + ca1d94161c3a4021bca170ba4ca059b5606fcd70934aca89d8cea43746880ba7" ;; ppc64le-musl) checksum+=" - cf02e057f04e40458b63326e443c48924c78fc33dcb6b892643d47feb1496b09" + 1181b721addeb2aa471bf71549a7fb09f27167c382b480cefba272f770b9f039" ;; ppc64) checksum+=" - 1e7612ea1900b76924429fa04fa2c194f4213167933b481001290dd4fef27939" + 7d9b0428d4cd8cdd76582b3113476228013ec0b674802f18b4b5e8bbefcd3ab2" ;; ppc64-musl) checksum+=" - 88ffadd53e79055ba266f1303d502bcf1ef863783b121aa017930cadcd0e398d" + 695d687c19a729504ac8b57a42e395258a8b801753baf1b0b17755d7f38f7eaa" ;; ppc) checksum+=" - cacacdec7bfd24345804efdd1bd1682084880c3c6a086bcab85cd1186b6cd230" + 176f178b9e55f399311edb4888d931e5f696766f655cc9648ae4b6ef1bdc8369" ;; ppc-musl) checksum+=" - bad4a5d22da3c7548fd440d0d5a0b98e4de9894dedb35bfb58aaa5f141c23adb" + 234cf0792407065f4c5c4276886846cee2ecfb37eea1171c2c6e4a0fba7d324c" ;; *) broken="cargo bootstrap binary unavailable for ${XBPS_MACHINE}";; esac @@ -92,7 +99,7 @@ _bootstrap_dir="stage0-bootstrap" # cut down the build time (the local-rebuild property is enabled for cross) if [ "$CROSS_BUILD" ]; then - hostmakedepends+=" rust llvm11" + hostmakedepends+=" rust llvm12" # These are required for building the buildhost's stage0/1 hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel" else @@ -103,48 +110,48 @@ else case "$XBPS_MACHINE" in i686) checksum+=" - c241405350bf6f88224db7040012ce25351b332d6deffec07a9b5a958ab19a28 - d4ea5ca6f9c8f9092b50c879f1d9a2620486f08020fa4cac227743a19f6e8cdf" + 93b05456ea8500864e020cfbb1dfbe0a93651406432b6950013f87b91ea6ff47 + d63690da8adb531bb92e76e211b37d3cf941fa841eaaaa210cce4cd6301ca64a" ;; x86_64) checksum+=" - fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483 - 1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8" + 9c2f0443a546dd18f1f020c7711a7b9864432545ceb812e79315c1e76508b193 + 66d5257bbd194db08e67ca63a74cc80cdc4a36eaa30bf7dfe65861d9deaff7f7" ;; x86_64-musl) checksum+=" - 50c2904db7794400987487ea364392714830f287f3e596a9f8ea9df748dfa8a3 - 4f485d8800f90898705686b873765a4c0fe909d1127d5b091a01979bc32f01c0" + 50de8b4bcb0819ec0ca363e0aa53fc1c55bc85f53bc82da8dce20a132da7e7d9 + 413449866616b1cd048da1356a41d977bf4e037cce114f07c3afbb0497b3e4c6" ;; ppc64le) checksum+=" - bf06c20e09c66391c19de4319de64621c82787e5e44a40ec25fb565a4c6caf28 - e42b64c5710d3982f22ed744ea21ef2f0196df908c6a673b6df550904583b1c3" + 7624a5bf09bcaddc90851928d604e78ad9896b041ad1124b064a716b7250b42b + d29a9c16a52f3a5767733597efdb9cc1e3cb390961b11cf1d1792b48939de5ed" ;; ppc64le-musl) checksum+=" - f6967f8afe25f6beff65f2e139babc253de2c40edf556f615e380f50b4a31da8 - 96311452bb46a855b7afe5883f619d4b768f14c7a5d5de01e15e146fb05d6d59" + 09cd44fed6bf2d7ac0d180fc1374022deeb08be1d245ee26d1cfccc62658d22f + c283d604807f1c00e95a5122352941a64a26c3031ff41b80d395ac01ab55aa80" ;; ppc64) checksum+=" - 13764a670b15480d1d850cc8ae3576536265e1fcac869c1a8fa72a8ebd059193 - 5ce4b14e8895d995c24d3f8706ea9bb6a3ee153bd8d8cec8d808ad66e62162bc" + 3136af38b2413524f02bbf1377c32c82f5f3791c5f78b926d7d74ef667349a69 + a01e07e15e151f5c6fdd7f3f167fa96326ea8fffdce402a3dbb9687f33ae5ccc" ;; ppc64-musl) checksum+=" - 6b2485c27be4a3d390e8dd4153381304ec3883eb0d9543835b29e0a471e9d4f0 - e5e513fe1e660856b4a7b133c99c23468bf781b93c69e7a098f600bcb91ce9bb" + 5dbcb8ca33874d7a82543b4f9d9f1c51e5680a998b0b572119e8be6b8ae4f566 + 5f03e215507313d14fc5275ba6951d3d7590634909def352504f52ad57c24dc3" ;; ppc) checksum+=" - 4ea76c15c7225ab113c391fb7640786decf706e256fb9338e5b0c2763286777c - 5682d27ffc6f6c1655987e154f5425f9114516e22b7797c9e81bf038ffffad21" + be6ca5e02c04329b082eaf717ba2ea370d676a93e520cd5988883ea2ed8cb750 + 6006f7f78e30810e8b929ab5ab97cf5e4488a25f7fe6a49a1a548dd4745281e0" ;; ppc-musl) checksum+=" - 4147cae868df4e936409331ee9e2d81d47529d05a7a2e045d7f566e09eb4f302 - 20132e5c67a67399e7945ba17d698a6aa1833f87b89bfc8a5a1678d75cfc637d" + 6ecf74e3718bfc03a09ece82a246c9fe268bbb9a7d96cb7d65b579a824e5e1d9 + 17d14e51263e253ba082fc0b05f887dad7d16c705304514aa3268904ac472d29" ;; *) broken="rust bootstrap binaries unavailable for ${XBPS_MACHINE}";; esac @@ -182,6 +189,13 @@ 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() { @@ -253,7 +267,7 @@ do_configure() { verbose-tests = true dist-src = false jemalloc = false - llvm-libunwind = false + llvm-libunwind = "no" codegen-tests = false [dist] src-tarball = false @@ -302,12 +316,9 @@ do_check() { python3 x.py test ${makejobs} --no-doc --no-fail-fast \ src/test/codegen \ src/test/codegen-units \ - src/test/compile-fail \ src/test/incremental \ src/test/mir-opt \ src/test/pretty \ - src/test/run-fail \ - src/test/run-fail/pretty \ src/test/run-make \ src/test/run-make-fulldeps \ src/test/ui \ @@ -342,6 +353,12 @@ do_install() { # symlinks instead of copies mv *.so rustlib/${RUST_TARGET}/lib ln -sf rustlib/${RUST_TARGET}/lib/*.so . + + # executable used for split dwarf, currently unstable on linux. + # it's copied directly from the local llvm package, but + # FIXME: cross builds are installing the version from the build machine, + # it shouldn't be necessary to remove it + rm rustlib/${RUST_TARGET}/bin/rust-llvm-dwp } rust-doc_package() { @@ -353,6 +370,9 @@ rust-doc_package() { rust-std_package() { short_desc+=" - standard library" + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + depends="libexecinfo-devel" + fi pkg_install() { vmove usr/lib/rustlib }