diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index abd82c05472..cd58ca35cdc 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -179,6 +179,7 @@ jobs: matrix: arch: - s390x + - riscv64 steps: - name: Checkout Fluent Bit code uses: actions/checkout@v4 @@ -188,19 +189,19 @@ jobs: id: build-and-test-on-qemu with: arch: ${{ matrix.arch }} - distro: ubuntu20.04 + distro: ubuntu22.04 shell: /bin/bash dockerRunArgs: | --volume "/var/lib/dbus/machine-id:/var/lib/dbus/machine-id" --volume "/etc/machine-id:/etc/machine-id" install: | apt-get update - apt-get install -y gcc-7 g++-7 clang-6.0 libyaml-dev cmake flex bison libssl-dev libbpf-dev linux-tools-common#libsystemd-dev - ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true + apt-get install -y gcc-12 g++-12 libyaml-dev cmake flex bison libssl-dev libbpf-dev linux-tools-common #clang-6.0 libsystemd-dev + # ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90 - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 - update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 90 + # update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90 run: | cd build export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) )) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72a375bf47c..5e5336b3cfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -315,6 +315,11 @@ if (FLB_SYSTEM_LINUX) include(cmake/s390x.cmake) endif () +# Build for Linux - riscv64 arch +if (FLB_SYSTEM_LINUX) + include(cmake/riscv64.cmake) +endif () + # Extract Git commit information for debug output. # Note that this is only set when cmake is run, the intent here is to use in CI for verification of releases so is acceptable. # For a better solution see https://jonathanhamberg.com/post/cmake-embedding-git-hash/ but this is simple and easy. diff --git a/cmake/riscv64.cmake b/cmake/riscv64.cmake new file mode 100644 index 00000000000..c4a8fb15751 --- /dev/null +++ b/cmake/riscv64.cmake @@ -0,0 +1,8 @@ +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv64)") + message(STATUS "Forcing characters to be signed, as on x86_64.") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char") + if(FLB_LUAJIT) + message(WARNING "LuaJIT is disabled, this platform does not support built-in LuaJIT and system provided one neither.") + set(FLB_LUAJIT OFF) + endif() +endif ()