Skip to content

Commit bcab663

Browse files
committed
Add cross-compiling 3rd argument to AC_RUN_IFELSE
Autotools emits warning if 3rd argument is empty. Call is wrapped in the AC_CACHE_CHECK with php_cv_* cache variable name according to the docs.
1 parent b333164 commit bcab663

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,15 +1586,16 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
15861586
dnl cast to void*. In that case, set -fno-sanitize=function.
15871587
OLD_CFLAGS="$CFLAGS"
15881588
CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
1589+
AC_CACHE_CHECK([whether to add -fno-sanitize=function],[php_cv_ubsan_no_function],[
15891590
AC_RUN_IFELSE([AC_LANG_SOURCE([[
15901591
void foo(char *string) {}
15911592
int main(void) {
15921593
void (*f)(void *) = (void (*)(void *))foo;
15931594
f("foo");
15941595
}
1595-
]])],,[ubsan_needs_no_function=yes],)
1596+
]])],[php_cv_ubsan_no_function=no],[php_cv_ubsan_no_function=yes],[php_cv_ubsan_no_function=no])])
15961597
CFLAGS="$OLD_CFLAGS"
1597-
if test "$ubsan_needs_no_function" = yes; then
1598+
if test "$php_cv_ubsan_no_function" = yes; then
15981599
CFLAGS="$CFLAGS -fno-sanitize=function"
15991600
CXXFLAGS="$CFLAGS -fno-sanitize=function"
16001601
fi

0 commit comments

Comments
 (0)