File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1581,6 +1581,23 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
1581
1581
CFLAGS="$CFLAGS -fno-sanitize=object-size"
1582
1582
CXXFLAGS="$CFLAGS -fno-sanitize=object-size"
1583
1583
] )
1584
+
1585
+ dnl Clang 17 adds stricter function pointer compatibility checks where pointer args cannot be
1586
+ dnl cast to void*. In that case, set -fno-sanitize=function.
1587
+ OLD_CFLAGS="$CFLAGS"
1588
+ CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
1589
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
1590
+ void foo(char *string) {}
1591
+ int main(void) {
1592
+ void (*f)(void *) = (void (*)(void *))foo;
1593
+ f("foo");
1594
+ }
1595
+ ] ] ) ] ,,[ ubsan_needs_no_function=yes] ,)
1596
+ CFLAGS="$OLD_CFLAGS"
1597
+ if test "$ubsan_needs_no_function" = yes; then
1598
+ CFLAGS="$CFLAGS -fno-sanitize=function"
1599
+ CXXFLAGS="$CFLAGS -fno-sanitize=function"
1600
+ fi
1584
1601
] , [ AC_MSG_ERROR ( [ UndefinedBehaviorSanitizer is not available] ) ] )
1585
1602
fi
1586
1603
You can’t perform that action at this time.
0 commit comments