From 07f15535d3333572419f86b955b0abe093761009 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Thu, 10 Jul 2025 11:47:47 +0000 Subject: [PATCH 1/2] rust allocator symbols: add new rustc_std_internal_symbol-s --- ffi/rs/allocator_library/allocator_library.rs | 12 ++++++++++++ test/integration/cc_common_link/MODULE.bazel | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ffi/rs/allocator_library/allocator_library.rs b/ffi/rs/allocator_library/allocator_library.rs index fb498d81d7..1572a331a7 100644 --- a/ffi/rs/allocator_library/allocator_library.rs +++ b/ffi/rs/allocator_library/allocator_library.rs @@ -80,7 +80,19 @@ fn __rust_alloc_error_handler(size: usize, align: usize) { #[rustc_std_internal_symbol] static mut __rust_alloc_error_handler_should_panic: u8 = 1; +// See https://github.com/rust-lang/rust/pull/143434. +#[linkage = "weak"] +#[rustc_std_internal_symbol] +fn __rust_alloc_error_handler_should_panic_v2() -> u8 { + return 1; +} + // See https://github.com/rust-lang/rust/issues/73632#issuecomment-1563462239 #[linkage = "weak"] #[rustc_std_internal_symbol] static mut __rust_no_alloc_shim_is_unstable: u8 = 0; + +// See https://github.com/rust-lang/rust/pull/141061. +#[linkage = "weak"] +#[rustc_std_internal_symbol] +fn __rust_no_alloc_shim_is_unstable_v2() {} diff --git a/test/integration/cc_common_link/MODULE.bazel b/test/integration/cc_common_link/MODULE.bazel index 249366e6ee..dccd473941 100644 --- a/test/integration/cc_common_link/MODULE.bazel +++ b/test/integration/cc_common_link/MODULE.bazel @@ -24,7 +24,7 @@ rust.toolchain( # Generate a toolchain to be used for rust-based allocator symbols. # A recent enough version of rustc that mangles the internal allocator symbols. -VERSION = "nightly/2025-04-08" +VERSION = "nightly/2025-07-08" rust.repository_set( name = "rust_with_alloc_mangling_linux_x86_64", From 960d0e612eb202d9ab91a68ab7d190a398f3c721 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Thu, 10 Jul 2025 13:43:13 +0000 Subject: [PATCH 2/2] update rust PR number --- ffi/rs/allocator_library/allocator_library.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffi/rs/allocator_library/allocator_library.rs b/ffi/rs/allocator_library/allocator_library.rs index 1572a331a7..27661f8754 100644 --- a/ffi/rs/allocator_library/allocator_library.rs +++ b/ffi/rs/allocator_library/allocator_library.rs @@ -80,7 +80,7 @@ fn __rust_alloc_error_handler(size: usize, align: usize) { #[rustc_std_internal_symbol] static mut __rust_alloc_error_handler_should_panic: u8 = 1; -// See https://github.com/rust-lang/rust/pull/143434. +// See https://github.com/rust-lang/rust/pull/143387. #[linkage = "weak"] #[rustc_std_internal_symbol] fn __rust_alloc_error_handler_should_panic_v2() -> u8 {