Unverified Commit de8ae731 authored by Maxim Baz's avatar Maxim Baz Committed by GitHub

Support aarch64 Linux with page size >= 16k (#41229)

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! 🙂 
parent 5d7d7391
...@@ -1361,6 +1361,7 @@ jobs: ...@@ -1361,6 +1361,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: >- build: >-
set -e && set -e &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup toolchain install "${RUST_TOOLCHAIN}" && rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-gnu && rustup target add aarch64-unknown-linux-gnu &&
...@@ -1412,6 +1413,7 @@ jobs: ...@@ -1412,6 +1413,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: >- build: >-
set -e && 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 && 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 toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment