Skip to content

Commit 7c15d2b

Browse files
committed
Add cross-compiling 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 5d85378 commit 7c15d2b

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
@@ -1622,15 +1622,16 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
16221622
dnl cast to void*. In that case, set -fno-sanitize=function.
16231623
OLD_CFLAGS="$CFLAGS"
16241624
CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
1625+
AC_CACHE_CHECK([whether to add -fno-sanitize=function],php_cv_ubsan_no_function,[
16251626
AC_RUN_IFELSE([AC_LANG_SOURCE([[
16261627
void foo(char *string) {}
16271628
int main(void) {
16281629
void (*f)(void *) = (void (*)(void *))foo;
16291630
f("foo");
16301631
}
1631-
]])],,[ubsan_needs_no_function=yes],)
1632+
]])],[php_cv_ubsan_no_function=no],[php_cv_ubsan_no_function=yes],[php_cv_ubsan_no_function=no])])
16321633
CFLAGS="$OLD_CFLAGS"
1633-
if test "$ubsan_needs_no_function" = yes; then
1634+
if test "$php_cv_ubsan_no_function" = yes; then
16341635
CFLAGS="$CFLAGS -fno-sanitize=function"
16351636
CXXFLAGS="$CFLAGS -fno-sanitize=function"
16361637
fi

0 commit comments

Comments
 (0)