Skip to content

Commit 53a5857

Browse files
committed
bootstrap: Build jemalloc for AArch64 with support for 64K pages
By default, jemalloc is built to only support the same page size as the host machine. For AArch64 targets, set an env variable so that jemalloc is built with support for page sizes up to 64K regardless of the host machine.
1 parent 319f529 commit 53a5857

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,15 @@ pub fn rustc_cargo_env(
12071207
rustc_llvm_env(builder, cargo, target)
12081208
}
12091209
}
1210+
1211+
// Build jemalloc on AArch64 with support for page sizes up to 64K
1212+
// See: https://github.com/rust-lang/rust/pull/135081
1213+
if builder.config.jemalloc
1214+
&& target.starts_with("aarch64")
1215+
&& env::var_os("JEMALLOC_SYS_WITH_LG_PAGE").is_none()
1216+
{
1217+
cargo.env("JEMALLOC_SYS_WITH_LG_PAGE", "16");
1218+
}
12101219
}
12111220

12121221
/// Pass down configuration from the LLVM build into the build of

0 commit comments

Comments
 (0)