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 @@ -1620,6 +1620,23 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
1620
1620
CFLAGS="$CFLAGS -fno-sanitize=object-size"
1621
1621
CXXFLAGS="$CFLAGS -fno-sanitize=object-size"
1622
1622
] )
1623
+
1624
+ dnl Clang 17 adds stricter function pointer compatibility checks where pointer args cannot be
1625
+ dnl cast to void*. In that case, set -fno-sanitize=function.
1626
+ OLD_CFLAGS="$CFLAGS"
1627
+ CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
1628
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
1629
+ void foo(char *string) {}
1630
+ int main(void) {
1631
+ void (*f)(void *) = (void (*)(void *))foo;
1632
+ f("foo");
1633
+ }
1634
+ ] ] ) ] ,,[ ubsan_needs_no_function=yes] ,)
1635
+ CFLAGS="$OLD_CFLAGS"
1636
+ if test "$ubsan_needs_no_function" = yes; then
1637
+ CFLAGS="$CFLAGS -fno-sanitize=function"
1638
+ CXXFLAGS="$CFLAGS -fno-sanitize=function"
1639
+ fi
1623
1640
] , [ AC_MSG_ERROR ( [ UndefinedBehaviorSanitizer is not available] ) ] )
1624
1641
fi
1625
1642
You can’t perform that action at this time.
0 commit comments