From 4b0b3d83ca787718407dc3508c2094a47fb3ceda Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Thu, 20 Jun 2024 13:51:12 -0500 Subject: [PATCH] github: build aarch64-linux binaries with 16k-page jemalloc jemalloc builds in the system page size as part of its (internal) ABI at compile time, which means that if you build with a smaller page size than what your system allows, it doesn't work. In particular, this impacts Linux on Apple Silicon, which doesn't natively support 4k pages which are the default. Set it to 16k so that the prebuilt binaries work OOTB. Signed-off-by: Austin Seipp --- .github/workflows/upload_buck2.yml | 6 ++++++ Cross.toml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 Cross.toml diff --git a/.github/workflows/upload_buck2.yml b/.github/workflows/upload_buck2.yml index bbe6b2eee1baa..4edea2ec62cf4 100644 --- a/.github/workflows/upload_buck2.yml +++ b/.github/workflows/upload_buck2.yml @@ -93,6 +93,12 @@ jobs: env: RUSTFLAGS: "-C strip=debuginfo -C codegen-units=1" run: | + # aarch64-linux builds need JEMALLOC_SYS_WITH_LG_PAGE=16 + # this is for e.g. linux running on apple silicon with native 16k pages + if [[ "${{ matrix.target.triple }}" == aarch64-unknown-linux* ]]; then + export JEMALLOC_SYS_WITH_LG_PAGE=16 + fi + if [ -n "${{ matrix.target.cross }}" ]; then CARGO=cross else diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000000000..f746d271b7267 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[build.env] +passthrough = [ "JEMALLOC_SYS_WITH_LG_PAGE" ]