1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix GH-14798: Valgrind and address sanitizer are not compatible (#14826)

When configuring PHP with:

    ./configure --with-valgrind and --enable-address-sanitizer

configuration now errors now since these two are not compatible
configurations.
This commit is contained in:
Peter Kokot
2024-07-05 12:03:21 +02:00
committed by GitHub
parent ffab987fb1
commit 27879fb5d5

View File

@@ -1553,12 +1553,18 @@ if test "$PHP_MEMORY_SANITIZER" = "yes"; then
], [AC_MSG_ERROR([MemorySanitizer is not available])])
fi
if test "$PHP_ADDRESS_SANITIZER" = "yes"; then
AS_VAR_IF([PHP_ADDRESS_SANITIZER], [yes],
[AS_VAR_IF([PHP_VALGRIND], [no],, [AC_MSG_ERROR([m4_normalize([
Valgrind and address sanitizer are not compatible. Either disable Valgrind
(remove --with-valgrind) or disable address sanitizer (remove
--enable-address-sanitizer).
])])])
AX_CHECK_COMPILE_FLAG([-fsanitize=address], [
CFLAGS="$CFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
CXXFLAGS="$CXXFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
], [AC_MSG_ERROR([AddressSanitizer is not available])])
fi
])
if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
AX_CHECK_COMPILE_FLAG([-fsanitize=undefined], [