diff --git a/.github/toolchains/clang-s390x-linux-gnu.cmake b/.github/toolchains/clang-s390x-linux-gnu.cmake new file mode 100644 index 000000000..2526d0acf --- /dev/null +++ b/.github/toolchains/clang-s390x-linux-gnu.cmake @@ -0,0 +1,4 @@ +set(CMAKE_SYSTEM_PROCESSOR s390x) +set(triple s390x-linux-gnu) + +include(${CMAKE_CURRENT_LIST_DIR}/clang.cmake) diff --git a/.github/workflows/cross-s390x.yml b/.github/workflows/cross-s390x.yml index b748d328e..ef92b6cfc 100644 --- a/.github/workflows/cross-s390x.yml +++ b/.github/workflows/cross-s390x.yml @@ -1,4 +1,4 @@ -name: IBM Z cross-compilation build +name: IBM Z (s390x) cross-compilation build on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} @@ -14,8 +14,9 @@ jobs: - { platform: 's390x', dir: 's390x-linux-gnu', full: 'OFF' } sys: - { compiler: 'gcc', version: '14' } + - { compiler: 'clang', version: '20', gcc_runtime: '14' } steps: - - name: Setup compiler + - name: Setup GCC if: ${{ matrix.sys.compiler == 'gcc' }} run: | sudo apt-get update || exit 1 @@ -24,6 +25,16 @@ jobs: sudo update-alternatives --remove-all ${{ matrix.target.dir }}-g++ || true sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-gcc ${{ matrix.target.dir }}-gcc /usr/bin/${{ matrix.target.dir }}-gcc-${{ matrix.sys.version }} 20 sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-g++ ${{ matrix.target.dir }}-g++ /usr/bin/${{ matrix.target.dir }}-g++-${{ matrix.sys.version }} 20 + - name: Setup LLVM + if: ${{ matrix.sys.compiler == 'clang' }} + run: | + sudo apt-get update || exit 1 + sudo apt-get -y --no-install-suggests --no-install-recommends install g++-${{ matrix.sys.gcc_runtime }}-${{ matrix.target.dir }} g++-${{ matrix.sys.gcc_runtime }}-multilib cmake || exit 1 + sudo apt-get -y --no-install-suggests --no-install-recommends install clang-${{ matrix.sys.version }} || exit 1 + sudo update-alternatives --remove-all /usr/bin/clang || true + sudo update-alternatives --remove-all /usr/bin/clang++ || true + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ matrix.sys.version }} 20 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{ matrix.sys.version }} 20 - name: Setup QEMU run: | sudo apt-get --no-install-suggests --no-install-recommends install qemu-user @@ -43,6 +54,8 @@ jobs: -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-${{ matrix.target.dir }}.cmake - name: Build run: cmake --build build/ --verbose -j1 + - name: Set CPU feature test expectations + run: /bin/true - name: Testing xsimd run: | # Set CPU feature test expectations, 0 is explicit absence of the feature