Skip to content

Commit ebcbcc8

Browse files
committed
bootstrap: Fix jemalloc 64K page support for aarch64 tools
1 parent 6355cd3 commit ebcbcc8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
13911391

13921392
// Build jemalloc on AArch64 with support for page sizes up to 64K
13931393
// See: https://github.com/rust-lang/rust/pull/135081
1394+
// See also the "JEMALLOC_SYS_WITH_LG_PAGE" setting in the tool build step.
13941395
if builder.config.jemalloc(target)
13951396
&& target.starts_with("aarch64")
13961397
&& env::var_os("JEMALLOC_SYS_WITH_LG_PAGE").is_none()

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ pub fn prepare_tool_cargo(
257257
// own copy
258258
cargo.env("LZMA_API_STATIC", "1");
259259

260+
// Build jemalloc on AArch64 with support for page sizes up to 64K
261+
// See: https://github.com/rust-lang/rust/pull/135081
262+
// Note that `miri` always uses jemalloc. As such, there is no checking of the jemalloc build flag.
263+
// See also the "JEMALLOC_SYS_WITH_LG_PAGE" setting in the compile build step.
264+
if target.starts_with("aarch64") && env::var_os("JEMALLOC_SYS_WITH_LG_PAGE").is_none() {
265+
cargo.env("JEMALLOC_SYS_WITH_LG_PAGE", "16");
266+
}
267+
260268
// CFG_RELEASE is needed by rustfmt (and possibly other tools) which
261269
// import rustc-ap-rustc_attr which requires this to be set for the
262270
// `#[cfg(version(...))]` attribute.

0 commit comments

Comments
 (0)