Skip to content

Commit

Permalink
Add cross-compiling 3rd argument to AC_RUN_IFELSE
Browse files Browse the repository at this point in the history
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.

Closes GH-12966
  • Loading branch information
petk committed Dec 22, 2023
1 parent b333164 commit de5557b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -5,6 +5,8 @@ PHP NEWS
- Core:
. Fixed bug GH-12953 (false positive SSA integrity verification failed when
loading composer classmaps with more than 11k elements). (nielsdos)
. Fixed bug GH-12966 (missing cross-compiling 3rd argument so Autoconf doesn't
emit warnings). (Peter Kokot)

- Cli:
. Fix incorrect timeout in built-in web server when using router script and
Expand Down
5 changes: 3 additions & 2 deletions configure.ac
Expand Up @@ -1586,15 +1586,16 @@ if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
dnl cast to void*. In that case, set -fno-sanitize=function.
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-sanitize-recover=undefined"
AC_CACHE_CHECK([whether to add -fno-sanitize=function],[php_cv_ubsan_no_function],[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
void foo(char *string) {}
int main(void) {
void (*f)(void *) = (void (*)(void *))foo;
f("foo");
}
]])],,[ubsan_needs_no_function=yes],)
]])],[php_cv_ubsan_no_function=no],[php_cv_ubsan_no_function=yes],[php_cv_ubsan_no_function=no])])
CFLAGS="$OLD_CFLAGS"
if test "$ubsan_needs_no_function" = yes; then
if test "$php_cv_ubsan_no_function" = yes; then
CFLAGS="$CFLAGS -fno-sanitize=function"
CXXFLAGS="$CFLAGS -fno-sanitize=function"
fi
Expand Down

0 comments on commit de5557b

Please sign in to comment.