Skip to content

Commit 9cd5751

Browse files
committed
switch to GCC 14.2.0 to support node v22+
1 parent 84ff5a8 commit 9cd5751

3 files changed

Lines changed: 17 additions & 54 deletions

File tree

recipes/arm64-musl/55596.diff

Lines changed: 0 additions & 40 deletions
This file was deleted.

recipes/arm64-musl/Dockerfile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,25 @@ RUN apk add --no-cache \
2323
xz \
2424
patch \
2525
# this is required to support building v16 on python 3.12
26-
py3-packaging
27-
28-
RUN cd /opt \
29-
&& curl -O https://musl.cc/aarch64-linux-musl-cross.tgz \
30-
&& tar xzf aarch64-linux-musl-cross.tgz
26+
py3-packaging \
27+
# extra packages required for creating the musl bases cross-compiler
28+
rsync make gcc g++ bzip2 git
29+
30+
COPY <<-EOF /config/config.mak
31+
# We only set the variables that are really needed, others are the sane defaults from the repo itself
32+
TARGET = aarch64-linux-musl
33+
GCC_VER = 14.2.0
34+
OUTPUT = /opt/aarch64-linux-musl-cross
35+
EOF
36+
37+
RUN git clone https://github.com/richfelker/musl-cross-make /musl-cross-make && \
38+
cd /musl-cross-make && \
39+
make -I /config -j$(getconf _NPROCESSORS_ONLN) && \
40+
make -I /config install && \
41+
cd / && \
42+
rm -rf /musl-cross-make
3143

3244
COPY --chown=node:node run.sh /home/node/run.sh
33-
COPY --chown=node:node 55596.diff /home/node/55596.diff
3445
COPY --chown=node:node 51256-v16.diff /home/node/51256-v16.diff
3546

3647
VOLUME /home/node/.ccache

recipes/arm64-musl/run.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ if [ "$major" == "16" ] ; then
5151
patch -d tools -p1 < /home/node/2888.diff
5252
fi
5353

54-
# Patch needed to support compilation of Node 22 using musl
55-
# @see https://github.com/nodejs/node/issues/55596#issuecomment-2451411974
56-
# Although the GCC version in Alpine 3.22 is 14, The musl toolchain used is compiled using 11.2 (see https://musl.cc/)
57-
# recompiling musl is a step too far, so we add a simple patch that allows us to compile v22
58-
if [ "$major" == "22" ]; then
59-
patch -p1 < /home/node/55596.diff
60-
fi
61-
6254
export CC_host="ccache gcc"
6355
export CXX_host="ccache g++"
6456
export CC="ccache /opt/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc"

0 commit comments

Comments
 (0)