Skip to content

Commit 9cd4643

Browse files
committed
try allocator libraries
1 parent 2cb0610 commit 9cd4643

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

examples/android/.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
99
common --enable_platform_specific_config
1010

11+
# Enable Rust-based allocator library with mangled symbols for Rust 1.89.0+
12+
# This is required when using recent Rust versions that mangle allocator symbols
13+
# and when rustc is not used as the final linker (e.g., Android apps)
14+
build --@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols=true
15+
1116
# Enable the only currently supported report type
1217
# https://bazel.build/reference/command-line-reference#flag--combined_report
1318
coverage --combined_report=lcov

examples/android/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ bazel_dep(name = "rules_android_ndk", version = "0.1.2")
3131
# Rust toolchain
3232
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
3333
rust.toolchain(
34+
allocator_library = "@rules_rust//ffi/rs/allocator_library",
3435
extra_target_triples = [
3536
"aarch64-linux-android",
3637
],

examples/ios/.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
99
common --enable_platform_specific_config
1010

11+
# Enable Rust-based allocator library with mangled symbols for Rust 1.89.0+
12+
# This is required when using recent Rust versions that mangle allocator symbols
13+
# and when rustc is not used as the final linker (e.g., iOS/macOS apps)
14+
build --@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols=true
15+
1116
# Enable the only currently supported report type
1217
# https://bazel.build/reference/command-line-reference#flag--combined_report
1318
coverage --combined_report=lcov

examples/ios/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ bazel_dep(name = "rules_cc", version = "0.2.4")
2525
# Rust toolchain
2626
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
2727
rust.toolchain(
28+
allocator_library = "@rules_rust//ffi/rs/allocator_library",
2829
extra_target_triples = [
2930
"aarch64-apple-ios-sim",
3031
"x86_64-apple-ios",

examples/ios_build/.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
99
common --enable_platform_specific_config
1010

11+
# Enable Rust-based allocator library with mangled symbols for Rust 1.89.0+
12+
# This is required when using recent Rust versions that mangle allocator symbols
13+
# and when rustc is not used as the final linker (e.g., iOS/macOS apps)
14+
build --@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols=true
15+
1116
# Enable the only currently supported report type
1217
# https://bazel.build/reference/command-line-reference#flag--combined_report
1318
coverage --combined_report=lcov

examples/ios_build/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ bazel_dep(name = "platforms", version = "1.0.0")
2727
# Rust toolchain
2828
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
2929
rust.toolchain(
30+
allocator_library = "@rules_rust//ffi/rs/allocator_library",
3031
extra_target_triples = [
3132
"aarch64-apple-darwin",
3233
"aarch64-apple-ios-sim",

0 commit comments

Comments
 (0)