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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 09:31:51 PST 2021


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: llvm/tools/llvm-jitlink/CMakeLists.txt:28
+if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+  target_link_libraries(llvm-jitlink PRIVATE socket nsl)
+endif()
----------------
serge-sans-paille wrote:
> Are `socket` and  `nsl` libraries standard and always available, or should we check for them?
For Solaris-like systems, I believe so. The closest to official documentation on the topic I found is that Oracle man pages list `-lsocket -lnsl` for socket-related APIs: https://docs.oracle.com/cd/E86824_01/html/E54774/socket-3socket.html

I originally used `find_library()` but then switched to checking the system after seeing that we already have a couple of checks like this.


================
Comment at: llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt:14
 
+message(${CMAKE_SYSTEM_NAME})
+if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
----------------
serge-sans-paille wrote:
> debug leftover?
Ooops, indeed :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97633/new/

https://reviews.llvm.org/D97633



More information about the llvm-commits mailing list