--- compiler-rt/cmake/config-ix.cmake | 3 ++- lldb/cmake/LLDBDependencies.cmake | 2 +- lldb/scripts/Python/modules/CMakeLists.txt | 4 ++-- lldb/scripts/utilsOsType.py | 7 ++++++- tools/llvm-shlib/CMakeLists.txt | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) Index: llvm-toolchain-snapshot_4.0~svn288822/compiler-rt/cmake/config-ix.cmake =================================================================== --- llvm-toolchain-snapshot_4.0~svn288822.orig/compiler-rt/cmake/config-ix.cmake +++ llvm-toolchain-snapshot_4.0~svn288822/compiler-rt/cmake/config-ix.cmake @@ -440,7 +440,8 @@ list_replace(COMPILER_RT_SANITIZERS_TO_B if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR - (OS_NAME MATCHES "Windows" AND (NOT MINGW AND NOT CYGWIN)))) + (OS_NAME MATCHES "Windows" AND (NOT MINGW AND NOT CYGWIN))) + AND NOT (OS_NAME STREQUAL "kFreeBSD")) set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE) else() set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE) Index: llvm-toolchain-snapshot_4.0~svn288822/lldb/cmake/LLDBDependencies.cmake =================================================================== --- llvm-toolchain-snapshot_4.0~svn288822.orig/lldb/cmake/LLDBDependencies.cmake +++ llvm-toolchain-snapshot_4.0~svn288822/lldb/cmake/LLDBDependencies.cmake @@ -162,7 +162,7 @@ if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) endif() # On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc. -if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") +if ((CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") AND NOT CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD") list(APPEND LLDB_SYSTEM_LIBS execinfo) endif() Index: llvm-toolchain-snapshot_4.0~svn288822/lldb/scripts/Python/modules/CMakeLists.txt =================================================================== --- llvm-toolchain-snapshot_4.0~svn288822.orig/lldb/scripts/Python/modules/CMakeLists.txt +++ llvm-toolchain-snapshot_4.0~svn288822/lldb/scripts/Python/modules/CMakeLists.txt @@ -6,6 +6,6 @@ if (CXX_SUPPORTS_NO_MACRO_REDEFINED) endif () # build the Python readline suppression module only on Linux -if (CMAKE_SYSTEM_NAME MATCHES "Linux") +if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "GNU" OR CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD") add_subdirectory(readline) endif() Index: llvm-toolchain-snapshot_4.0~svn288822/lldb/scripts/utilsOsType.py =================================================================== --- llvm-toolchain-snapshot_4.0~svn288822.orig/lldb/scripts/utilsOsType.py +++ llvm-toolchain-snapshot_4.0~svn288822/lldb/scripts/utilsOsType.py @@ -36,6 +36,7 @@ if sys.version_info.major >= 3: Linux = 3 NetBSD = 4 Windows = 5 + kFreeBSD = 6 else: class EnumOsType(object): values = ["Unknown", @@ -43,7 +44,9 @@ else: "FreeBSD", "Linux", "NetBSD", - "Windows"] + "Windows", + "kFreeBSD" + ] class __metaclass__(type): #++---------------------------------------------------------------- @@ -91,5 +94,7 @@ def determine_os_type(): eOSType = EnumOsType.NetBSD elif strOS == "win32": eOSType = EnumOsType.Windows + elif strOS.startswith("gnukfreebsd"): + eOSType = EnumOsType.kFreeBSD return eOSType Index: llvm-toolchain-snapshot_4.0~svn288822/tools/llvm-shlib/CMakeLists.txt =================================================================== --- llvm-toolchain-snapshot_4.0~svn288822.orig/tools/llvm-shlib/CMakeLists.txt +++ llvm-toolchain-snapshot_4.0~svn288822/tools/llvm-shlib/CMakeLists.txt @@ -38,7 +38,7 @@ add_llvm_library(LLVM SHARED DISABLE_LLV set_property(TARGET LLVM PROPERTY VERSION "1") # Append .1 to SONAME list(REMOVE_DUPLICATES LIB_NAMES) -if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf" +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD") # FIXME: It should be "GNU ld for elf" # GNU ld doesn't resolve symbols in the version script. set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")