From 34742d9989381453055b45abce12bb8bfe101ab1 Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov Date: Wed, 8 Jan 2025 16:57:27 +0300 Subject: [PATCH] rust: update to 1.84.0 --- mingw-w64-rust/.gitignore | 1 + .../0014-update-cc-for-library.patch | 30 ++++++++++++++ mingw-w64-rust/PKGBUILD | 40 ++++++++++++++----- mingw-w64-rust/config.toml | 23 +++++++++-- 4 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 mingw-w64-rust/.gitignore create mode 100644 mingw-w64-rust/0014-update-cc-for-library.patch diff --git a/mingw-w64-rust/.gitignore b/mingw-w64-rust/.gitignore new file mode 100644 index 0000000000000..7a4f5ac56fe04 --- /dev/null +++ b/mingw-w64-rust/.gitignore @@ -0,0 +1 @@ +/134240.patch diff --git a/mingw-w64-rust/0014-update-cc-for-library.patch b/mingw-w64-rust/0014-update-cc-for-library.patch new file mode 100644 index 0000000000000..36e25cac86375 --- /dev/null +++ b/mingw-w64-rust/0014-update-cc-for-library.patch @@ -0,0 +1,30 @@ +--- a/library/Cargo.lock ++++ b/library/Cargo.lock +@@ -42,9 +42,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + + [[package]] + name = "cc" +-version = "1.1.22" ++version = "1.2.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" ++checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" + dependencies = [ + "shlex", + ] +diff --git a/library/profiler_builtins/Cargo.toml b/library/profiler_builtins/Cargo.toml +index f94ea9a6cda28..9aadefce3b39e 100644 +--- a/library/profiler_builtins/Cargo.toml ++++ b/library/profiler_builtins/Cargo.toml +@@ -13,5 +13,4 @@ core = { path = "../core" } + compiler_builtins = { version = "0.1.0", features = ['rustc-dep-of-std'] } + + [build-dependencies] +-# FIXME: Pinned due to build error when bumped (#132556) +-cc = "=1.1.22" ++cc = "1.2" +--- rustc-1.84.0-src/vendor.orig/cc-1.2.0/.cargo-checksum.json ++++ rustc-1.84.0-src/vendor/cc-1.2.0/.cargo-checksum.json +@@ -0,0 +1 @@ ++{"files":{"CHANGELOG.md":"fb0a3bcb34301d2578bef86feabe93057068cb1906a7f10b584f58ff6123e8c6","Cargo.lock":"b661254fadca74408d53742755b371f7ae29e501e851aeae13bcd14a51883321","Cargo.toml":"50debe1b2fc050e8b305bdd514509d98cdbc59e96e5f10888df4b6fca19d3a75","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"f1ddbede208a5b78333a25dac0a7598e678e9b601a7d99a791069bddaf180dfe","clippy.toml":"aa7850db4350883c8f373bd0d6b4d19bf3b75f13c1c238e24368c109cb52fb1d","src/command_helpers.rs":"b766a70e39b8ea7bb57afd288bcac205a23f6a26ac5619cb1d5b10f70c5dfdea","src/detect_compiler_family.c":"97ca4b021495611e828becea6187add37414186a16dfedd26c2947cbce6e8b2f","src/lib.rs":"221ba9475100303b5c694b2a02e5353452ee08a29e4e4d4d67ea8fcbd87605df","src/parallel/async_executor.rs":"4ce24435fff6b6555b43fee042c16bd65d4150d0346567f246b9190d85b45983","src/parallel/job_token.rs":"018a01cb00182270bbcb68e31e7a7c5c621a95f086e4c68cfa2bf557ac24e5f2","src/parallel/mod.rs":"bd9c1334d17d138c281961c690b8d8118a2d6295a7d6cd7296826255436fa063","src/parallel/stderr.rs":"74384d41198740a6fce0877f144262db09fb091225fa8fbfa771314bb11487c6","src/target.rs":"7313240db078ad85c1209a42a5fa96c3692b5d6e5093c7f366a1b99677247109","src/target/apple.rs":"6afbecac9f66aa72db55694413532f80b2753f28466a6213d1aa901a03c78bcd","src/target/generated.rs":"af067e1c291e895ddb591f92534eed0c48977cdb2b58f8239423e07c6de31cd3","src/target/llvm.rs":"e1db4a7fb8b905ee9853781f2fcc64a9d3b48154e4c8b6cb12f5373c5935da6e","src/target/parser.rs":"4f2129a24273d62bf8ab339098e7f758e4e42b0df369dd2b0eb1b20726be91f8","src/tempfile.rs":"ebafb5b0e5d08b0706916ed911d4245240e60c3e2d0c9a1630c520842988a2b3","src/tool.rs":"2e6550062e021f2b394388172bbb01e86fe6a94d2395bcb3c85a9e86690da1a9","src/utilities.rs":"52b30b24a1c31cdefb105309ee5220cfc9fca76eaf4e6d6509c3e19f431448fe","src/windows/com.rs":"a2800ddb81215fff2bf618336f5c4ff8e8bdb746dd18b795873c7304b3f2a5e3","src/windows/find_tools.rs":"0ff410bd71f08ee88e99609c15be5f1bc16ad7bd07a83918d13a70c8465642e2","src/windows/mod.rs":"34cfa201cfbcac7ccaa3ea5295d3e4200439af3cc5c6433baf81502596040a89","src/windows/registry.rs":"c521b72c825e8095843e73482ffa810ed066ad8bb9f86e6db0c5c143c171aba1","src/windows/setup_config.rs":"754439cbab492afd44c9755abcbec1a41c9b2c358131cee2df13c0e996dbbec8","src/windows/vs_instances.rs":"946527cf8fd32c3472f6a2884dcdec290763101097334c7478f9c24c3950db6b","src/windows/winapi.rs":"250d51c1826d1a2329e9889dd9f058cfce253dbf2a678b076147c6cdb5db046c","src/windows/windows_sys.rs":"e2714c8307bfa083b9745eb0e46cadd7f98d7b88abf45a7637172019324e34b8","src/windows/windows_targets.rs":"5b4648ebc22b028caca9f4b4bf8881fe2d094b7bec217264ba2e6e2c49d1ccee"},"package":"1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8"} +\ No newline at end of file diff --git a/mingw-w64-rust/PKGBUILD b/mingw-w64-rust/PKGBUILD index 06e0510479234..e5362f84173ab 100644 --- a/mingw-w64-rust/PKGBUILD +++ b/mingw-w64-rust/PKGBUILD @@ -8,16 +8,16 @@ if [[ $MINGW_PACKAGE_PREFIX == *-clang-* ]]; then _bootstrapping=no fi -rust_dist_server=https://static.rust-lang.org/dist -#rust_dist_server=https://dev-static.rust-lang.org/dist/2024-11-25 +#rust_dist_server=https://static.rust-lang.org/dist +rust_dist_server=https://dev-static.rust-lang.org/dist/2025-01-07 _realname=rust pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" $([[ ${CARCH} == i686 ]] || echo "${MINGW_PACKAGE_PREFIX}-rust-wasm") "${MINGW_PACKAGE_PREFIX}-rust-src") -pkgver=1.83.0 -pkgrel=4 +pkgver=1.84.0 +pkgrel=1 pkgdesc="Systems programming language focused on safety, speed and concurrency (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -43,21 +43,28 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-zstd" "${MINGW_PACKAGE_PREFIX}-zlib") source=("${rust_dist_server}/${_realname}c-${pkgver}-src.tar.gz"{,.asc} + "cc-1.2.0.tar.gz::https://crates.io/api/v1/crates/cc/1.2.0/download" "psm-0.1.24.tar.gz::https://crates.io/api/v1/crates/psm/0.1.24/download" "config.toml" "0001-rustc-llvm-fix-libs.patch" "0004-compiler-Use-wasm-ld-for-wasm-targets.patch" "0008-disable-self-contained-for-gnu-targets.patch" - "0013-update-psm.patch") + # remove after 1.85.0 update + "0013-update-psm.patch" + "0014-update-cc-for-library.patch" + "https://github.com/rust-lang/rust/pull/134240.patch") noextract=(${_realname}c-${pkgver}-src.tar.gz) -sha256sums=('722d773bd4eab2d828d7dd35b59f0b017ddf9a97ee2b46c1b7f7fac5c8841c6e' +sha256sums=('15cee7395b07ffde022060455b3140366ec3a12cbbea8f1ef2ff371a9cca51bf' 'SKIP' + '1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8' '200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810' - 'd4253c4b72c789a3a7f276ad75673d8c67c28af76e1d7711919509c667fcfbf8' + '9ae64f78af216795bfa31acb8f9a8c2e9ed0e66f61f6565a8b89b58a8dab93b8' '7cb1773c288ffb1c1e751edc49b1890c84bf9c362742bc5225d19d474edb73a0' '56882f1a0f1404c10c7726d6cc37444f2b343e72b969badfcb43760f80db0f32' '98bc3f2bd7371a5b8d14fd7b03bf05574e206d1d9e52bcfbe66d71398504da3c' - '602481687fa580eb426c619f673128702c800e91d4f476fcbaf48b86a7a1b963') + '602481687fa580eb426c619f673128702c800e91d4f476fcbaf48b86a7a1b963' + 'c34cfe938681426db215d6cbf42aa0bd6d43d10fba017a40ff0ec09ea9342c40' + '58eaf7e10272395e7f23e95a292bd09f1090663b094fbab451a835239cbd3365') validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE' # Rust Language (Tag and Release Signing Key) '474E22316ABF4785A88C6E8EA2C794A986419D8A' # Tom Stellard 'B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg @@ -106,6 +113,16 @@ prepare() { apply_patch_with_msg \ 0004-compiler-Use-wasm-ld-for-wasm-targets.patch fi + + # partial backport of https://github.com/rust-lang/rust/commit/e00bfa6595ad6809cf91222a6ce902ce11af1f57 + # to fix compilation for `wasm32v1-none` target + apply_patch_with_msg \ + 0014-update-cc-for-library.patch + + # backport of https://github.com/rust-lang/rust/pull/134240 to remove unneded `rust-objcopy.exe` + # from rust sysroot + apply_patch_with_msg \ + 134240.patch } build() { @@ -165,7 +182,12 @@ build() { # Add target wasm32-* if [[ ${CARCH} != i686 ]]; then - sed -i '/target = \[/a\ "wasm32-unknown-unknown", "wasm32-wasip1", "wasm32-wasip1-threads", "wasm32-wasip2",' config.toml + sed -i '/target = \[/a\ "wasm32-unknown-unknown", "wasm32v1-none", "wasm32-wasip1", "wasm32-wasip1-threads", "wasm32-wasip2",' config.toml + fi + + # Enable CFGuard for gnullvm + if [[ $MINGW_PACKAGE_PREFIX == *-clang-* ]]; then + sed -i "s/^#control-flow-guard/control-flow-guard/g" config.toml fi local -a _rust_build=() diff --git a/mingw-w64-rust/config.toml b/mingw-w64-rust/config.toml index a9c4e48f5920c..b3ae767530777 100644 --- a/mingw-w64-rust/config.toml +++ b/mingw-w64-rust/config.toml @@ -2,7 +2,7 @@ profile = "dist" # see src/bootstrap/src/utils/change_tracker.rs -change-id = 131075 +change-id = 133207 [build] #cargo = "$MINGW_PREFIX/bin/cargo.exe" @@ -41,18 +41,19 @@ sysconfdir = "etc" #debug = true codegen-units-std = 1 #debuginfo-level-std = 2 -parallel-compiler = false channel = "stable" description = "Rev$PKGREL, Built by MSYS2 project" rpath = false frame-pointers = true llvm-bitcode-linker = false lld = false +llvm-tools = false codegen-tests = false deny-warnings = false backtrace-on-ice = true -# FIXME: CFG can be enabled only for MSVC targets as for https://github.com/rust-lang/rust/pull/74103 -# control-flow-guard = true +# FIXME: CFG can be enabled only for MSVC and LLVM targets as for +# https://github.com/rust-lang/rust/pull/74103 and https://github.com/rust-lang/rust/pull/132965 +#control-flow-guard = true [dist] compression-formats = ["gz"] @@ -72,6 +73,17 @@ cxx = "$MINGW_PREFIX/bin/clang++.exe" ar = "$MINGW_PREFIX/bin/llvm-ar.exe" ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe" linker = "$MINGW_PREFIX/bin/wasm-ld.exe" +default-linker = "wasm-ld.exe" +sanitizers = false +profiler = false + +[target.wasm32v1-none] +cc = "$MINGW_PREFIX/bin/clang.exe" +cxx = "$MINGW_PREFIX/bin/clang++.exe" +ar = "$MINGW_PREFIX/bin/llvm-ar.exe" +ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe" +linker = "$MINGW_PREFIX/bin/wasm-ld.exe" +default-linker = "wasm-ld.exe" sanitizers = false profiler = false @@ -81,6 +93,7 @@ cxx = "$MINGW_PREFIX/bin/clang++.exe" ar = "$MINGW_PREFIX/bin/llvm-ar.exe" ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe" linker = "$MINGW_PREFIX/bin/wasm-ld.exe" +default-linker = "wasm-ld.exe" sanitizers = false profiler = false wasi-root = "$MINGW_PREFIX/share/wasi-sysroot" @@ -91,6 +104,7 @@ cxx = "$MINGW_PREFIX/bin/clang++.exe" ar = "$MINGW_PREFIX/bin/llvm-ar.exe" ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe" linker = "$MINGW_PREFIX/bin/wasm-ld.exe" +default-linker = "wasm-ld.exe" sanitizers = false profiler = false wasi-root = "$MINGW_PREFIX/share/wasi-sysroot" @@ -101,6 +115,7 @@ cxx = "$MINGW_PREFIX/bin/clang++.exe" ar = "$MINGW_PREFIX/bin/llvm-ar.exe" ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe" linker = "$MINGW_PREFIX/bin/wasm-ld.exe" +default-linker = "wasm-ld.exe" sanitizers = false profiler = false wasi-root = "$MINGW_PREFIX/share/wasi-sysroot"