diff --git a/bazel/BUILD.jemalloc b/bazel/BUILD.jemalloc index 0d6d748cd1c4..ca5d6f6e421d 100644 --- a/bazel/BUILD.jemalloc +++ b/bazel/BUILD.jemalloc @@ -13,7 +13,13 @@ configure_make( copts = ["-fPIC"], args = ["-j"], out_shared_libs = ["libjemalloc.so"], - configure_options = ["--disable-static", "--enable-prof"], + # See https://salsa.debian.org/debian/jemalloc/-/blob/c0a88c37a551be7d12e4863435365c9a6a51525f/debian/rules#L8-23 + # for why we are setting "--with-lg-page" on non x86 hardware here. + configure_options = ["--disable-static", "--enable-prof"] + + select({ + "@platforms//cpu:x86_64": [], + "//conditions:default": ["--with-lg-page=16"], + }), visibility = ["//visibility:public"], )