Skip to content

Commit

Permalink
GHA main: Add Linux AArch64 job
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Jan 17, 2025
1 parent f4695f9 commit be42dee
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
43 changes: 35 additions & 8 deletions .github/actions/1-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,39 @@ runs:
run: |
set -eux
export DEBIAN_FRONTEND=noninteractive
sudo dpkg --add-architecture i386
arch='${{ inputs.arch }}'
if [[ $arch == x86_64 ]]; then
sudo dpkg --add-architecture i386
fi
sudo apt-get -q update
# Don't use latest gdb v10+ from Ubuntu toolchain PPA with regressions, use official v9
sudo apt-get -yq install \
git-core cmake g++-multilib \
libcurl4 libcurl4:i386 libzstd-dev \
curl gdb=9.1-0ubuntu1 p7zip-full tzdata unzip zip python3-pip
packages=( \
git-core cmake g++ \
libcurl4 libzstd-dev \
curl p7zip-full tzdata unzip zip python3-pip \
)
if [[ $arch == x86_64 ]]; then
# Don't use latest gdb v10+ from Ubuntu toolchain PPA with regressions, use official v9
packages+=(g++-multilib libcurl4:i386 gdb=9.1-0ubuntu1)
elif [[ $arch == aarch64 ]]; then
packages+=(gdb)
fi
sudo apt-get -yq install ${packages[@]}
# Make sure to link libzstd statically
sudo rm /usr/lib/x86_64-linux-gnu/libzstd.so
sudo rm /usr/lib/$arch-linux-gnu/libzstd.so
- name: 'Linux: Download & extract clang' # into ../clang
if: runner.os == 'Linux'
shell: bash
run: |
set -eux
cd ..
arch='${{ inputs.arch }}'
extraSuffix=''
if [[ $arch == x86_64 ]]; then
extraSuffix='-ubuntu-18.04'
fi
curl -fL --retry 3 --max-time 300 -o clang.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ inputs.clang_version }}/clang+llvm-${{ inputs.clang_version }}-x86_64-linux-gnu-ubuntu-18.04.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ inputs.clang_version }}/clang+llvm-${{ inputs.clang_version }}-$arch-linux-gnu$extraSuffix.tar.xz
mkdir clang
tar -xf clang.tar.xz --strip 1 -C clang
rm clang.tar.xz
Expand Down Expand Up @@ -105,7 +120,19 @@ runs:
ld --version
- name: Install ninja
if: inputs.arch != 'aarch64'
uses: symmetryinvestments/gha-setup-ninja@v2
- name: Install ninja (Linux AArch64)
if: inputs.arch == 'aarch64'
shell: bash
run: |
set -eux
cd ..
curl -fL --retry 3 --max-time 60 -O https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux-aarch64.zip
mkdir ninja
unzip ninja-linux-aarch64.zip -d ninja
rm ninja-linux-aarch64.zip
sudo ln -sf $PWD/ninja/ninja /usr/bin/ninja
- name: Install D host compiler
uses: dlang-community/setup-dlang@v1
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ jobs:
-DEXTRA_CXXFLAGS=-flto=full
with_pgo: true

- job_name: Linux aarch64
os: ubuntu-22.04-arm
arch: aarch64
bootstrap_cmake_flags: >-
-DBUILD_LTO_LIBS=ON
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
extra_cmake_flags: >-
-DBUILD_LTO_LIBS=ON
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
-DCMAKE_C_COMPILER=/home/runner/work/ldc/clang/bin/clang
-DCMAKE_CXX_COMPILER=/home/runner/work/ldc/clang/bin/clang++
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
-DJITRT_EXTRA_LDFLAGS=-static-libstdc++
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
-DEXTRA_CXXFLAGS=-flto=full
with_pgo: true

- job_name: macOS x86_64
os: macos-13
arch: x86_64
Expand Down

0 comments on commit be42dee

Please sign in to comment.