Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Use signed char in RISC-V 64bit #9524

Merged
merged 6 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ jobs:
matrix:
arch:
- s390x
- riscv64
steps:
- name: Checkout Fluent Bit code
uses: actions/checkout@v4
Expand All @@ -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) ))
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ if (FLB_SYSTEM_LINUX)
include(cmake/s390x.cmake)
endif ()

# Build for Linux - riscv64 arch
if (FLB_SYSTEM_LINUX)
include(cmake/riscv64.cmake)
endif ()

# Enable signed char support on Linux AARCH64 if specified
if (FLB_LINUX_ON_AARCH64)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
Expand Down
8 changes: 8 additions & 0 deletions cmake/riscv64.cmake
Original file line number Diff line number Diff line change
@@ -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 ()
Loading