Skip to content

Commit

Permalink
Turn off "V" in zlib-ng compilation (#104776)
Browse files Browse the repository at this point in the history
Our target ISA is rv64gc, not gcv. If kernel can't detect RISC-V extensions, zlib-ng defaults has_rvv to true, which crashes on hardware without vector instructions like VisionFive 2.
  • Loading branch information
tomeksowi committed Jul 12, 2024
1 parent a955d59 commit edf1672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/native/external/zlib-ng.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ set(ZLIB_ENABLE_TESTS OFF)
set(ZLIBNG_ENABLE_TESTS OFF)
set(Z_PREFIX ON)

# TODO: Turn back on when Linux kernels with proper RISC-V extension detection (>= 6.5) are more commonplace
set(WITH_RVV OFF)

add_compile_options($<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang>:-Wno-unused-command-line-argument>) # clang : error : argument unused during compilation: '-fno-semantic-interposition'
add_compile_options($<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang>:-Wno-logical-op-parentheses>) # place parentheses around the '&&' expression to silence this warning
add_compile_options($<$<COMPILE_LANG_AND_ID:C,MSVC>:/wd4127>) # warning C4127: conditional expression is constant
Expand Down

0 comments on commit edf1672

Please sign in to comment.