From 2f8baa9c41f813a428247e216bed613f0a234fef Mon Sep 17 00:00:00 2001 From: Jia Yuan Lo Date: Thu, 3 Oct 2024 11:33:42 +0800 Subject: [PATCH] revbump(main/rust): after LLVM 19 update (#21566) --- packages/rust/0006-llvm-19.patch | 33 ++++++++++++++++++++++++++++++++ packages/rust/build.sh | 7 ++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 packages/rust/0006-llvm-19.patch diff --git a/packages/rust/0006-llvm-19.patch b/packages/rust/0006-llvm-19.patch new file mode 100644 index 00000000000000..097e041c59e399 --- /dev/null +++ b/packages/rust/0006-llvm-19.patch @@ -0,0 +1,33 @@ +Cherry picked from https://github.com/rust-lang/rust/pull/127513 + +From 00bfd702dc8c3b760b4f965fd059a5f1db8bb2b1 Mon Sep 17 00:00:00 2001 +From: Krasimir Georgiev +Date: Mon, 17 Jun 2024 09:35:38 +0000 +Subject: [PATCH 2/4] Disable MC/DC tests on LLVM 19 + +Disable the tests and generate an error if MC/DC is used on LLVM 19. +The support will be ported separately, as it is substantially +different on LLVM 19, and there are no plans to support both +versions. +--- + compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 +- + tests/coverage/mcdc/condition-limit.rs | 1 + + tests/coverage/mcdc/if.rs | 1 + + tests/coverage/mcdc/inlined_expressions.rs | 1 + + tests/coverage/mcdc/nested_if.rs | 1 + + tests/coverage/mcdc/non_control_flow.rs | 1 + + 6 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +index 4cdd8af1008c0..2ff7335a0fc81 100644 +--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp ++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +@@ -1555,7 +1555,7 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) { + + extern "C" LLVMValueRef + LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) { +-#if LLVM_VERSION_GE(18, 0) ++#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0) + return wrap(llvm::Intrinsic::getDeclaration( + unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update)); + #else diff --git a/packages/rust/build.sh b/packages/rust/build.sh index abc38ead92bf98..6b98a7d35f0e54 100644 --- a/packages/rust/build.sh +++ b/packages/rust/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Systems programming language focused on safety, speed an TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="1.81.0" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-${TERMUX_PKG_VERSION}-src.tar.xz TERMUX_PKG_SHA256=36217ef7e32f40a180e3d79bd666b4dfdaed49dd381023a5fb765fd12d0092ce _LLVM_MAJOR_VERSION=$(. $TERMUX_SCRIPTDIR/packages/libllvm/build.sh; echo $LLVM_MAJOR_VERSION) @@ -32,7 +33,7 @@ termux_pkg_auto_update() { local api_url2="https://forge.rust-lang.org/infra/other-installation-methods.html" local api_url1_r=$(curl -Ls "${api_url1}") local api_url2_r=$(curl -Ls "${api_url2}") - local latest_version=$(echo "${api_url1_r}" | grep "html" | sed -ne "s|.*Stable: \([0-9]*\+.\+[0-9]*\+.\+[0-9]*\) Beta:.*|\1|p") + local latest_version=$(echo "${api_url1_r}" | sed -ne "s|.*Stable: \([0-9]*\+.\+[0-9]*\+.\+[0-9]*\) Beta:.*|\1|p") if [[ "${latest_version}" == "${TERMUX_PKG_VERSION}" ]]; then echo "INFO: Already up to date." return @@ -48,7 +49,7 @@ termux_pkg_auto_update() { local uptime_now=$(cat /proc/uptime) local uptime_s="${uptime_now//.*}" - local uptime_h_limit=4 + local uptime_h_limit=2 local uptime_s_limit=$((uptime_h_limit*60*60)) [[ -z "${uptime_s}" ]] && [[ "$(uname -o)" != "Android" ]] && e=1 [[ "${uptime_s}" == 0 ]] && [[ "$(uname -o)" != "Android" ]] && e=1 @@ -132,7 +133,7 @@ termux_step_configure() { # like 30 to 40 + minutes ... so lets get it right # upstream tests build using versions N and N-1 - local BOOTSTRAP_VERSION=1.80.0 + local BOOTSTRAP_VERSION=1.80.1 if [[ "${TERMUX_ON_DEVICE_BUILD}" == "false" ]]; then if ! rustup install "${BOOTSTRAP_VERSION}"; then echo "WARN: ${BOOTSTRAP_VERSION} is unavailable, fallback to stable version!"