[PATCH] Enable building of sanitizers on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Wed Feb 19 07:09:44 PST 2014


Hi kcc,

This patch enables building of the asan, lsan, profile and ubsan parts of sanitizer on FreeBSD.

I'm not sure if we should commit this patch first or last. In the latter case and before the patch is committed, it can work as a reference for those who would like to try to build the sources on FreeBSD.

http://llvm-reviews.chandlerc.com/D2827

Files:
  lib/CMakeLists.txt

Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -5,9 +5,9 @@
 include(SanitizerUtils)
 # Don't build sanitizers in the bootstrap build.
 if(NOT LLVM_USE_SANITIZER)
-  # AddressSanitizer is supported on Linux and Mac OS X.
+  # AddressSanitizer is supported on Linux, FreeBSD and Mac OS X.
   # 32-bit Windows support is experimental.
-  if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
+  if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD")
     set(SUPPORTS_BUILDING_ASAN TRUE)
   elseif(CMAKE_SYSTEM_NAME MATCHES "Windows"
          AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
@@ -20,8 +20,8 @@
     add_subdirectory(interception)
     add_subdirectory(sanitizer_common)
   endif()
-  if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux" AND NOT ANDROID)
-    # LSan, UBsan and profile can be built on Mac OS and Linux.
+  if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD" AND NOT ANDROID)
+    # LSan, UBsan and profile can be built on Mac OS, FreeBSD and Linux.
     add_subdirectory(lsan)
     add_subdirectory(profile)
     add_subdirectory(ubsan)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2827.1.patch
Type: text/x-patch
Size: 1137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140219/8748313d/attachment.bin>


More information about the llvm-commits mailing list