diff --git a/rust/0001-bootstrap-Change-libexec-dir.patch b/rust/0001-bootstrap-Change-libexec-dir.patch index 2c3552b9a1..04ec7fb665 100644 --- a/rust/0001-bootstrap-Change-libexec-dir.patch +++ b/rust/0001-bootstrap-Change-libexec-dir.patch @@ -9,10 +9,10 @@ Subject: [PATCH] bootstrap: Change libexec dir 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs -index 012d64e53443..a077e67e49dc 100644 +index 0cb8971634f1..bc54ad2fa534 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs -@@ -424,7 +424,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { +@@ -427,7 +427,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { }, builder.kind, ) { @@ -22,10 +22,10 @@ index 012d64e53443..a077e67e49dc 100644 let libdir_relative = builder.libdir_relative(compiler); diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs -index 3c2001121037..17c816c6230a 100644 +index 3cfbef27f87a..582ce728f51b 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs -@@ -684,7 +684,7 @@ fn run(self, builder: &Builder<'_>) -> Option { +@@ -834,7 +834,7 @@ fn run(self, builder: &Builder<'_>) -> Option { // Copy `rust-analyzer-proc-macro-srv` to `/libexec/` // so that r-a can use it. diff --git a/rust/0002-bootstrap-Change-bash-completion-dir.patch b/rust/0002-bootstrap-Change-bash-completion-dir.patch index 112156d8c0..092d0cadac 100644 --- a/rust/0002-bootstrap-Change-bash-completion-dir.patch +++ b/rust/0002-bootstrap-Change-bash-completion-dir.patch @@ -8,10 +8,10 @@ Subject: [PATCH] bootstrap: Change bash-completion dir 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs -index a077e67e49dc..eac689560808 100644 +index bc54ad2fa534..4f9946eb4849 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs -@@ -1072,7 +1072,11 @@ fn run(self, builder: &Builder<'_>) -> Option { +@@ -1113,7 +1113,11 @@ fn run(self, builder: &Builder<'_>) -> Option { tarball.add_file(cargo, "bin", 0o755); tarball.add_file(etc.join("_cargo"), "share/zsh/site-functions", 0o644); diff --git a/rust/0003-compiler-Change-LLVM-targets.patch b/rust/0003-compiler-Change-LLVM-targets.patch index 41abedb65d..7074f97960 100644 --- a/rust/0003-compiler-Change-LLVM-targets.patch +++ b/rust/0003-compiler-Change-LLVM-targets.patch @@ -17,49 +17,51 @@ targets, as things break when this is done: `rustc --version --verbose`) is different from the target triple (from `rustc --print target-list`) that best matches autoconf. --- - compiler/rustc_session/src/config.rs | 4 ++++ - .../rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs | 2 +- - .../rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs | 2 +- - 3 files changed, 6 insertions(+), 2 deletions(-) + compiler/rustc_session/src/config.rs | 6 ++++++ + .../rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs | 2 +- + .../src/spec/targets/x86_64_unknown_linux_gnu.rs | 2 +- + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs -index b7ee2c980254..3be7b748718d 100644 +index d60c56fee756..816745632cf5 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs -@@ -2222,6 +2222,10 @@ pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches +@@ -2063,6 +2063,12 @@ pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches early_dcx.early_fatal(format!("target file {path:?} does not exist")) }) } -+ Some(s) if &s == "x86_64-pc-linux-gnu" => { -+ TargetTriple::from_triple("x86_64-unknown-linux-gnu") ++ Some(target) if &target == "x86_64-pc-linux-gnu" => { ++ TargetTuple::from_tuple("x86_64-unknown-linux-gnu") + } -+ Some(s) if &s == "i686-pc-linux-gnu" => TargetTriple::from_triple("i686-unknown-linux-gnu"), - Some(target) => TargetTriple::TargetTriple(target), - _ => TargetTriple::from_triple(host_triple()), ++ Some(target) if &target == "i686-pc-linux-gnu" => { ++ TargetTuple::from_tuple("i686-unknown-linux-gnu") ++ } + Some(target) => TargetTuple::TargetTuple(target), + _ => TargetTuple::from_tuple(host_tuple()), } diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs -index 1d4916cabfdf..4caab818efdb 100644 +index c95cb308d7f5..2e3074aae04b 100644 --- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs -@@ -9,7 +9,7 @@ pub fn target() -> Target { +@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target { base.stack_probes = StackProbeType::Inline; Target { - llvm_target: "i686-unknown-linux-gnu".into(), + llvm_target: "i686-pc-linux-gnu".into(), metadata: crate::spec::TargetMetadata { - description: None, - tier: None, + description: Some("32-bit Linux (kernel 3.2, glibc 2.17+)".into()), + tier: Some(1), diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs -index 98374023dc57..0e08b8c32229 100644 +index 59ec6c7f9d5f..d8f061b24c94 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs -@@ -18,7 +18,7 @@ pub fn target() -> Target { - base.supports_xray = true; +@@ -26,7 +26,7 @@ pub(crate) fn target() -> Target { + } Target { - llvm_target: "x86_64-unknown-linux-gnu".into(), + llvm_target: "x86_64-pc-linux-gnu".into(), metadata: crate::spec::TargetMetadata { - description: None, - tier: None, + description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+)".into()), + tier: Some(1), diff --git a/rust/0005-Fix-enabling-wasm-component-ld-to-match-other-tools.patch b/rust/0005-Fix-enabling-wasm-component-ld-to-match-other-tools.patch deleted file mode 100644 index 0fc267c1b9..0000000000 --- a/rust/0005-Fix-enabling-wasm-component-ld-to-match-other-tools.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Fri, 6 Sep 2024 09:21:33 -0700 -Subject: [PATCH] Fix enabling wasm-component-ld to match other tools - -It was [pointed out recently][comment] that enabling `wasm-component-ld` -as a host tool is different from other host tools. This commit refactors -the logic to match by deduplicating selection of when to build other -tools and then using the same logic for `wasm-component-ld`. - -[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720 ---- - src/bootstrap/src/core/build_steps/compile.rs | 2 +- - src/bootstrap/src/core/build_steps/dist.rs | 2 +- - src/bootstrap/src/core/build_steps/tool.rs | 38 +++---------------- - src/bootstrap/src/lib.rs | 17 +++++---- - 4 files changed, 17 insertions(+), 42 deletions(-) - -diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs -index edf18e2ebf33..596e1eb358fa 100644 ---- a/src/bootstrap/src/core/build_steps/compile.rs -+++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -1892,7 +1892,7 @@ fn run(self, builder: &Builder<'_>) -> Compiler { - // delegates to the `rust-lld` binary for linking and then runs - // logic to create the final binary. This is used by the - // `wasm32-wasip2` target of Rust. -- if builder.build_wasm_component_ld() { -+ if builder.tool_enabled("wasm-component-ld") { - let wasm_component_ld_exe = - builder.ensure(crate::core::build_steps::tool::WasmComponentLd { - compiler: build_compiler, -diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs -index 31d55542ec64..74a230416bde 100644 ---- a/src/bootstrap/src/core/build_steps/dist.rs -+++ b/src/bootstrap/src/core/build_steps/dist.rs -@@ -473,7 +473,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { - ); - } - } -- if builder.build_wasm_component_ld() { -+ if builder.tool_enabled("wasm-component-ld") { - let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin"); - let ld = exe("wasm-component-ld", compiler.host); - builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld)); -diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs -index 3acd3c7881eb..bb9d380fb6b2 100644 ---- a/src/bootstrap/src/core/build_steps/tool.rs -+++ b/src/bootstrap/src/core/build_steps/tool.rs -@@ -693,14 +693,7 @@ impl Step for Cargo { - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; -- run.path("src/tools/cargo").default_condition( -- builder.config.extended -- && builder.config.tools.as_ref().map_or( -- true, -- // If `tools` is set, search list for this tool. -- |tools| tools.iter().any(|tool| tool == "cargo"), -- ), -- ) -+ run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo")) - } - - fn make_run(run: RunConfig<'_>) { -@@ -772,14 +765,7 @@ impl Step for RustAnalyzer { - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; -- run.path("src/tools/rust-analyzer").default_condition( -- builder.config.extended -- && builder -- .config -- .tools -- .as_ref() -- .map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")), -- ) -+ run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer")) - } - - fn make_run(run: RunConfig<'_>) { -@@ -821,12 +807,8 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/tools/rust-analyzer") - .path("src/tools/rust-analyzer/crates/proc-macro-srv-cli") - .default_condition( -- builder.config.extended -- && builder.config.tools.as_ref().map_or(true, |tools| { -- tools.iter().any(|tool| { -- tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv" -- }) -- }), -+ builder.tool_enabled("rust-analyzer") -+ || builder.tool_enabled("rust-analyzer-proc-macro-srv"), - ) - } - -@@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker { - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - let builder = run.builder; -- run.path("src/tools/llvm-bitcode-linker").default_condition( -- builder.config.extended -- && builder -- .config -- .tools -- .as_ref() -- .map_or(builder.build.unstable_features(), |tools| { -- tools.iter().any(|tool| tool == "llvm-bitcode-linker") -- }), -- ) -+ run.path("src/tools/llvm-bitcode-linker") -+ .default_condition(builder.tool_enabled("llvm-bitcode-linker")) - } - - fn make_run(run: RunConfig<'_>) { -diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs -index 82b640f54234..fb73c5ff799a 100644 ---- a/src/bootstrap/src/lib.rs -+++ b/src/bootstrap/src/lib.rs -@@ -1379,16 +1379,17 @@ fn default_wasi_runner(&self) -> Option { - None - } - -- /// Returns whether it's requested that `wasm-component-ld` is built as part -- /// of the sysroot. This is done either with the `extended` key in -- /// `config.toml` or with the `tools` set. -- fn build_wasm_component_ld(&self) -> bool { -- if self.config.extended { -- return true; -+ /// Returns whether the specified tool is configured as part of this build. -+ /// -+ /// This requires that both the `extended` key is set and the `tools` key is -+ /// either unset or specifically contains the specified tool. -+ fn tool_enabled(&self, tool: &str) -> bool { -+ if !self.config.extended { -+ return false; - } - match &self.config.tools { -- Some(set) => set.contains("wasm-component-ld"), -- None => false, -+ Some(set) => set.contains(tool), -+ None => true, - } - } - diff --git a/rust/PKGBUILD b/rust/PKGBUILD index bfc73c4e5c..c04c96e7bd 100644 --- a/rust/PKGBUILD +++ b/rust/PKGBUILD @@ -12,7 +12,7 @@ pkgname=( rust-wasm ) epoch=1 -pkgver=1.83.0 +pkgver=1.84.0 pkgrel=1 pkgdesc="Systems programming language focused on safety, speed and concurrency" url=https://www.rust-lang.org/ @@ -55,17 +55,20 @@ source=( 0004-compiler-Use-wasm-ld-for-wasm-targets.patch xxxx-Use-ELFv2-ABI-on-all-powerpc64-targets.patch ) -b2sums=('c4b4d5ce55e07c95016c10aece82b6bf35d037f84017ad87d86d7f5a4d965393f11da309daa32b877512f41a8a9c1ff4b462a523c807eb8f8919cb9485c0767c' +b2sums=('dd1942fbd6e9b48ad9e5a9253390fdc1f93ddf6ef4340ccce5e1418621d874004a6e692a108ad70b9d6b897ef239d7db0aeadb899b7537796c97fa8c552a4613' 'SKIP' - 'ef56a70741bae70a95695b4d05d1a6395f545e671c9d016c7180732f69a09b828ff5e16964ef16f9ebec55dd778a1b50927275cd4c21a7b78ae4959946a0657c' - 'd20861a8a8e16d4bb0143f00d4beb42e2c52eeb2c1894e9f9c04e3d74ecd750d9bdacf15bb39fd0ade4487b9d3d14da24cf5f25ceab112f096fddcd329320a15' - '64391cf17e7d801fb263e9d637928c3a2f6aa11aca6afbf115be4e38e9afce42371ed4884929cf11d6c74c2aa497fb26abbba1812d4f31f44dcda38e4978a33f' + '2ae7ab3bc534f7febfad3585c947505368d3f7ba1aef84de6520f32437d80f00d6c4a21dd69483eb0941e14e30d900636b119356cb4ab46ab8751f518d4b576f' + 'c842268646fbb5c3e8bac899fbf6eb3a0eb3a952fd5076ffc7fb572da7adfda48b9304c06facccb2fc8a8f9dc4699f33fecd0b1de4ee231ba88b5f2cd5966703' + '17aa45250ac4842e4cdc9e37e4e805ee064ea06b3c81d2ce549d0bc4c51cbd9f96efd16de7683e02efe4542553277a340e9edb27b4f6e48ba7f162bc4e4ca5d2' 'b50e77529edc7640e2e08a434aa48591b5b809b35e61db026010e28b6c4caf61a780131500a5b0f9339d2a98177de7adb13d7589a0b2f084304d059c4de112ee' - '0ae8cbc0bc1bcfa1349f4fd7bfea6daf441c56f8b4b3cc5663a5407f9696e42df78ab9bc4a7946020ea38f5625ddb9f937d0a6005f0d7049937da00ea6b0c030') + '242e36c348d37943d233a633414c0a85474130b27f7dcdfca76874100521d0b148dd53c6d12bbbe837c7bb45cc0fd4d76e755c91dd76c961a9e447c444918712') validpgpkeys=( 108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE # Rust Language (Tag and Release Signing Key) ) +# Make sure the duplication in rust-wasm is found +COMPRESSZST+=(--long) + prepare() { cd rustc-$pkgver-src @@ -83,7 +86,7 @@ prepare() { patch -Np1 -i ../0004-compiler-Use-wasm-ld-for-wasm-targets.patch # Ensure powerpc64 uses ELFv2 - patch -Np1 -i ../xxxx-Use-ELFv2-ABI-on-all-powerpc64-targets.patch + #patch -Np0 -i ../xxxx-Use-ELFv2-ABI-on-all-powerpc64-targets.patch _rust_target="\"${CHOST}\"" case "${CARCH}" in @@ -110,7 +113,7 @@ link-shared = true [build] target = [ ${_rust_target}, - "wasm32-wasi", + "wasm32-unknown-unknown", "wasm32-wasip1", "wasm32-wasip1-threads", "wasm32-wasip2", @@ -146,23 +149,13 @@ channel = "stable" description = "Arch POWER $pkgbase $epoch:$pkgver-$pkgrel" rpath = false frame-pointers = true +#lld = false +#use-lld = "external" +llvm-bitcode-linker = false +deny-warnings = false backtrace-on-ice = true jemalloc = true -# Causes "error: --remap-path-prefix must contain '=' between FROM and TO" -# even after creating the missing ~/.cargo/registry/src dir. -# https://github.com/rust-lang/rust/issues/117885 -remap-debuginfo = false - -# LLVM crashes when passing an object through ThinLTO twice. This is triggered -# when using rust code in cross-language LTO if libstd was built using ThinLTO. -# http://blog.llvm.org/2019/09/closing-gap-cross-language-lto-between.html -# https://github.com/rust-lang/rust/issues/54872 -codegen-units-std = 1 - -# musl target produces warnings -deny-warnings = false - [dist] compression-formats = ["gz"] @@ -182,16 +175,6 @@ linker = "/usr/bin/wasm-ld" sanitizers = false profiler = false -[target.wasm32-wasi] -cc = "/usr/bin/clang" -cxx = "/usr/bin/clang++" -ar = "/usr/bin/llvm-ar" -ranlib = "/usr/bin/llvm-ranlib" -linker = "/usr/bin/wasm-ld" -sanitizers = false -profiler = false -wasi-root = "/usr/share/wasi-sysroot" - [target.wasm32-wasip1] cc = "/usr/bin/clang" cxx = "/usr/bin/clang++" diff --git a/rust/xxxx-Use-ELFv2-ABI-on-all-powerpc64-targets.patch b/rust/xxxx-Use-ELFv2-ABI-on-all-powerpc64-targets.patch deleted file mode 100644 index 477ab36ff8..0000000000 --- a/rust/xxxx-Use-ELFv2-ABI-on-all-powerpc64-targets.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- rustc-1.76.0-src/compiler/rustc_target/src/abi/call/powerpc64.rs.vanilla 2024-02-20 12:22:13.165372817 +0100 -+++ rustc-1.76.0-src/compiler/rustc_target/src/abi/call/powerpc64.rs 2024-02-20 12:23:04.119367907 +0100 -@@ -131,7 +131,7 @@ - ELFv2 - } else { - match cx.data_layout().endian { -- Endian::Big => ELFv1, -+ Endian::Big => ELFv2, - Endian::Little => ELFv2, - } - };