Skip to content

Commit 09662f2

Browse files
Rollup merge of #145353 - CathalMullan:jemalloc-tools, r=Kobzol
bootstrap: Fix jemalloc 64K page support for aarch64 tools Resolves #133748 The prior page size fix only targeted the compile build step, not the tools step: #135081 Also note that since `miri` always uses jemalloc, I didn't copy the `builder.config.jemalloc(target)` check to the tools section. Tested by running `strings` on the compiled `miri` binary to see the LG_PAGE value. Before: ``` > strings miri | grep '^LG_PAGE' LG_PAGE 14 ``` After: ``` > strings miri | grep '^LG_PAGE' LG_PAGE 16 ``` May also need a separate fix for the standalone miri repository: rust-lang/miri#4514 (likely a change needed in miri-script?)
2 parents adedc2b + ebcbcc8 commit 09662f2

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
@@ -1397,6 +1397,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
13971397

13981398
// Build jemalloc on AArch64 with support for page sizes up to 64K
13991399
// See: https://github.com/rust-lang/rust/pull/135081
1400+
// See also the "JEMALLOC_SYS_WITH_LG_PAGE" setting in the tool build step.
14001401
if builder.config.jemalloc(target)
14011402
&& target.starts_with("aarch64")
14021403
&& 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
@@ -229,6 +229,14 @@ pub fn prepare_tool_cargo(
229229
// own copy
230230
cargo.env("LZMA_API_STATIC", "1");
231231

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

0 commit comments

Comments
 (0)