Fix issues of build/run with llvm-17 (#2853)

- Fix compilation error of using PGOOptions
- Fix LLVM JIT run error due to `llvm_orc_registerEHFrameSectionWrapper`
  symbol not found
This commit is contained in:
Wenyong Huang
2023-12-04 16:40:54 +08:00
committed by GitHub
parent 453a29a9d4
commit b0d5b8df1d
2 changed files with 24 additions and 4 deletions

View File

@ -122,6 +122,11 @@ if (WAMR_BUILD_JIT EQUAL 1)
if (CXX_SUPPORTS_REDUNDANT_MOVE_FLAG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-redundant-move")
endif ()
# Enable exporting symbols after llvm-17, or LLVM JIT may run failed
# with `llvm_orc_registerEHFrameSectionWrapper` symbol not found error
if (${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "17.0.0")
set (CMAKE_ENABLE_EXPORTS 1)
endif ()
endif ()
else ()
unset (LLVM_AVAILABLE_LIBS)