mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.3'
* PHP-8.3: Disable -fsanitize=function on Clang 17
This commit is contained in:
commit
a785b2fac0
1 changed files with 17 additions and 0 deletions
17
configure.ac
17
configure.ac
|
@ -1620,6 +1620,23 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
|
|||
CFLAGS="$CFLAGS -fno-sanitize=object-size"
|
||||
CXXFLAGS="$CFLAGS -fno-sanitize=object-size"
|
||||
])
|
||||
|
||||
dnl Clang 17 adds stricter function pointer compatibility checks where pointer args cannot be
|
||||
dnl cast to void*. In that case, set -fno-sanitize=function.
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
void foo(char *string) {}
|
||||
int main(void) {
|
||||
void (*f)(void *) = (void (*)(void *))foo;
|
||||
f("foo");
|
||||
}
|
||||
]])],,[ubsan_needs_no_function=yes],)
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
if test "$ubsan_needs_no_function" = yes; then
|
||||
CFLAGS="$CFLAGS -fno-sanitize=function"
|
||||
CXXFLAGS="$CFLAGS -fno-sanitize=function"
|
||||
fi
|
||||
], [AC_MSG_ERROR([UndefinedBehaviorSanitizer is not available])])
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue