Skip to content

Commit 30e5be4

Browse files
authored
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 bef93cf + ebcbcc8 commit 30e5be4

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

13531353
// Build jemalloc on AArch64 with support for page sizes up to 64K
13541354
// See: https://github.com/rust-lang/rust/pull/135081
1355+
// See also the "JEMALLOC_SYS_WITH_LG_PAGE" setting in the tool build step.
13551356
if builder.config.jemalloc(target)
13561357
&& target.starts_with("aarch64")
13571358
&& 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
@@ -226,6 +226,14 @@ pub fn prepare_tool_cargo(
226226
// own copy
227227
cargo.env("LZMA_API_STATIC", "1");
228228

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

0 commit comments

Comments
 (0)