Skip to content

Commit 2e0a105

Browse files
authored
[CMake] Fix building on Haiku and Solaris after c0d5d36 (#78084)
Haiku and Solaris need some additional libraries after the commit c0d5d36 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' ```
1 parent 332be17 commit 2e0a105

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

llvm/lib/Support/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ elseif( CMAKE_HOST_UNIX )
6565
set(system_libs ${system_libs} m)
6666
endif()
6767
if( UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
68-
set(system_libs ${system_libs} kstat)
68+
set(system_libs ${system_libs} kstat socket)
6969
endif()
7070
if( FUCHSIA )
7171
set(system_libs ${system_libs} zircon)
7272
endif()
7373
if ( HAIKU )
7474
add_compile_definitions(_BSD_SOURCE)
75-
set(system_libs ${system_libs} bsd)
75+
set(system_libs ${system_libs} bsd network)
7676
endif()
7777
endif( MSVC OR MINGW )
7878

llvm/tools/llvm-jitlink/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ add_llvm_tool(llvm-jitlink
2828
llvm-jitlink-statistics.cpp
2929
)
3030

31-
if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
32-
target_link_libraries(llvm-jitlink PRIVATE network)
33-
endif()
34-
35-
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
36-
target_link_libraries(llvm-jitlink PRIVATE socket nsl)
37-
endif()
31+
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
32+
target_link_libraries(llvm-jitlink PRIVATE socket)
33+
endif()
3834

3935
export_executable_symbols(llvm-jitlink)

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

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

14-
if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
15-
target_link_libraries(llvm-jitlink-executor PRIVATE network)
16-
endif()
17-
18-
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
19-
target_link_libraries(llvm-jitlink-executor PRIVATE socket)
20-
endif()
21-
2214
export_executable_symbols(llvm-jitlink-executor)

0 commit comments

Comments
 (0)