Index: lib/asan/tests/CMakeLists.txt =================================================================== --- lib/asan/tests/CMakeLists.txt +++ lib/asan/tests/CMakeLists.txt @@ -34,6 +34,13 @@ -O2) append_if(ASAN_UNITTEST_COMMON_CFLAGS COMPILER_RT_HAS_WNO_VARIADIC_MACROS_FLAG -Wno-variadic-macros) +# System headers incorrectly define 'size_t' as 'unsigned long' on +# x64 FreeBSD 9.2 whereas 'unsigned int' is expected. +if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE" AND + CMAKE_SIZEOF_VOID_P MATCHES "8") + list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -D_SIZE_T_DECLARED) +endif() + # Use -D instead of definitions to please custom compile command. list(APPEND ASAN_UNITTEST_COMMON_CFLAGS -DASAN_HAS_BLACKLIST=1