The PHP_SUBST_OLD adds variables to generated Makefile and creates
output shell variables to replace the @variable_name@ placeholders in
templates. These changed variables are not used in the generated
Makefile so the AC_SUBST is sufficient.
- ext/odbc
- sapi/embed
- sapi/fpm
- only substituted in scripts/php-config.in:
- PHP_INSTALLED_SAPIS
- SAPI_LIBNAME_SHARED
- SAPI_LIBNAME_STATIC
In the test cases, the compiler bails out due to a fatal error.
The data structures used by the compiler will contain stale values.
In particular, for the test case CG(loop_var_stack) will contain data.
The next compilation will incorrectly use elements from the previous
stack.
To solve this, we reset part of the compiler data structures.
We don't do a full re-initialization via init_compiler() because that will
also reset streams and resources.
Closes GH-13938.
* Include the source location in Closure names
This change makes stack traces involving Closures, especially multiple
different Closures, much more useful, because it's more easily visible *which*
closure was called for a given stack frame.
The implementation is similar to that of anonymous classes which already
include the file name and line number within their generated classname.
* Update scripts/dev/bless_tests.php for closure naming
* Adjust existing tests for closure naming
* Adjust tests for closure naming that were not caught locally
* Drop the namespace from closure names
This is redundant with the included filename.
* Include filename and line number as separate keys in Closure debug info
* Fix test
* Fix test
* Include the surrounding class and function name in closure names
* Fix test
* Relax test expecations
* Fix tests after merge
* NEWS / UPGRADING
`if (fpm_shm_size - size > 0)` will be rewritten by the compiler as this: `if (fpm_shm_size != size)`, which is undesirable. The reason this happens is that both variables are size_t, so subtracting them cannot be negative. The only way it can be not > 0, is if they're equal because the result will then be 0. This means that the else branch won't work properly. E.g. if `fpm_shm_size == 50` and `size == 51`, then `fpm_shm_size` will wraparound instead of becoming zero.
To showcase that the compiler actually does this, take a look at this
isolated case: https://godbolt.org/z/azobdWcrY. Here we can see the
usage of the compare instruction + cmove, so the "then" branch
is only done if the variables are equal.
And make locatable by via `php-config`. Prior to this, `libphp.*`
would always install to `$prefix/lib`. After this, they will install
to `$libdir`.
In practice, this will make it so that programs embedding libphp can
use `php-config` to determine appropriate compile flags without
guessing.
In `configure.ac`, it seems `$libdir` is mutated in some instances.
Ideally the mutated version would be stored in `$phplibdir` or
something. Instead of tracking down all uses of that variable, I
introduced another variable `$orig_libdir` that holds the original
value passed to the configure script.
This is a no-op for users unless they are compiling with `--libdir`
set to something other than `$prefix/lib`, the default.
Closes GH-12389
autoconf/libtool generating code to test features missed `void` for
C calls prototypes w/o arguments.
Note that specific changes related to libtool have to be upstreamed.
Co-authored-by: Peter Kokot <petk@php.net>
close GH-13732
This fixes two warnings when building litespeed SAPI:
```
.../php-src/sapi/litespeed/lscriu.c:312:14: warning:
'LSCRIU_Error_File_Name' defined but not used
[-Wunused-function]
312 | static char *LSCRIU_Error_File_Name(char *pchFile, int max_len)
| ^~~~~~~~~~~~~~~~~~~~~~
.../php-src/sapi/litespeed/lscriu.c:102:12: warning:
's_criu_debug' defined but not used [-Wunused-variable]
102 | static int s_criu_debug = 0;
| ^~~~~~~~~~~~
```
The embed SAPI has been around for quite a while now, and many apps
already use it in production. It can be marked as non experimental to
avoid confusion.
[skip ci]
The SELinux library has had pkg-config/pkgconf integration since ~2009.
To ease this change, the check without pkgconf is executed in case the
libselinux.pc file is not found on the system.
A sanity check also covers cases where the library path is overriden:
/configure --enable-fpm --with-fpm-selinux \
SELINUX_CFLAGS=-I/path/to/libselinux \
SELINUX_LIBS="-L/path/to/libselinux -lselinux"
This also removes the redundant symbol HAVE_SELINUX_SELINUX_H since the
selinux/selinux.h header is considered a required part of the SELinux
library package.
The AppArmor library has had pkg-config/pkgconf integration since its
early versions (2012), when it was integrated from the libaalogparse
into the AppArmor project. To ease this change, the check without
pkgconf is executed in case the libapparmor.pc file is not found on the
system.
A sanity check also covers cases where the library path is overriden:
/configure --enable-fpm --with-fpm-apparmor \
APPARMOR_CFLAGS=-I/path/to/libapparmor \
APPARMOR_LIBS="-L/path/to/libapparmor -lapparmor"
This also removes the redundant symbol HAVE_SYS_APPARMOR_H since the
sys/apparmor.h header is considered a required part of the AppArmor
library package.
Instead of running the user/group permissions check (unknown when
cross-compiling), check with linking (AC_LINK_IFELSE) can be sufficient
to test if ACL_USER and ACL_GROUP are available (missing on macOS). The
AC_SEARCH_LIBS is used to test the ACL availability in c or acl library.
This removes the unused HAVE_SYSTEMD_SD_DAEMON_H symbol defined by the
Autoconf AC_CHECK_HEADERS macro.
The systemd/sd-daemon.h sanity check now also works when systemd library
is overriden by pkgconf variables for custom or development places:
./configure --enable-fpm --with-fpm-systemd \
SYSTEMD_CFLAGS=-I/path/to/systemd/src \
SYSTEMD_LIBS="-L/path/to/systemd/build -lsystemd"
The clock_gettime() is found in libc on modern systems, except on
Solaris <= 10 and possible similar systems, it is in the rt library.
This checks if clock_gettime() exists in the libc, then it checks if rt
library has clock_gettime, prepends it to LIBS and defines the
HAVE_CLOCK_GETTIME symbol with the template from the AC_CHECK_FUNCS.
The ac_cv_func_clock_gettime is a cache variable set by AC_CHECK_FUNCS.