Skip to content

Commit

Permalink
github: build aarch64-linux binaries with 16k-page jemalloc
Browse files Browse the repository at this point in the history
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 <aseipp@pobox.com>
  • Loading branch information
thoughtpolice committed Jun 20, 2024
1 parent d835d86 commit bea47b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/upload_buck2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,6 @@ incremental = true
# For https://github.com/jimblandy/perf-event/pull/29
perf-event = { git = "https://github.com/krallin/perf-event.git", rev = "86224a9bc025d5d19f719542f27c8c629a08b167", version = "0.4" }
perf-event-open-sys = { git = "https://github.com/krallin/perf-event.git", rev = "86224a9bc025d5d19f719542f27c8c629a08b167", version = "4.0" }

[package.metadata.cross.build.env]
passthrough = [ "JEMALLOC_SYS_WITH_LG_PAGE" ]

0 comments on commit bea47b8

Please sign in to comment.