Skip to content

Commit 1fb5681

Browse files
committed
github: Add a job for cross compiling the toolchain for linux on aarch64
1 parent 1ab52ba commit 1fb5681

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,47 @@ jobs:
7676
llvm-mingw-*.tar.xz
7777
retention-days: 7
7878

79+
# Crosscompile the toolchain for running on Linux on a different architecture, bundle the runtime
80+
# libraries that were built in the 'linux' step above.
81+
linux-cross-aarch64:
82+
if: (github.event_name != 'schedule') || (github.repository == 'mstorsjo/llvm-mingw')
83+
needs: [linux, prepare]
84+
runs-on: ubuntu-20.04
85+
steps:
86+
- uses: actions/checkout@v3
87+
- name: Build
88+
env:
89+
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}}
90+
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}}
91+
run: |
92+
sudo apt-get update && sudo apt-get install ninja-build g++-aarch64-linux-gnu
93+
./build-all.sh $(pwd)/install/llvm-mingw --disable-clang-tools-extra --disable-lldb --no-runtimes --host=aarch64-linux-gnu
94+
.github/workflows/store-version.sh install/llvm-mingw/versions.txt
95+
- uses: actions/download-artifact@v3
96+
with:
97+
name: linux-toolchain
98+
- name: Unpack native toolchain
99+
run: |
100+
tar -Jxf llvm-mingw-*.tar.xz
101+
rm llvm-mingw-*.tar.xz
102+
mv llvm-mingw* llvm-mingw-native
103+
- name: Assemble the cross-built toolchain
104+
env:
105+
TAG: ${{needs.prepare.outputs.TAG}}
106+
run: |
107+
./prepare-cross-toolchain-unix.sh $(pwd)/llvm-mingw-native $(pwd)/install/llvm-mingw
108+
cd install
109+
DISTRO=ubuntu-$(grep DISTRIB_RELEASE /etc/lsb-release | cut -f 2 -d =)-aarch64
110+
NAME=llvm-mingw-$TAG-ucrt-$DISTRO
111+
mv llvm-mingw $NAME
112+
tar -Jcf ../$NAME.tar.xz $NAME
113+
- uses: actions/upload-artifact@v3
114+
with:
115+
name: linux-aarch64-toolchain
116+
path: |
117+
llvm-mingw-*.tar.xz
118+
retention-days: 7
119+
79120
# Build a cross compiler for Linux, targeting Windows, with assertions enabled.
80121
#
81122
# The scheduled builds are made with the latest git version of llvm-project
@@ -572,7 +613,7 @@ jobs:
572613
if: (github.event_name == 'schedule') && (github.repository == 'mstorsjo/llvm-mingw')
573614
permissions:
574615
contents: write
575-
needs: [linux, macos, linux-cross-windows, test-toolchain, linux-test-cross-build-ffmpeg, test-ffmpeg]
616+
needs: [linux, linux-cross-aarch64, macos, linux-cross-windows, test-toolchain, linux-test-cross-build-ffmpeg, test-ffmpeg]
576617
runs-on: ubuntu-latest
577618
steps:
578619
- name: Download all artifacts

0 commit comments

Comments
 (0)