File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1534,6 +1534,23 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
1534
1534
AX_CHECK_COMPILE_FLAG ( [ -fsanitize=undefined] , [
1535
1535
CFLAGS="$CFLAGS -fsanitize=undefined"
1536
1536
CXXFLAGS="$CXXFLAGS -fsanitize=undefined"
1537
+
1538
+ dnl Clang 17 adds stricter function pointer compatibility checks where pointer args cannot be
1539
+ dnl cast to void*. In that case, set -fno-sanitize=function.
1540
+ OLD_CFLAGS="$CFLAGS"
1541
+ CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
1542
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
1543
+ void foo(char *string) {}
1544
+ int main(void) {
1545
+ void (*f)(void *) = (void (*)(void *))foo;
1546
+ f("foo");
1547
+ }
1548
+ ] ] ) ] ,,[ ubsan_needs_no_function=yes] ,)
1549
+ CFLAGS="$OLD_CFLAGS"
1550
+ if test "$ubsan_needs_no_function" = yes; then
1551
+ CFLAGS="$CFLAGS -fno-sanitize=function"
1552
+ CXXFLAGS="$CFLAGS -fno-sanitize=function"
1553
+ fi
1537
1554
] , [ AC_MSG_ERROR ( [ UndefinedBehaviorSanitizer is not available] ) ] )
1538
1555
fi
1539
1556
You can’t perform that action at this time.
0 commit comments