Skip to content

Commit

Permalink
feat: Add cross wrappers for GNU containers
Browse files Browse the repository at this point in the history
Cross wrappers for musl containers are already provided by crossdev[0].
To achieve the save effect on Debian containers, create similar
wrappers.
  • Loading branch information
vadorovsky committed Oct 27, 2024
1 parent bea3ddf commit 5d1959e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions containers/Dockerfile.cross-aarch64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ RUN dpkg --add-architecture arm64 \
&& ./llvm.sh 18 \
&& rm -f llvm.sh \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /etc/clang/cross \
&& useradd -m -G users -s /bin/bash cross

COPY clang-cfg/aarch64-unknown-linux-gnu.cfg /etc/clang/cross
COPY wrappers/aarch64-unknown-linux-gnu-clang /usr/bin
COPY wrappers/aarch64-unknown-linux-gnu-clang++ /usr/bin

USER cross
WORKDIR /home/cross

Expand Down
4 changes: 4 additions & 0 deletions containers/Dockerfile.cross-riscv64gc-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ RUN dpkg --add-architecture riscv64 \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -G users -s /bin/bash cross

COPY clang-cfg/riscv64-unknown-linux-gnu.cfg /etc/clang/cross
COPY wrappers/riscv64-unknown-linux-gnu-clang /usr/bin
COPY wrappers/riscv64-unknown-linux-gnu-clang++ /usr/bin

USER cross
WORKDIR /home/cross

Expand Down
3 changes: 3 additions & 0 deletions containers/clang-cfg/aarch64-unknown-linux-gnu.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sysroot=/usr/aarch64-unknown-linux-gnu
--target=aarch64-unknown-linux-gnu
-fuse-ld=lld
3 changes: 3 additions & 0 deletions containers/clang-cfg/riscv64-unknown-linux-gnu.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sysroot=/usr/riscv64-unknown-linux-gnu
--target=riscv64-unknown-linux-gnu
-fuse-ld=lld
2 changes: 2 additions & 0 deletions containers/wrappers/aarch64-unknown-linux-gnu-clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec clang --no-default-config --config="/etc/clang/cross/aarch64-unknown-linux-gnu.cfg" ${@}
2 changes: 2 additions & 0 deletions containers/wrappers/aarch64-unknown-linux-gnu-clang++
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec clang++ --no-default-config --config="/etc/clang/cross/aarch64-unknown-linux-gnu.cfg" ${@}
2 changes: 2 additions & 0 deletions containers/wrappers/riscv64-unknown-linux-gnu-clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec clang --no-default-config --config="/etc/clang/cross/riscv64-unknown-linux-gnu.cfg" ${@}
2 changes: 2 additions & 0 deletions containers/wrappers/riscv64-unknown-linux-gnu-clang++
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec clang++ --no-default-config --config="/etc/clang/cross/riscv64-unknown-linux-gnu.cfg" ${@}

0 comments on commit 5d1959e

Please sign in to comment.