|
| 1 | +From 23d818d3c7fba4658248f17fd7b8993199242aa9 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Hans Wennborg < [email protected]> |
| 3 | +Date: Fri, 22 Aug 2025 10:34:47 -0700 |
| 4 | +Subject: [PATCH] [rust] Define __rust_alloc_error_handler_should_panic_v2 |
| 5 | + |
| 6 | +https://github.com/rust-lang/rust/pull/143387 made |
| 7 | +__rust_alloc_error_handler_should_panic a function. |
| 8 | + |
| 9 | +The new definition is needed when rolling Rust past that PR. We can |
| 10 | +remove the old symbol afterwards. |
| 11 | + |
| 12 | +Bug: 440481922 |
| 13 | +Change-Id: I3340edd6d96d76de14942af67939978140430424 |
| 14 | +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6875644 |
| 15 | +Commit-Queue: Arthur Eubanks < [email protected]> |
| 16 | +Reviewed-by: Arthur Eubanks < [email protected]> |
| 17 | +Auto-Submit: Hans Wennborg < [email protected]> |
| 18 | +Commit-Queue: Hans Wennborg < [email protected]> |
| 19 | +Cr-Commit-Position: refs/heads/main@{#1505162} |
| 20 | + |
| 21 | +Upstream-Status: Backport [https://chromiumdash.appspot.com/commit/23d818d3c7fba4658248f17fd7b8993199242aa9] |
| 22 | +--- |
| 23 | + build/rust/allocator/lib.rs | 7 +++++++ |
| 24 | + 1 file changed, 7 insertions(+) |
| 25 | + |
| 26 | +diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs |
| 27 | +index 29b3af1274fb36..a7fa7a470f0001 100644 |
| 28 | +--- a/build/rust/allocator/lib.rs |
| 29 | ++++ b/build/rust/allocator/lib.rs |
| 30 | +@@ -90,7 +90,14 @@ mod both_allocators { |
| 31 | + #[linkage = "weak"] |
| 32 | + fn __rust_no_alloc_shim_is_unstable_v2() {} |
| 33 | + |
| 34 | ++ #[rustc_std_internal_symbol] |
| 35 | ++ #[linkage = "weak"] |
| 36 | ++ fn __rust_alloc_error_handler_should_panic_v2() -> u8 { |
| 37 | ++ 0 |
| 38 | ++ } |
| 39 | ++ |
| 40 | + // Mangle the symbol name as rustc expects. |
| 41 | ++ // TODO(crbug.com/440481922): Remove this after rolling past https://github.com/rust-lang/rust/pull/143387 |
| 42 | + #[rustc_std_internal_symbol] |
| 43 | + #[allow(non_upper_case_globals)] |
| 44 | + #[linkage = "weak"] |
0 commit comments