forked from OSchip/llvm-project
[libcxx] Add support for LLVM_USE_SANITIZER=Undefined
LLVM_USE_SANITIZER=Undefined support was added to the LLVM CMake configuration. Update libc++'s handling of LLVM_USE_SANITIZER to support this as well. llvm-svn: 219987
This commit is contained in:
parent
e2669ba6d4
commit
04c1b74cb8
|
@ -304,6 +304,9 @@ if (LIBCXX_BUILT_STANDALONE)
|
||||||
if (LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
|
if (LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
|
||||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS "-fsanitize-memory-track-origins")
|
list(APPEND LIBCXX_CXX_FEATURE_FLAGS "-fsanitize-memory-track-origins")
|
||||||
endif()
|
endif()
|
||||||
|
elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
|
||||||
|
list(APPEND LIBCXX_CXX_FEATURE_FLAGS
|
||||||
|
"-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover")
|
||||||
else()
|
else()
|
||||||
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
|
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -434,6 +434,11 @@ class Configuration(object):
|
||||||
if san == 'MemoryWithOrigins':
|
if san == 'MemoryWithOrigins':
|
||||||
self.compile_flags += ['-fsanitize-memory-track-origins']
|
self.compile_flags += ['-fsanitize-memory-track-origins']
|
||||||
self.config.available_features.add('msan')
|
self.config.available_features.add('msan')
|
||||||
|
elif san == 'Undefined':
|
||||||
|
self.compile_flags += ['-fsanitize=undefined',
|
||||||
|
'-fno-sanitize=vptr,function',
|
||||||
|
'-fno-sanitize-recover']
|
||||||
|
self.config.available_features.add('ubsan')
|
||||||
else:
|
else:
|
||||||
self.lit_config.fatal('unsupported value for '
|
self.lit_config.fatal('unsupported value for '
|
||||||
'libcxx_use_san: {0}'.format(san))
|
'libcxx_use_san: {0}'.format(san))
|
||||||
|
|
Loading…
Reference in New Issue