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 @@ -1620,6 +1620,23 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
16201620 CFLAGS="$CFLAGS -fno-sanitize=object-size"
16211621 CXXFLAGS="$CFLAGS -fno-sanitize=object-size"
16221622 ] )
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
16231640 ] , [ AC_MSG_ERROR ( [ UndefinedBehaviorSanitizer is not available] ) ] )
16241641fi
16251642
You can’t perform that action at this time.
0 commit comments