Skip to content

Commit

Permalink
Merge pull request #620 from coldav/colin/fix_aarch64_icd_build
Browse files Browse the repository at this point in the history
[GITHUB CI] Add support for cross compilation installation for ICD
  • Loading branch information
coldav authored Jan 7, 2025
2 parents 1f240ed + a63783f commit ebfce3b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .github/actions/do_build_icd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ runs:
- name: Install Ninja
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main branch

- name: install cross tools
if: steps.calc_vars.outputs.arch != 'x86_64'
uses: ./.github/actions/do_install_ubuntu_cross_tools
with:
cross_arch: ${{ steps.calc_vars.outputs.arch }}

- name: clone headers
uses: actions/checkout@v4
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/actions/do_install_ubuntu_cross_tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: install ubuntu cross compilation tools
description: install ubuntu tools needed for cross compilation

inputs:
cross_arch:
description: 'target architecture - default is no cross arch'
default: ''

runs:
using: "composite"
steps:
- name: Install ubuntu prerequisites
shell: bash
run: |
if [ "${{ inputs.cross_arch }}" = "x86" ]; then \
sudo apt-get install --yes gcc-multilib g++-multilib libc6-dev:i386 lib32tinfo-dev; \
fi
if [ "${{ inputs.cross_arch }}" = "arm" ]; then \
sudo apt-get install --yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf; \
fi
if [ "${{ inputs.cross_arch }}" = "aarch64" ]; then \
sudo apt-get install --yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu; \
fi
if [ "${{ inputs.cross_arch }}" = "riscv64" ]; then \
sudo apt-get install --yes gcc-riscv64-linux-gnu g++-riscv64-linux-gnu; \
fi
19 changes: 7 additions & 12 deletions .github/actions/setup_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,18 @@ runs:
pip install lit clang-format==19.1.0 virtualenv
sudo apt-get install --yes doxygen
sudo apt-get install --yes vulkan-sdk
if [ "${{ inputs.cross_arch }}" = "x86" ]; then \
sudo apt-get install --yes gcc-multilib g++-multilib libc6-dev:i386 lib32tinfo-dev; \
fi
if [ "${{ inputs.cross_arch }}" = "arm" ]; then \
sudo apt-get install --yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf; \
fi
if [ "${{ inputs.cross_arch }}" = "aarch64" ]; then \
sudo apt-get install --yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu; \
fi
if [ "${{ inputs.cross_arch }}" = "riscv64" ]; then \
sudo apt-get install --yes gcc-riscv64-linux-gnu g++-riscv64-linux-gnu; \
fi
# TODO: Only required if we are running something that requires qemu, not required for building
if [ "${{ inputs.cross_arch }}" != "none" ] && [ "${{ inputs.cross_arch }}" != "x86" ]; then \
# Install QEMU for testing cross compilation.
sudo apt-get install --yes qemu-user; \
fi
- name: Install cross arch tools
if: ${{ inputs.os == 'ubuntu' }}
uses: ./.github/actions/do_install_ubuntu_cross_tools
with:
cross_arch: ${{ inputs.cross_arch }}

- name: Install windows prerequisites
if: ${{ inputs.os == 'windows' }}
shell: pwsh
Expand Down

0 comments on commit ebfce3b

Please sign in to comment.