diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index dd518aebbb3..a2bb0204515 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -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 diff --git a/win32/build/confutils.js b/win32/build/confutils.js index c95ea1f3e67..e7193a61026 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -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");