Skip to content

Commit

Permalink
don't export LLVM symbols on OSX too
Browse files Browse the repository at this point in the history
As title
  • Loading branch information
esc committed Jun 17, 2021
1 parent 4a04804 commit 9c3f6fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,12 @@ target_link_libraries(llvmlite ${llvm_libs})
# -flto and --exclude-libs allow us to remove those parts of LLVM we don't use
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set_property(TARGET llvmlite APPEND_STRING PROPERTY LINK_FLAGS "-flto -Wl,--exclude-libs,ALL")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LLVM_EXCLUDE_SYMBOLS "-Wl,-unexported_symbol,__ZTVN4llvm* \
-Wl,-unexported_symbol,__ZNK4llvm* \
-Wl,-unexported_symbol,__ZN4llvm* \
-Wl,-unexported_symbol,__ZTIN4llvm* \
-Wl,-unexported_symbol,_LLVM* \
-Wl,-unexported_symbol,__ZTSN4llvm*")
set_property(TARGET llvmlite APPEND_STRING PROPERTY LINK_FLAGS "${LLVM_SYMBOLS_AVOID}")
endif()

0 comments on commit 9c3f6fd

Please sign in to comment.