[llvm] 2e0a105 - [CMake] Fix building on Haiku and Solaris after c0d5d36dda04cdd409aabc015da0beb810842fcd (#78084)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 14 17:23:26 PST 2024
Author: Brad Smith
Date: 2024-01-14T20:23:22-05:00
New Revision: 2e0a105761cd33e42b915da5aab35c966daf8241
URL: https://github.com/llvm/llvm-project/commit/2e0a105761cd33e42b915da5aab35c966daf8241
DIFF: https://github.com/llvm/llvm-project/commit/2e0a105761cd33e42b915da5aab35c966daf8241.diff
LOG: [CMake] Fix building on Haiku and Solaris after c0d5d36dda04cdd409aabc015da0beb810842fcd (#78084)
Haiku and Solaris need some additional libraries after the commit
c0d5d36dda04cdd409aabc015da0beb810842fcd
Otherwise fails to link a whole bunch of the tools and other binaries
with undefined symbols with accept() and connect().
I did a static and dynamic build on illumos and a dynamic build on
Haiku.
```
-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;mlir'
```
and on illumos
```
-DLLVM_ENABLE_RUNTIMES='openmp'
```
Added:
Modified:
llvm/lib/Support/CMakeLists.txt
llvm/tools/llvm-jitlink/CMakeLists.txt
llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 2433730b528802..e19223fdef4f17 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -65,14 +65,14 @@ elseif( CMAKE_HOST_UNIX )
set(system_libs ${system_libs} m)
endif()
if( UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
- set(system_libs ${system_libs} kstat)
+ set(system_libs ${system_libs} kstat socket)
endif()
if( FUCHSIA )
set(system_libs ${system_libs} zircon)
endif()
if ( HAIKU )
add_compile_definitions(_BSD_SOURCE)
- set(system_libs ${system_libs} bsd)
+ set(system_libs ${system_libs} bsd network)
endif()
endif( MSVC OR MINGW )
diff --git a/llvm/tools/llvm-jitlink/CMakeLists.txt b/llvm/tools/llvm-jitlink/CMakeLists.txt
index 1480be3f03c6d7..c9d1d23d3471a6 100644
--- a/llvm/tools/llvm-jitlink/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/CMakeLists.txt
@@ -28,12 +28,8 @@ add_llvm_tool(llvm-jitlink
llvm-jitlink-statistics.cpp
)
-if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
- target_link_libraries(llvm-jitlink PRIVATE network)
-endif()
-
-if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- target_link_libraries(llvm-jitlink PRIVATE socket nsl)
-endif()
+ if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ target_link_libraries(llvm-jitlink PRIVATE socket)
+ endif()
export_executable_symbols(llvm-jitlink)
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
index 7e4570c13d81f7..f6d882d1a8f06f 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
@@ -11,12 +11,4 @@ add_llvm_utility(llvm-jitlink-executor
intrinsics_gen
)
-if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
- target_link_libraries(llvm-jitlink-executor PRIVATE network)
-endif()
-
-if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- target_link_libraries(llvm-jitlink-executor PRIVATE socket)
-endif()
-
export_executable_symbols(llvm-jitlink-executor)
More information about the llvm-commits
mailing list