mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Disable optimizations for ASan instrumented builds
ASan instrumentation does not support the MSVC debug runtime, but still it does not make sense to enable optimizations for such builds, since they are not meant for production usage anyway, and although memory corruption issues are still found in optimized builds, the generated diagnostics are close to being useless, and apparently sometimes even outright wrong. Therefore, we disable all optimizations for ASan instrumented builds. We also introduce and use `ZEND_WIN32_NEVER_INLINE` for ASan enabled builds to avoid inlining of functions, so we get even better diagnostics.
This commit is contained in:
parent
05f3cd23ed
commit
c9908ee5eb
@ -289,7 +289,7 @@ char *alloca();
|
||||
(_default)
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#if ZEND_DEBUG || defined(ZEND_WIN32_NEVER_INLINE)
|
||||
# define zend_always_inline inline
|
||||
# define zend_never_inline
|
||||
#else
|
||||
|
@ -3425,8 +3425,13 @@ function toolset_setup_build_mode()
|
||||
ADD_FLAG("CFLAGS", "/Zi");
|
||||
ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
|
||||
}
|
||||
// Equivalent to Release_TSInline build -> best optimization
|
||||
ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");
|
||||
ADD_FLAG("CFLAGS", "/LD /MD /W3");
|
||||
if (PHP_SANITIZER == "yes" && CLANG_TOOLSET) {
|
||||
ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=0");
|
||||
} else {
|
||||
// Equivalent to Release_TSInline build -> best optimization
|
||||
ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");
|
||||
}
|
||||
|
||||
// if you have VS.Net /GS hardens the binary against buffer overruns
|
||||
// ADD_FLAG("CFLAGS", "/GS");
|
||||
|
Loading…
Reference in New Issue
Block a user