Attempt to add QEMU to CI.

main
David Chisnall 3 years ago committed by David Chisnall
parent b3f7b1bac3
commit 71e38a048f

@ -50,7 +50,7 @@ jobs:
run: | run: |
export LDFLAGS=-L/usr/lib/llvm-${{ matrix.llvm-version }}/lib/ export LDFLAGS=-L/usr/lib/llvm-${{ matrix.llvm-version }}/lib/
ls -lahR /usr/lib/llvm-${{ matrix.llvm-version }}/lib/ ls -lahR /usr/lib/llvm-${{ matrix.llvm-version }}/lib/
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja -DTESTS=ON -DCMAKE_C_COMPILER=clang-${{matrix.llvm-version}} -DCMAKE_ASM_COMPILER=clang-${{matrix.llvm-version}} -DCMAKE_CXX_COMPILER=clang++-${{matrix.llvm-version}} -DCMAKE_CXX_FLAGS="-stdlib=${{matrix.cxxlib}}" cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja -DTESTS=ON -DCMAKE_C_COMPILER=clang-${{matrix.llvm-version}} -DCMAKE_OBJC_COMPILER=clang-${{matrix.llvm-version}} -DCMAKE_ASM_COMPILER=clang-${{matrix.llvm-version}} -DCMAKE_CXX_COMPILER=clang++-${{matrix.llvm-version}} -DCMAKE_OBJCXX_COMPILER=clang++-${{matrix.llvm-version}} -DCMAKE_CXX_FLAGS="-stdlib=${{matrix.cxxlib}}"
# Build with a nice ninja status line # Build with a nice ninja status line
- name: Build - name: Build
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
@ -61,6 +61,61 @@ jobs:
run: | run: |
ctest --output-on-failure -j 4 ctest --output-on-failure -j 4
qemu-crossbuild:
strategy:
matrix:
build-type: [ Release, Debug ]
llvm-version: [13, 14]
arch:
- name: armhf
system-processor: arm
triple: arm-linux-gnueabihf
rtld: ld-linux-armhf.so.3
# The C++ exception tests are failing, disable them until they are debugged.
unsupported: -E CXX
- name: arm64
system-processor: aarch64
triple: aarch64-linux-gnu
rtld: ld-linux-aarch64.so.1
# Don't abort runners if a single one fails
fail-fast: false
runs-on: ubuntu-latest
name: Cross-build for ${{ matrix.arch.triple }} LLVM-${{ matrix.llvm-version}} ${{ matrix.build-type }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install cross-compile toolchain and QEMU
run: |
sudo apt update
sudo apt install libstdc++-9-dev-${{ matrix.arch.name }}-cross qemu-user ninja-build
- name: Configure CMake
run: |
export LDFLAGS="-L/usr/lib/llvm-${{ matrix.llvm-version }}/lib/ -fuse-ld=lld -Wl,--dynamic-linker=/usr/${{ matrix.arch.triple }}/lib/${{ matrix.arch.rtld }},-rpath,/usr/${{ matrix.arch.triple }}/lib"
cmake -B ${{github.workspace}}/build \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch.system-processor }} \
-DCMAKE_C_COMPILER=clang-${{ matrix.llvm-version }} \
-DCMAKE_CXX_COMPILER=clang++-${{ matrix.llvm-version }} \
-DCMAKE_ASM_COMPILER=clang-${{ matrix.llvm-version }} \
-DCMAKE_C_COMPILER_TARGET=${{ matrix.arch.triple }} \
-DCMAKE_CXX_COMPILER_TARGET=${{ matrix.arch.triple }} \
-DCMAKE_OBJC_COMPILER_TARGET=${{ matrix.arch.triple }} \
-DCMAKE_OBJCXX_COMPILER_TARGET=${{ matrix.arch.triple }} \
-DCMAKE_ASM_COMPILER_TARGET=${{ matrix.arch.triple }} \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DTESTS=ON \
-G Ninja \
# Build with a nice ninja status line
- name: Build
working-directory: ${{github.workspace}}/build
run: |
NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja -v
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest --output-on-failure -j 4 ${{ matrix.arch.unsupported }}
windows: windows:
strategy: strategy:
matrix: matrix:
@ -120,7 +175,7 @@ jobs:
# Fake check that can be used as a branch-protection rule. # Fake check that can be used as a branch-protection rule.
all-checks: all-checks:
needs: [ubuntu, windows] needs: [ubuntu, windows, qemu-crossbuild]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Dummy step - name: Dummy step

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.2)
project(test_cxx_runtime) project(test_cxx_runtime)
add_executable(test_cxx_runtime typeinfo_test.cc) add_executable(test_cxx_runtime typeinfo_test.cc)

@ -1,7 +1,7 @@
GNUstep Objective-C Runtime GNUstep Objective-C Runtime
=========================== ===========================
Linux and Windows CI: [![Build Status](https://dev.azure.com/gnustep/libobjc2/_apis/build/status/gnustep.libobjc2?branchName=master)](https://dev.azure.com/gnustep/libobjc2/_build/latest?definitionId=1&branchName=master) Linux and Windows CI: [![Libobjc2 CI](https://github.com/gnustep/libobjc2/actions/workflows/main.yml/badge.svg)](https://github.com/gnustep/libobjc2/actions/workflows/main.yml)
FreeBSD CI: [![Build Status](https://api.cirrus-ci.com/github/gnustep/libobjc2.svg)](https://cirrus-ci.com/github/gnustep/libobjc2) FreeBSD CI: [![Build Status](https://api.cirrus-ci.com/github/gnustep/libobjc2.svg)](https://cirrus-ci.com/github/gnustep/libobjc2)

@ -2,6 +2,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "../selector.h"
#include <sys/types.h> #include <sys/types.h>
@ -31,9 +32,10 @@ int main(void)
{ {
snprintf(selBuffer, sizeof(selBuffer), "%" PRId32 "selector%" PRIx32, i, i); snprintf(selBuffer, sizeof(selBuffer), "%" PRId32 "selector%" PRIx32, i, i);
nextSel = sel_registerName(selBuffer); nextSel = sel_registerName(selBuffer);
if (strcmp(selBuffer, sel_getName(nextSel)) != 0) char *registeredName = sel_getName(nextSel);
if (strcmp(selBuffer, registeredName) != 0)
{ {
fprintf(stderr, "'%s' != '%s'\n", selBuffer, sel_getName(nextSel)); fprintf(stderr, "'%s' != '%s' (%p)\n", selBuffer, registeredName, nextSel->index);
} }
assert(strcmp(selBuffer, sel_getName(nextSel)) == 0); assert(strcmp(selBuffer, sel_getName(nextSel)) == 0);
sel_size += strlen(selBuffer); sel_size += strlen(selBuffer);

Loading…
Cancel
Save