Skip to content

Commit eb5d8a2

Browse files
committed
fix(ci): Add cross-compilation toolchain for arm64
This adds the cross compilation toolchain and required environment variables to the release workflows and local Dockerfile. These will end up in the dev image, but for now we can specify them manually. Signed-off-by: Scott Fleener <[email protected]>
1 parent 995e549 commit eb5d8a2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,22 @@ jobs:
145145
env:
146146
LINKERD2_PROXY_VENDOR: ${{ github.repository_owner }}
147147
LINKERD2_PROXY_VERSION: ${{ needs.meta.outputs.version }}
148+
# TODO: add to dev image
149+
AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_gnu: "-fuse-ld=/usr/aarch64-linux-gnu/bin/ld"
150+
AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_musl: "-fuse-ld=/usr/aarch64-linux-gnu/bin/ld"
148151
steps:
149152
# TODO: add to dev image
150153
- name: Install MiniGW
151154
if: matrix.os == 'windows'
152155
run: apt-get update && apt-get install mingw-w64 -y
156+
# TODO: add to dev image
157+
- name: Install cross compilation toolchain
158+
if: matrix.arch == 'arm64'
159+
run: apt-get update && apt-get install --no-install-recommends -y \
160+
g++-aarch64-linux-gnu \
161+
gcc-aarch64-linux-gnu \
162+
binutils-aarch64-linux-gnu \
163+
libc6-dev-arm64-cross
153164
- name: Configure git
154165
run: git config --global --add safe.directory "$PWD" # actions/runner#2033
155166
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ FROM $LINKERD2_IMAGE as linkerd2
1414
FROM --platform=$BUILDPLATFORM $RUST_IMAGE as fetch
1515

1616
ARG PROXY_FEATURES=""
17+
ARG TARGETARCH="amd64"
1718
RUN apt-get update && \
1819
apt-get install -y time && \
1920
if [[ "$PROXY_FEATURES" =~ .*meshtls-boring.* ]] ; then \
2021
apt-get install -y golang ; \
2122
fi && \
23+
case "$TARGETARCH" in \
24+
amd64) true ;; \
25+
arm64) apt-get install --no-install-recommends -y libc6-dev-arm64-cross gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu ;; \
26+
esac && \
2227
rm -rf /var/lib/apt/lists/*
2328

2429
ENV CARGO_NET_RETRY=10
@@ -33,7 +38,8 @@ RUN --mount=type=cache,id=cargo,target=/usr/local/cargo/registry \
3338
FROM fetch as build
3439
ENV CARGO_INCREMENTAL=0
3540
ENV RUSTFLAGS="-D warnings -A deprecated --cfg tokio_unstable"
36-
ARG TARGETARCH="amd64"
41+
ENV AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_gnu="-fuse-ld=/usr/aarch64-linux-gnu/bin/ld"
42+
ENV AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_musl="-fuse-ld=/usr/aarch64-linux-gnu/bin/ld"
3743
ARG PROFILE="release"
3844
ARG LINKERD2_PROXY_VERSION=""
3945
ARG LINKERD2_PROXY_VENDOR=""

0 commit comments

Comments
 (0)