Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,14 @@ COPY --link --from=just /usr/local/bin/just /usr/local/bin/
FROM rust as rust-musl
RUN rustup target add \
aarch64-unknown-linux-musl \
armv7-unknown-linux-musleabihf \
x86_64-unknown-linux-musl
RUN --mount=type=cache,from=apt-base,source=/etc/apt,target=/etc/apt,ro \
--mount=type=cache,from=apt-base,source=/var/cache/apt,target=/var/cache/apt,sharing=locked \
--mount=type=cache,from=apt-base,source=/var/lib/apt/lists,target=/var/lib/apt/lists,sharing=locked \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
g++-aarch64-linux-gnu \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf \
libc6-dev-arm64-cross \
libc6-dev-armhf-cross
libc6-dev-arm64-cross

##
## Devcontainer
Expand Down Expand Up @@ -383,7 +379,6 @@ RUN --mount=type=cache,from=apt-base,source=/etc/apt,target=/etc/apt,ro \
# Link the gnu versions of ranlib to the musl toolchain.
# See: https://github.com/linkerd/linkerd2/issues/13350
RUN ln -s /usr/bin/aarch64-linux-gnu-ranlib /usr/bin/aarch64-linux-musl-ranlib && \
ln -s /usr/bin/arm-linux-gnueabihf-ranlib /usr/bin/arm-linux-musl-ranlib && \
ln -s /usr/bin/x86_64-linux-gnu-ranlib /usr/bin/x86_64-linux-musl-ranlib

RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
The `rust` container provides a Rust toolchain and associated utilities needed
to build and test Rust code. The `rust-musl` container provides the same
toolchain, but with the `musl` target installed with cross-compilation support
for arm64 and armv7.
for arm64.

### Rust in GitHub Actions

Expand Down
16 changes: 0 additions & 16 deletions bin/just-cargo
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ _target := if target == '' {

export RUSTFLAGS := env_var_or_default("RUSTFLAGS", "-D warnings") + if target == 'aarch64-unknown-linux-musl' {
' --codegen linker=aarch64-linux-gnu-gcc'
} else if target == 'armv7-unknown-linux-musleabihf' {
' --codegen linker=arm-linux-gnueabihf-gcc'
} else { '' }

_llvm-version := '19'
Expand All @@ -46,20 +44,6 @@ export CFLAGS_aarch64_unknown_linux_musl := '--sysroot=/usr/aarch64-linux-gnu'
export STRIP_aarch64_unknown_linux_musl := _strip
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS := _rustflags-self-contained

# linux/arm/v7 + gnueabihf
export AR_armv7_unknown_linux_gnueabihf := _ar
export CC_armv7_unknown_linux_gnueabihf := _clang
export CFLAGS_armv7_unknown_linux_gnueabihf := '--sysroot=/usr/arm-linux-gnueabihf'
export STRIP_armv7_unknown_linux_gnueabihf := _strip
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER := 'arm-linux-gnueabihf-gcc'

# linux/arm/v7 + musl
export AR_armv7_unknown_linux_musleabihf := _ar
export CC_armv7_unknown_linux_musleabihf := _clang
export CFLAGS_armv7_unknown_linux_musleabihf := '--sysroot=/usr/arm-linux-gnueabihf'
export STRIP_armv7_unknown_linux_musleabihf := _strip
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_RUSTFLAGS := _rustflags-self-contained

# linux/amd64 + gnu
export AR_x86_64_unknown_linux_gnu := _ar
export CC_x86_64_unknown_linux_gnu := _clang
Expand Down
Loading