Skip to content

Commit

Permalink
Update Rust and NDK
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Dec 1, 2024
1 parent dd87518 commit 52b7644
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions common.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Copyright 2022-2024 Google LLC.
# SPDX-License-Identifier: Apache-2.0

RUST_VERSION='1.82.0'
RUST_VERSION='1.83.0'

NDK_VERSION='r28-beta1'
NDK_VERSION='r28-beta2'
NDK_DIR_VERSION=$NDK_VERSION

# These revisions are obtained from the NDK's LLVM manifest.xml
# Update in sync with the NDK package
LLVM_VERSION='97a699bf4812a18fb657c2779f5296a4ab2694d2'
LLVM_SVN='530567'
LLVM_ANDROID_VERSION='ab3ade05b26c45b59ac47b3779b7a6c999e6d634'
LLVM_ANDROID_VERSION='8dfdf1fc93652ba216e3bcea41bbcd124f1185a5'
TOOLCHAIN_UTILS_VERSION='dd1ee45a84cb07337f9d5d0a6769d9b865c6e620'

OUTPUT_VERSION='r28.0'
OUTPUT_VERSION='r28.1'

PYTHON_CMD='python3'

Expand Down
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
change-id = 129295
change-id = 131075

[llvm]
targets = "AArch64;ARM;X86;RISCV"
Expand Down
4 changes: 2 additions & 2 deletions patches/fix_lib_llvm_path.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
index e1eea31b..aa3465a3 100644
index a2d40f6f..94a7e423 100644
--- a/src/bootstrap/src/core/build_steps/llvm.rs
+++ b/src/bootstrap/src/core/build_steps/llvm.rs
@@ -535,7 +535,7 @@ fn run(self, builder: &Builder<'_>) -> LlvmResult {
@@ -551,7 +551,7 @@ fn run(self, builder: &Builder<'_>) -> LlvmResult {
// link to make llvm-config happy.
if builder.llvm_link_shared() && target.contains("apple-darwin") {
let lib_name = find_llvm_lib_name("dylib");
Expand Down
20 changes: 10 additions & 10 deletions patches/support_ndk_llvm.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs
index dea574a5..498a2c7e 100644
index 2fe5ed32..937a57fb 100644
--- a/compiler/rustc_codegen_llvm/src/abi.rs
+++ b/compiler/rustc_codegen_llvm/src/abi.rs
@@ -433,7 +433,7 @@ fn apply_attrs_llfn(
@@ -438,7 +438,7 @@ fn apply_attrs_llfn(

let apply_range_attr = |idx: AttributePlace, scalar: rustc_target::abi::Scalar| {
if cx.sess().opts.optimize != config::OptLevel::No
Expand All @@ -11,7 +11,7 @@ index dea574a5..498a2c7e 100644
&& matches!(scalar.primitive(), Int(..))
// If the value is a boolean, the range is 0..2 and that ultimately
// become 0..0 when the type becomes i1, which would be rejected
@@ -570,7 +570,7 @@ fn apply_attrs_callsite(&self, bx: &mut Builder<'_, 'll, 'tcx>, callsite: &'ll V
@@ -569,7 +569,7 @@ fn apply_attrs_callsite(&self, bx: &mut Builder<'_, 'll, 'tcx>, callsite: &'ll V
_ => {}
}
if bx.cx.sess().opts.optimize != config::OptLevel::No
Expand All @@ -21,23 +21,23 @@ index dea574a5..498a2c7e 100644
&& matches!(scalar.primitive(), Int(..))
// If the value is a boolean, the range is 0..2 and that ultimately
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 01aae24a..cc2fc532 100644
index c836dd54..70807c9b 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -131,7 +131,7 @@ pub(crate) unsafe fn create_module<'ll>(
}
}
@@ -121,7 +121,7 @@ pub(crate) unsafe fn create_module<'ll>(
let mut target_data_layout = sess.target.data_layout.to_string();
let llvm_version = llvm_util::get_version();

- if llvm_version < (19, 0, 0) {
+ if llvm_version < (19, 0, 0) || true {
if sess.target.arch == "aarch64" || sess.target.arch.starts_with("arm64") {
// LLVM 19 sets -Fn32 in its data layout string for 64-bit ARM
// Earlier LLVMs leave this default, so remove it.
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index ed12318c..870a1d0b 100644
index 72b03fa0..988cab44 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -401,7 +401,7 @@ extern "C" LLVMAttributeRef
@@ -395,7 +395,7 @@ extern "C" LLVMAttributeRef
LLVMRustCreateRangeAttribute(LLVMContextRef C, unsigned NumBits,
const uint64_t LowerWords[],
const uint64_t UpperWords[]) {
Expand All @@ -46,7 +46,7 @@ index ed12318c..870a1d0b 100644
return LLVMCreateConstantRangeAttribute(C, Attribute::Range, NumBits,
LowerWords, UpperWords);
#else
@@ -2051,7 +2051,7 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
@@ -2041,7 +2041,7 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
}
}
if (DiagnosticHandlerCallback) {
Expand Down

0 comments on commit 52b7644

Please sign in to comment.