Skip to content

Commit 27879fb

Browse files
authored
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.
1 parent ffab987 commit 27879fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

configure.ac

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,12 +1553,18 @@ if test "$PHP_MEMORY_SANITIZER" = "yes"; then
15531553
], [AC_MSG_ERROR([MemorySanitizer is not available])])
15541554
fi
15551555

1556-
if test "$PHP_ADDRESS_SANITIZER" = "yes"; then
1556+
AS_VAR_IF([PHP_ADDRESS_SANITIZER], [yes],
1557+
[AS_VAR_IF([PHP_VALGRIND], [no],, [AC_MSG_ERROR([m4_normalize([
1558+
Valgrind and address sanitizer are not compatible. Either disable Valgrind
1559+
(remove --with-valgrind) or disable address sanitizer (remove
1560+
--enable-address-sanitizer).
1561+
])])])
1562+
15571563
AX_CHECK_COMPILE_FLAG([-fsanitize=address], [
15581564
CFLAGS="$CFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
15591565
CXXFLAGS="$CXXFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
15601566
], [AC_MSG_ERROR([AddressSanitizer is not available])])
1561-
fi
1567+
])
15621568

15631569
if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
15641570
AX_CHECK_COMPILE_FLAG([-fsanitize=undefined], [

0 commit comments

Comments
 (0)