Skip to content

Commit

Permalink
update Linux clang toolchain to support cross compiling
Browse files Browse the repository at this point in the history
* moves a necessary header file to a new location
* also cleans up the Linux Sysroot workflow
  • Loading branch information
ParkMyCar committed Sep 1, 2024
1 parent ca2f1dd commit 0aa92fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,21 @@ jobs:
unwind \
builtins
# Package the toolchain by copying everything listed from the following files:
#
# * bin.txt
# * include.txt
# * lib.txt
#
# Note: There is a header file `__config_site` that gets generated in a platform specific
# directory but to support cross compiling we move it into the normal `include` dir. This is
# bit hacky, but I've manually confirmed the file is the same for both architectures.
- name: package toolchain
run: |
mkdir package
mv llvm-project/build/include/$CLANG_TARGET/c++/v1/__config_site llvm-project/build/include/c++/v1/__config_site
for dir in bin include lib; do
mkdir package/$dir
cat clang/$dir.txt | while read -r val; do
Expand All @@ -160,12 +171,6 @@ jobs:
cd package
tar -cf - * | zstd --ultra -22 -o "../linux_$CLANG_ARCH.tar.zst"
- name: Upload Toolchain Artifact
uses: actions/upload-artifact@v4
with:
name: toolchains
path: "*.tar.zst"

- name: Upload toolchain to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
1 change: 0 additions & 1 deletion clang/include.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
c++
linux:$CLANG_TARGET
1 change: 0 additions & 1 deletion sysroot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ WORKDIR /downloads/gcc
RUN curl --fail-early --location "https://ftp.gnu.org/gnu/gcc/gcc-${LIBSTDCXX_VERSION}/gcc-${LIBSTDCXX_VERSION}.tar.xz" \
| tar --xz --extract --strip-components=1 --file -
RUN ./contrib/download_prerequisites
RUN --mount=source=echo_test.sh,target=/usr/bin/echo_test.sh echo_test.sh

FROM base_image AS build_image

Expand Down
8 changes: 0 additions & 8 deletions sysroot/echo_test.sh

This file was deleted.

0 comments on commit 0aa92fa

Please sign in to comment.