From de8ae7313f9b4cf84825ed1e330976427dc10fc8 Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Wed, 12 Oct 2022 08:13:06 +0200 Subject: [PATCH] Support aarch64 Linux with page size >= 16k (#41229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/vercel/next.js/issues/39311 Backport of upstream patch https://github.com/swc-project/swc/pull/6075 More details are described in https://github.com/swc-project/swc/issues/5967 I confirm that the swc plugin, when compiled with this patch, works on my Linux aarch64 machine. This will work on all aarch64 Linux systems, the patch is configuring jemalloc to use largest possible page size, instead of taking the value from the machine where you are compiling it. And here's the compiled binary, if you want to give it a go! [next-swc.linux-arm64-gnu.node.zip](https://github.com/vercel/next.js/files/9728262/next-swc.linux-arm64-gnu.node.zip) Let me know if that makes sense! 🙂 --- .github/workflows/build_test_deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 2c9885691119e..8afc07c12e76b 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -1361,6 +1361,7 @@ jobs: docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 build: >- set -e && + export JEMALLOC_SYS_WITH_LG_PAGE=16 && rustup toolchain install "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" && rustup target add aarch64-unknown-linux-gnu && @@ -1412,6 +1413,7 @@ jobs: docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine build: >- set -e && + export JEMALLOC_SYS_WITH_LG_PAGE=16 && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi && rustup toolchain install "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&