[cmake] Link socket/nsl on SunOS in llvm-jitlink

llvm-jitlink and llvm-jitlink-executor make use of APIs that are
part of the socket and nsl libraries on SunOS systems (Solaris and
Illumos). Make sure they get linked.

Ran into this in Rust CI when cross-compiling LLVM 12 to these
targets.

Differential Revision: https://reviews.llvm.org/D97633
This commit is contained in:
Nikita Popov 2021-02-28 16:04:56 +01:00
parent 561fb7f60a
commit f111dc7cfc
2 changed files with 8 additions and 0 deletions

View File

@ -24,4 +24,8 @@ add_llvm_tool(llvm-jitlink
llvm-jitlink-macho.cpp
)
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
target_link_libraries(llvm-jitlink PRIVATE socket nsl)
endif()
export_executable_symbols(llvm-jitlink)

View File

@ -11,4 +11,8 @@ add_llvm_utility(llvm-jitlink-executor
intrinsics_gen
)
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
target_link_libraries(llvm-jitlink-executor PRIVATE socket)
endif()
export_executable_symbols(llvm-jitlink-executor)