Skip to content

Commit

Permalink
Build the built-in luajit for s390x
Browse files Browse the repository at this point in the history
Signed-off-by: YingJie Fu <[email protected]>
  • Loading branch information
YingJie Fu committed Jul 18, 2024
1 parent 1995002 commit ff90d2d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Fluent Bit is fully supported on Windows environments, get started with [these i

#### Running on s390x

Fluent Bit is supported on Linux on IBM Z(s390x), but the WASM and LUA filter plugins are not.
Fluent Bit is supported on Linux on IBM Z(s390x), but the WASM is not.

### Plugins: Inputs, Filters and Outputs

Expand Down
2 changes: 0 additions & 2 deletions cmake/s390x.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(SystemZ|s390x)")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
message(STATUS "Cannot build WAMR on this platform, so WASM support is disabled.")
set(FLB_WASM OFF)
message(STATUS "This platform does not support LuaJIT, so it's disabled.")
set(FLB_LUAJIT OFF)
endif ()
2 changes: 2 additions & 0 deletions lib/luajit-cmake/Bundle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ else()
else()
set(LJ_TARGET_ARCH "ppc")
endif()
elseif("${LJ_DETECTED_ARCH}" STREQUAL "SystemZ")
set(LJ_TARGET_ARCH "s390x")
else()
message(FATAL_ERROR "Unsupported target architecture: '${LJ_DETECTED_ARCH}'")
endif()
Expand Down
8 changes: 7 additions & 1 deletion lib/luajit-cmake/LuaJIT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ elseif("${LJ_DETECTED_ARCH}" STREQUAL "AArch64")
endif()
elseif("${LJ_DETECTED_ARCH}" STREQUAL "ARM")
set(LJ_TARGET_ARCH "arm")
elseif("${LJ_DETECTED_ARCH}" STREQUAL "SystemZ")
set(LJ_TARGET_ARCH "s390x")
if(LJ_BIG_ENDIAN)
set(TARGET_ARCH -DLJ_ARCH_ENDIAN=LUAJIT_BE)
endif()
elseif("${LJ_DETECTED_ARCH}" STREQUAL "Mips64")
set(LJ_TARGET_ARCH "mips64")
if(NOT LJ_BIG_ENDIAN)
Expand Down Expand Up @@ -248,7 +253,7 @@ if(LUAJIT_DISABLE_FFI)
endif()

set(LJ_JIT 1)
if(LUAJIT_DISABLE_JIT)
if(LUAJIT_DISABLE_JIT OR ("${LJ_TARGET_ARCH}" STREQUAL "s390x"))
set(LJ_JIT 0)
endif()

Expand Down Expand Up @@ -282,6 +287,7 @@ endif()
if(("${LJ_TARGET_ARCH}" STREQUAL "arm") OR
("${LJ_TARGET_ARCH}" STREQUAL "arm64") OR
("${LJ_TARGET_ARCH}" STREQUAL "mips") OR
("${LJ_TARGET_ARCH}" STREQUAL "s390x") OR
("${LJ_TARGET_ARCH}" STREQUAL "mips64"))
set(LJ_ARCH_NUMMODE ${LJ_NUMMODE_DUAL})
endif()
Expand Down
2 changes: 2 additions & 0 deletions lib/luajit-cmake/Modules/FindUnwind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
set(LIBUNWIND_ARCH "ppc64")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
set(LIBUNWIND_ARCH "ppc32")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^s390x")
set(LIBUNWIND_ARCH "s390x")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
set(LIBUNWIND_ARCH "mips")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
Expand Down
2 changes: 1 addition & 1 deletion lib/luajit-cmake/host/buildvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else()
endif()

include(CheckTypeSize)
if("${EXTRA_COMPILER_FLAGS}" MATCHES "LUAJIT_ARCH_.*64")
if("${EXTRA_COMPILER_FLAGS}" MATCHES "LUAJIT_ARCH_.*(64|s390x)")
set(TARGET_SIZE_OF_P 8)
else()
set(TARGET_SIZE_OF_P 4)
Expand Down

0 comments on commit ff90d2d

Please sign in to comment.