diff --git a/llvm/lib/TargetParser/CMakeLists.txt b/llvm/lib/TargetParser/CMakeLists.txt --- a/llvm/lib/TargetParser/CMakeLists.txt +++ b/llvm/lib/TargetParser/CMakeLists.txt @@ -8,6 +8,11 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=global-constructors") endif() +# Solaris code uses kstat, so specify dependency explicitly for shared builds. +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set(system_libs kstat) +endif() + add_llvm_component_library(LLVMTargetParser AArch64TargetParser.cpp ARMTargetParserCommon.cpp @@ -25,6 +30,9 @@ Unix Windows + LINK_LIBS + ${system_libs} + LINK_COMPONENTS Support