File: rust-no-alloc-shim.patch

package info (click to toggle)
chromium 143.0.7499.40-1~deb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie-proposed-updates
  • size: 6,343,816 kB
  • sloc: cpp: 35,786,473; ansic: 7,477,456; javascript: 4,249,966; python: 1,480,744; xml: 764,791; asm: 710,816; pascal: 188,028; sh: 89,200; perl: 88,692; objc: 79,984; sql: 57,625; cs: 42,265; fortran: 24,101; makefile: 22,508; tcl: 15,277; php: 14,018; yacc: 9,043; ruby: 7,553; awk: 3,720; lisp: 3,233; lex: 1,330; ada: 727; jsp: 228; sed: 36
file content (36 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
author: Andres Salomon <dilinger@debian.org>

work around the following build error (likely required by a newer rustc):

ld.lld-19: error: undefined symbol: __rust_no_alloc_shim_is_unstable
>>> referenced by raw_vec.rs:0 (library/alloc/src/raw_vec.rs:0)
>>>               std-204c535bb1c72e7d.std.83f6108400cae6c8-cgu.04.rcgu.o:(core::slice::sort::stable::driftsort_main::h2af4412729044fb7) in archive prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd.rlib

This reverts commit 8393b61ba876c8e1614275c97767f9b06b889f48
Author: Hans Wennborg <hans@chromium.org>
Date:   Mon Jun 30 07:45:33 2025 -0700

    [rust] Remove __rust_no_alloc_shim_is_unstable

--- a/build/rust/allocator/lib.rs
+++ b/build/rust/allocator/lib.rs
@@ -96,7 +96,19 @@ mod both_allocators {
         0
     }
 
+    // TODO(crbug.com/422538133) Remove after rolling past
+    // https://github.com/rust-lang/rust/pull/141061
+    #[unsafe(no_mangle)]
+    #[linkage = "weak"]
+    static __rust_no_alloc_shim_is_unstable: u8 = 0;
+
     // Mangle the symbol name as rustc expects.
+    // TODO(crbug.com/440481922): Remove this after rolling past https://github.com/rust-lang/rust/pull/143387
+    #[rustc_std_internal_symbol]
+    #[allow(non_upper_case_globals)]
+    #[linkage = "weak"]
+    static __rust_alloc_error_handler_should_panic: u8 = 0;
+
     #[rustc_std_internal_symbol]
     #[allow(non_upper_case_globals)]
     #[linkage = "weak"]