Skip to content

Commit f111dc7

Browse files
committed
[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
1 parent 561fb7f commit f111dc7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

llvm/tools/llvm-jitlink/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ add_llvm_tool(llvm-jitlink
2424
llvm-jitlink-macho.cpp
2525
)
2626

27+
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
28+
target_link_libraries(llvm-jitlink PRIVATE socket nsl)
29+
endif()
30+
2731
export_executable_symbols(llvm-jitlink)

llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ add_llvm_utility(llvm-jitlink-executor
1111
intrinsics_gen
1212
)
1313

14+
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
15+
target_link_libraries(llvm-jitlink-executor PRIVATE socket)
16+
endif()
17+
1418
export_executable_symbols(llvm-jitlink-executor)

0 commit comments

Comments
 (0)