diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f5083e..69aaa6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,7 @@ jobs: run: | export LDFLAGS=-L/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 - name: Build working-directory: ${{github.workspace}}/build @@ -61,6 +61,61 @@ jobs: run: | 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: strategy: matrix: @@ -120,7 +175,7 @@ jobs: # Fake check that can be used as a branch-protection rule. all-checks: - needs: [ubuntu, windows] + needs: [ubuntu, windows, qemu-crossbuild] runs-on: ubuntu-latest steps: - name: Dummy step diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt index a4423c5..a16bfff 100644 --- a/CMake/CMakeLists.txt +++ b/CMake/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.2) project(test_cxx_runtime) add_executable(test_cxx_runtime typeinfo_test.cc) diff --git a/README.md b/README.md index 2a19cb4..31ee7fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ 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) diff --git a/Test/ManyManySelectors.m b/Test/ManyManySelectors.m index 0a749bd..baa45ae 100644 --- a/Test/ManyManySelectors.m +++ b/Test/ManyManySelectors.m @@ -2,6 +2,7 @@ #include #include #include +#include "../selector.h" #include @@ -31,9 +32,10 @@ int main(void) { snprintf(selBuffer, sizeof(selBuffer), "%" PRId32 "selector%" PRIx32, i, i); 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); sel_size += strlen(selBuffer);