mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 23:36:06 +00:00
[asan][windows] When compiling with clang-cl or MSVC pass /Zl (that's a little L) (#85874)
/Zl is the equivalent of -nodefaultlibs. The idea here is to make sure that the asan runtime doesn't have any defaultlibs directives, which makes it easier to mix an asan runtime built with the dynamic CRT with an application built with the static CRT (or vise-versa). This is part of the overall effort to remove the static asan runtime on windows entirely: https://github.com/llvm/llvm-project/pull/81677 Co-authored-by: Amy Wishnousky <amyw@microsoft.com>
This commit is contained in:
parent
20e0bacd05
commit
dc43aa439e
@ -85,6 +85,9 @@ SET(ASAN_HEADERS
|
||||
include_directories(..)
|
||||
|
||||
set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
||||
|
||||
append_list_if(MSVC /Zl ASAN_CFLAGS)
|
||||
|
||||
set(ASAN_COMMON_DEFINITIONS ${COMPILER_RT_ASAN_SHADOW_SCALE_DEFINITION})
|
||||
|
||||
append_rtti_flag(OFF ASAN_CFLAGS)
|
||||
|
@ -218,6 +218,8 @@ include_directories(..)
|
||||
set(SANITIZER_COMMON_DEFINITIONS
|
||||
HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H})
|
||||
|
||||
# note: L not I, this is nodefaultlibs for msvc
|
||||
append_list_if(MSVC /Zl SANITIZER_COMMON_CFLAGS)
|
||||
set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
||||
|
||||
# Too many existing bugs, needs cleanup.
|
||||
|
@ -41,6 +41,7 @@ set(UBSAN_HEADERS
|
||||
include_directories(..)
|
||||
|
||||
set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
||||
append_list_if(MSVC /Zl UBSAN_CFLAGS)
|
||||
append_rtti_flag(OFF UBSAN_CFLAGS)
|
||||
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user