Skip to content

Commit 1bbe796

Browse files
committed
add new recipe for armv6l and Node.js 16 and later
Based on the existing arm6vl recipe, but using Ubuntu 18.04 and gcc/g++ 8 to match what we're using for the official armv7l builds.
1 parent 444f0de commit 1bbe796

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This list of officially supported platforms is available in the Node.js [BUILDIN
1414

1515
* **linux-x64-musl**: Linux x64 binaries compiled against [musl libc](https://www.musl-libc.org/) version 1.1.20. Primarily useful for users of Alpine Linux 3.9 and later. Linux x64 with musl is considered "Experimental" by Node.js but the Node.js test infrastructure includes some Alpine test servers so support is generally good. These Node.js builds require the `libstdc++` package to be installed on Alpine Linux, which is not installed by default. You can add this by running `apk add libstdc++`.
1616
* **linux-x86**: Linux x86 (32-bit) binaries compiled against libc 2.17, similar to the way the official [linux-x64 binaries are produced](https://github.com/nodejs/node/blob/master/BUILDING.md#official-binary-platforms-and-toolchains). 32-bit Linux binaries were dropped for Node.js 10 and 32-bit support is now considered "Experimental".
17-
* **linux-armv6l**: Linux ARMv6 binaries, cross-compiled on Ubuntu 16.04 with a [custom GCC 6 toolchain] in a similar manner to the official linux-armv7l binaries. Binaries are optimized for `armv6zk` which is suitable for Raspberry Pi devices (1, 1+ and Zero in particular). ARMv6 binaries were dropped from Node.js 12 and ARMv6 support is now considered "Experimental".
17+
* **linux-armv6l**: Linux ARMv6 binaries, cross-compiled on Ubuntu 16.04 with a [custom GCC 6 toolchain](https://github.com/rvagg/rpi-newer-crosstools) (for Node.js versions earlier than 16) or Ubuntu 18.04 with a [custom GCC 8 toolchain](https://github.com/rvagg/rpi-newer-crosstools) (for Node.js 16 and later) in a similar manner to the official linux-armv7l binaries. Binaries are optimized for `armv6zk` which is suitable for Raspberry Pi devices (1, 1+ and Zero in particular). ARMv6 binaries were dropped from Node.js 12 and ARMv6 support is now considered "Experimental".
1818

1919
"Experimental" status for Node.js is defined as:
2020
> Experimental: May not compile or test suite may not pass. The core team does not create releases for these platforms. Test failures on experimental platforms do not block releases. Contributions to improve support for these platforms are welcome.

recipes/armv6l/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM ubuntu:18.04
2+
3+
RUN addgroup --gid 1000 node \
4+
&& adduser --gid 1000 --uid 1000 --disabled-password --gecos node node
5+
6+
RUN apt-get update \
7+
&& apt-get dist-upgrade -y \
8+
&& apt-get install -y software-properties-common \
9+
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
10+
&& apt-get update \
11+
&& apt-get install -y \
12+
git \
13+
curl \
14+
g++-8 \
15+
gcc-8 \
16+
gcc-8-multilib \
17+
g++-8-multilib \
18+
make \
19+
python3 \
20+
ccache \
21+
xz-utils
22+
23+
RUN git clone --depth=1 https://github.com/rvagg/rpi-newer-crosstools \
24+
/opt/rpi-newer-crosstools/
25+
26+
COPY --chown=node:node run.sh /home/node/run.sh
27+
28+
VOLUME /home/node/.ccache
29+
VOLUME /out
30+
VOLUME /home/node/node.tar.xz
31+
32+
USER node
33+
34+
ENTRYPOINT [ "/home/node/run.sh" ]

recipes/armv6l/run.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
release_urlbase="$1"
7+
disttype="$2"
8+
customtag="$3"
9+
datestring="$4"
10+
commit="$5"
11+
fullversion="$6"
12+
source_url="$7"
13+
config_flags=
14+
15+
cd /home/node
16+
17+
tar -xf node.tar.xz
18+
cd "node-${fullversion}"
19+
20+
export CC_host="ccache gcc-8 -m32"
21+
export CXX_host="ccache g++-8 -m32"
22+
export CC="ccache /opt/rpi-newer-crosstools/x64-gcc-8.3.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-gcc -march=armv6zk"
23+
export CXX="ccache /opt/rpi-newer-crosstools/x64-gcc-8.3.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-g++ -march=armv6zk"
24+
25+
make -j$(getconf _NPROCESSORS_ONLN) binary V= \
26+
DESTCPU="arm" \
27+
ARCH="armv6l" \
28+
VARIATION="" \
29+
DISTTYPE="$disttype" \
30+
CUSTOMTAG="$customtag" \
31+
DATESTRING="$datestring" \
32+
COMMIT="$commit" \
33+
RELEASE_URLBASE="$release_urlbase" \
34+
CONFIG_FLAGS="$config_flags"
35+
36+
mv node-*.tar.?z /out/

recipes/armv6l/should-build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash -xe
2+
3+
__dirname=$1
4+
fullversion=$2
5+
6+
. ${__dirname}/_decode_version.sh
7+
8+
decode "$fullversion"
9+
10+
test "$major" -ge "16"

0 commit comments

Comments
 (0)