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 @@ -1581,6 +1581,23 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
15811581 CFLAGS="$CFLAGS -fno-sanitize=object-size"
15821582 CXXFLAGS="$CFLAGS -fno-sanitize=object-size"
15831583 ] )
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
15841601 ] , [ AC_MSG_ERROR ( [ UndefinedBehaviorSanitizer is not available] ) ] )
15851602fi
15861603
You can’t perform that action at this time.
0 commit comments