Commit Graph

668 Commits

Author SHA1 Message Date
Derick Rethans
9c9f49a1f4
Merge branch 'PHP-8.2' into PHP-8.3 2024-05-20 15:49:46 +01:00
Derick Rethans
e5cb9d7df9
Force ffp-contract to off 2024-05-20 15:13:53 +01:00
Peter Kokot
bc09cd2bc8
Fix the aligned variable attribute check (#14211)
By default compilers may not treat attribute warnings as errors when
encountering an unknown __attribute__, unless some error option is
provided (-Werror=attributes, -Werror=unknown-attributes, -Werror...).
This fixes the check and wraps it into a separate M4 macro to be
extendable in the future if needed. It checks if conftest.err file was
generated by the compilation check when warnings appear. Also, PHP check
is a bit customized by using __alignof__ keyword, so it is left in there
for now to not break existing checks.
2024-05-19 12:18:59 +02:00
Peter Kokot
52767343b2
Reduce unused variable warnings in config.log (#14264)
This reduces -Wunused-variable and -Wunused-but-set-variable warnings
generated in the Autoconf's config.log to comply with possible stricter
default compiler configuration on the system to avoid having false
results.
2024-05-18 18:28:20 +02:00
Peter Kokot
4465e5082c
Use AC_SEARCH_LIBS for socketpair, gethostname and gethostbyaddr (#14116)
The socketpair():
* C library: Solaris 11.4 and most other systems
* libsocket: Solaris <= 11.3 and illumos
* libnetwork: Haiku

The gethostname() check is moved to AC_CHECK_FUNCS:
* C library: most systems
* libnsl: none
* libnetwork: Haiku (which is already checked in the libraries section)

The gethostbyaddr():
* C library: most systems, Solaris 11.4
* libnsl: Solaris 11.3, illumos
* libnetwork: Haiku

This also removes redundant unused symbols:
- HAVE_GETHOSTBYADDR
- HAVE_LIBNETWORK
- HAVE_LIBNSL

The outdated comment about -lnsl and -lsocket linking has been removed
because these systems are long not supported anymore and this issue is
not relevant anymore like mentioned. The initial solution was different
than the one with the PHP_CHECK_FUNC macros at the current versions.
See commit a188fac946 where the
gethostbyaddr() was checked conditionally based on the gethostname()
availability in libc. Main issue was mostly related to the redundant nsl
library being always linked because of the AC_CHECK_LIB.
2024-05-03 19:55:24 +02:00
Jakub Zelenka
bab75e1f5c
PHP 8.3 is now for PHP-8.3.8-dev 2024-04-23 19:27:29 +01:00
Sergey Panteleev
3b5321dffe
PHP-8.2 is now for PHP 8.2.20-dev 2024-04-23 17:22:54 +03:00
Peter Kokot
719237954b
Substitute PEAR_INSTALLDIR only when enabling PEAR (#13994)
When not using --with-pear configure option, the Makefile doesn't need
the PEAR_INSTALLDIR variable. Also, this variable isn't directly
substituted using the @PEAR_INSTALLDIR@ in any template, so the
PHP_SUBST can be used.
2024-04-18 23:05:46 +02:00
Peter Kokot
6fed6d85db
Use AC_SUBST instead of PHP_SUBST_OLD where possible (#13993)
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
2024-04-18 22:17:27 +02:00
Ørjan Malde
ff76cb738b
rudimentary midipix port (#13896) 2024-04-18 08:19:44 +02:00
Arnaud Le Blanc
46b6ad6dae
Inline GDB scripts in the PHP binary (#13600)
This inlines .gdbinit and php_gdb.py in the .debug_gdb_scripts section of the PHP binary so that GDB can auto-load them regardless of the current directory or the availability of the PHP source code (albeit some functionalities of php_gdb.py currently rely on the source being available).
2024-04-16 15:10:01 +02:00
Eric Mann
67fc53e1be
PHP-8.3 is now for PHP 8.3.7-dev 2024-04-10 08:45:14 -07:00
Peter Kokot
de03a7c8f9
Remove unused os/signpost.h header check (#13920)
Removed via be275433d9.
2024-04-09 23:52:57 +02:00
qiangxuhui
0766ac6e35
loongarch64 support for fibers
Add loongarch64 assembly files from Boost, needed for fibers support,
and hook up loongarch64 fibers support during configure.

Close GH-13914
2024-04-08 18:59:02 +01:00
Peter Kokot
413f2cd427
Refactor root build directories (#13785)
This adds all root build directories in one call. PEAR directory is
created only when enabled and duplicated Zend directory creation is
removed, because it was intended for the zend_config.h when building
out-of-source or using the config.status manually before the
PHP_ADD_BUILD_DIR was introduced in the build system.
2024-03-27 16:20:03 +01:00
Eric Mann
9381129d1b
PHP-8.3 is now for PHP 8.3.6-dev 2024-03-26 09:08:14 -07:00
Pierrick Charron
7942268899
PHP-8.2 is now for PHP 8.2.19-dev 2024-03-26 08:49:44 -04:00
Adam Saponara
0c07b0d94f
Make --enable-embed libs respect --libdir
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
2024-03-23 07:46:31 +01:00
Peter Kokot
530e0d68eb
Create modules directory in a centralized location (#13411)
Shared objects of extensions during the *nix build are copied to the
`modules` directory. It is a practice established since the early days
of the PHP build system. Other build systems may have similar concept of
"library destination directory". On Windows, they are put into the root
build directory. Such directory simplifies collection of the shared
extensions during testing, or when running the cli executable at the end
of the build process.

This change ensures that the directory is consistently created in a
single location, for both the primary PHP build process and when
utilizing `phpize` within community extensions.

The AC_CONFIG_COMMANDS_PRE is executed at the end of the configuration
phase, before creating the config.status script, where also build
directories and global Makefile are created.

The pwd is executed using the recommended $(...) instead of the obsolete
backticks. Autoconf automatically locates the proper shell and
re-executes the configure script if such case is found that $(...) is
not supported (the initial /bin/sh on Solaris 10, for example).
2024-03-21 17:43:49 +01:00
David Carlier
839153069f Merge branch 'PHP-8.2' into PHP-8.3 2024-03-18 06:58:14 +00:00
David Carlier
868257a3de Fix GH-13727: macro generating invalid call test prototypes fixes.
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
2024-03-18 06:53:39 +00:00
Peter Kokot
c6f4c26e1b
Check major, minor and makedev with Autoconf's AC_HEADER_MAJOR (#13706)
The non-standard major(), minor(), and makedev() can be defined as
macros. These are usually used together with the Autoconf macro
AC_HEADER_MAJOR, which defines the MAJOR_IN_MKDEV if sys/mkdev.h is
available, or MAJOR_IN_SYSMACROS if sys/sysmacros.h is available.

On Solaris/illumos they are in the sys/mkdev.h header (macro defined to
libc implementation) and in sys/sysmacros.h (macro defined with binary
operators and bits shifting). On systems with musl and glibc 2.28 or
later they are defined in sys/sysmacros.h, in glibc 2.27 and earlier
they were in sys/types.h. On BSD-based systems and macOS they are in the
sys/types.h.

Autoconf 2.70 has fixed the AC_HEADER_MAJOR macro, so it detects the
headers properly due to glibc 2.25 throwing deprecation warnings when
using the macros from sys/types.h. With Autoconf 2.69 and earlier the
ac_cv_header_sys_types_h_makedev cache variable can skip the
improper sys/types.h check in the macro.

This change syncs the usage within the ext/fileinfo/libmagic bundled
library and ext/posix.

When sys/mkdev.h header is available, code includes that, otherwise
it conditionally includes the sys/sysmacros.h. The ext/posix has
additional check whether linker sees the makedev, otherwise it checks
if makedev is declared within the given set of headers accoring to the
AC_HEADER_MAJOR logic. Previously the AC_CHECK_FUNCS didn't detect it.
2024-03-15 21:18:05 +01:00
Peter Kokot
d2eb3e54ea
Check asm goto support with AC_LINK_IFELSE (#13716)
The '__asm__ goto' support is properly recognized by a simpler linking
check instead of a run check for easier cross-compilation. The
compile only check (AC_COMPILE_IFELSE) might produce false positives
results with certain compiler options.
2024-03-15 06:44:27 +01:00
Claudio Jeker
4bf4c24aa8 Implement fcontext handling for sparc64_sysv_elf.
This was tested on OpenBSD sparc64 and all fiber related tests pass.
On OpenBSD stackghost prevents the modification of the return address
and therefor an extra trampoline is needed in make_fcontext(). This
should not matter on other OS implementing sysv ABI and the trampoline
should work there as well.

Close GH-13382.
2024-03-12 11:06:18 +00:00
Peter Kokot
8595bead87
Use default Autoconf's AC_LANG_PROGRAM (#13565)
This adds default test program prologue and body of
`int main(void) { return 0; }` where possible.
2024-03-11 00:24:57 +01:00
Peter Kokot
a0b821b543
Check library containing socket() with AC_SEARCH_LIBS (#13642)
Solaris/illumos systems have socket() in the socket library, Haiku has
it in network, Windows in ws2_32, and other systems in libc. This also
removes redundant and unused HAVE_SOCKET symbol.
2024-03-10 06:53:39 +01:00
Peter Kokot
2f6a210755
Use memmove() unconditionally in the code (#13647)
The memmove() function is C99 standard function [1] and check was left for
the PCRE2 bundled library. It can be simplified by passing the compile
option instead of checking always available function on current systems.
External PCRE2 library on the system doesn't need this.

[1]: https://port70.net/~nsz/c/c99/n1256.html#7.21.2.2
2024-03-09 20:30:08 +01:00
Peter Kokot
a46438e87f
Remove htonl() Autoconf check (#13627)
The htonl() function is available in libc on current *nix systems. On
Solaris versions around 2.5.1 it was located in the socket library.
Haiku has it in libc and Windows in ws2_32, which is linked as part of
the common libraries. This removes the redundant HAVE_HTONL symbol.
2024-03-08 19:36:30 +01:00
Peter Kokot
7bca3c7f45
Check sys/sdt.h with AC_CHECK_HEADER (#13626)
When using DTrace, sys/sdt.h is included unconditionally, without the
HAVE_SYS_SDT_H symbol.
2024-03-08 19:35:44 +01:00
Peter Kokot
42a4e50513
Sync logical operators in shell scripting code (#13560)
This updates the obsolescent `-a` and `-o` binary primaries to `&&` and
`||`.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
2024-03-01 20:40:16 +01:00
Peter Kokot
7d0e2d8e4d
Add missing memfd_create Autoconf check for bundled pcre2lib (#13561)
This moves memfd_create (HAVE_MEMFD_CREATE) to configure.ac. Since
ext/pcre is always enabled and check can be done in this case for
ext/pcre and ext/opcache at once.
2024-03-01 17:17:28 +01:00
Peter Kokot
a48ed12ea9
Find and link network library as needed with AC_SEARCH_LIBS (#13553)
This prepends -lnetwork as needed (Haiku) whether linker sees the
setsockopt function and avoids defining redundant symbols, such as
HAVE_LIBNETWORK and HAVE_SETSOCKOPT.
2024-02-29 22:04:13 +01:00
Peter Kokot
154517eba9
Simplify openpty Autoconf check (#13494)
This removes redundant symbols HAVE_LIBUTIL and HAVE_LIBBSD.
2024-02-28 20:14:24 +01:00
Peter Kokot
acb677cbcf
Simplify Pgrab and proc library Autoconf check (#13488)
For Solaris/illumos systems, in this case, the check can be done using
AC_SEARCH_LIBS, which avoids defining redundant symbols like HAVE_PGRAB
and HAVE_LIBPROC.
2024-02-28 18:41:51 +01:00
Jakub Zelenka
47dca339a4
PHP-8.3 is now for PHP-8.3.5-dev 2024-02-28 11:46:49 +00:00
Sergey Panteleev
e1a8ebd61b
PHP-8.2 is now for PHP 8.2.18-dev 2024-02-27 17:26:44 +03:00
Peter Kokot
d024dd3abd
Simplify nanosleep Autoconf check (#13490)
The nanosleep() is mostly found in libc, except on systems, such as
Solaris <= 10 or the discontinued OpenSolaris, it is in the rt library.

This checks if nanosleep() exists in the libc, then it checks if rt
library has nanosleep, prepends it to LIBS and defines the
HAVE_NANOSLEEP symbol with the template from the AC_CHECK_FUNCS.
2024-02-25 18:28:33 +01:00
Jorg Sowa
9c4beac8d3 Remove inet_aton
This removes the deprecated inet_aton and its Windows implementation.
The inet_aton can be replaced with platform agnostic inet_pton.

Closes GH-13479
2024-02-23 23:16:43 +01:00
Peter Kokot
bd365149f2
Find and link math library as needed with AC_SEARCH_LIBS (#13481)
On some systems (Haiku) the math library is part of the C library and it
doesn't need to be explicitly prepended to LIBS. The redundant HAVE_LIBM
symbol defined by the AC_CHECK_LIB has been removed.
2024-02-23 20:48:10 +01:00
Peter Kokot
e9f8defd34
Find and link dl library as needed with AC_SEARCH_LIBS (#13482)
AC_SEARCH_LIBS can be used to check for dlopen and if dl library needs
to be prepended to LIBS. The dlsym is available with the same scope as
dlopen (if dlopen is present, also dlsym is). The redundant HAVE_DLOPEN
and HAVE_DLSYM symbols have been removed.
2024-02-23 20:44:06 +01:00
Peter Kokot
f75143cc0a
Remove unused symbol ZEND_FIBER_ASM (#13467)
The symbol ZEND_FIBER_ASM is not defined on Windows and not used around
the ecosystem.
2024-02-22 13:44:04 +01:00
Peter Kokot
e72f0c887b
Simplify prctl and procctl Autoconf checks (#13450)
The AC_CHECK_FUNCS checks whether the linker sees the function in the
usual libraries, in this case libc. This is a simple trick to also check
existence of belonging headers, since the code uses HAVE_PRCTL and
HAVE_PROCCTL to include headers and call functions.
2024-02-21 09:04:37 +01:00
Jorg Adam Sowa
e630aacf79
Remove HAVE_INET_PTON (#13410) 2024-02-21 00:43:56 +00:00
Peter Kokot
847c7459eb
Remove Autoconf check for C99 header stdint.h (#13444)
This removes the redundant check that defines the HAVE_STDINT_H symbol,
which is used in the ext/date/lib and ext/fileinfo/libmagic but on both
places patches and other header files take care of this so it is always
included unconditionally in php-src.

Autoconf by default still automatically checks for stdint.h internally
in current versions, so for now the HAVE_STDINT_H symbol is still
defined in php_config.h and will be made redundant along the way.
2024-02-20 20:19:28 +01:00
Peter Kokot
b41a5023f9
Remove malloc.h (#13436)
This removes the deprecated malloc.h header Autoconf check on *nix
systems and its HAVE_MALLOC_H symbol. It can be replaced mostly with the
stdlib.h. The libgd usptream also doesn't include it anymore.

On Windows, it is still used for some memory allocation functions, but
can be replaced with stdlib.h in the future.
2024-02-20 18:02:54 +01:00
Peter Kokot
25923987b5
Refactor PHP_SOCKADDR_CHECKS (#13406)
Instead of the project macro, the sockaddr_storage and sockaddr.sa_len
can be checked with the AC_CHECK_TYPES and AC_CHECK_MEMBERS by including
the sys/socket.h. Some systems (~1988) didn't include the sys/types.h in
the socket.h (obsolete on current systems).

These macros by default define the HAVE_STRUCT_SOCKADDR_STORAGE and
HAVE_STRUCT_SOCKADDR_SA_LEN.
2024-02-16 13:29:20 +01:00
Peter Kokot
9588796294
Use AC_CHECK_TYPES for checking struct flock (#13397)
The struct flock is defined in fcntl.h, if system has it. This removes
redundant PHP_STRUCT_FLOCK M4 macro in favor of the AC_CHECK_TYPES,
which by default defines symbol HAVE_STRUCT_FLOCK.
2024-02-15 19:17:01 +01:00
Peter Kokot
eb76a83008
Remove PHP atomic includes and PHP_DEFINE M4 macro (#13372)
PHP_DEFINE was introduced with the PHP 5 build system
9d9d39a0de and then refactored via
350de12bc2.

This was once used to put defined constants into a single file to have
more fine-graned dependencies (atomic includes). Since no known PHP
extension is using this and it makes very little sense to use this, this
M4 macro can be removed in favor of the Autoconf native way using
AC_DEFINE and the usual included files php_config.h and config.h.

- Generated unused include directory removed
- Remove include dir from DEFS
- Remove also include dir from PDO checks
2024-02-11 22:14:46 +01:00
Peter Kokot
41e3044f48
Remove obsolete check for missing fclose declaration (#13360)
SunOS 4.1.4 from 1994 didn't have fclose declared in standard header
stdio.h. This doesn't need to be checked anymore, as fclose is part of
the C89+ standard and declaration is present on Solaris 10 (SunOS 5.10)
and later.
2024-02-09 18:11:49 +00:00
Derick Rethans
a4d64b2605
Removed ext/oci8 and ext/pdo_oci (#13327)
* Removed ext/oci8 and ext/pdo_oci

They now live in their own repositories:

https://github.com/php/pecl-database-oci8
https://github.com/php/pecl-database-pdo_oci

As per: https://wiki.php.net/rfc/unbundle_imap_pspell_oci8
2024-02-07 15:34:39 +00:00
Ilija Tovilo
631bc81607
Implement stackless internal function calls
Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-12461
2024-02-06 17:42:28 +01:00
Eric Mann
5094a636ae
PHP-8.3 is now for PHP-8.3.4-dev 2024-01-30 12:42:45 -08:00
Pierrick Charron
0454f4ade4
PHP-8.2 is now for PHP 8.2.17-dev 2024-01-30 12:43:37 -05:00
Peter Kokot
ad9250183f
Remove obsolete _XPG_IV preprocessor directive (#13035)
This was once used on SINIX UNIX variant and MIPS processors with the
last release in 1995 to have working gettimeofday().
2024-01-11 10:54:13 +01:00
Peter Kokot
64751a0df0 Merge branch 'PHP-8.3'
* PHP-8.3:
  Set libtool tag per command instead of global one
2024-01-10 09:17:48 +01:00
Peter Kokot
04954f6b2c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Set libtool tag per command instead of global one
2024-01-10 09:13:39 +01:00
Jan Palus
d57a7767a2 Set libtool tag per command instead of global one
Global --tag=CC defined in configure.ac is not correct in all cases. For example
linking objects that were compiled from C++ sources needs to be done with C++
compiler, however for link mode libtool will prefer compiler indicated with
--tag.

Fixes GH-12349
2024-01-10 09:09:45 +01:00
Peter Kokot
6f3888fe9a
Remove root library check for dlopen() and dlsym() (#13086)
The root library was added here for the Haiku system, to check dlopen()
and dlsym(). However, the root library is already explicitly linked in
the system, and it does not need to be checked neither linked anymore,
since at least ~2013.
2024-01-07 10:07:17 +01:00
Peter Kokot
22ec2585a1
Omit HAVE_INET_NTOP definition with AC_CHECK_FUNC (#13073)
Following the bb1109d9f1 this now doesn't
define the unused symbol HAVE_INET_NTOP also in Autotools build system.
2024-01-05 19:41:54 +01:00
Peter Kokot
2caa2fe00d
Remove libbind from build system (#12991)
Linking with -lbind is no longer relevant. The libbind was once part of
the ISC project bind9. In 2013, maintenance was moved to NetBSD which
integrated it into netresolv.

[1]: https://www.isc.org/othersoftware/#libbind
[2]: https://wiki.netbsd.org/individual-software-releases/netresolv/
2024-01-04 19:23:46 +01:00
Jakub Zelenka
d33a534863
PHP-8.3 is now for PHP-8.3.3-dev 2024-01-02 15:50:36 +00:00
Peter Kokot
3164a9effb
Remove unused in_addr_t type alias (#12994)
The fastcgi code was refactored in
18cf4e0a8a and in_addr_t is no longer
used. The PHP_CHECK_IN_ADDR_T is also obsolete and not recommended way
to discover availability of the type. If needed in the future, the
AC_CHECK_TYPES can be used instead.
2024-01-02 16:41:33 +01:00
Sergey Panteleev
5d79c1b74d
PHP-8.2 is now for PHP 8.2.16-dev 2024-01-02 16:42:14 +03:00
Peter Kokot
907b07822c Merge branch 'PHP-8.3'
* PHP-8.3:
  Add cross-compiling 3rd argument to AC_RUN_IFELSE
2023-12-22 16:35:40 +01:00
Peter Kokot
71e002b38e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add cross-compiling 3rd argument to AC_RUN_IFELSE
2023-12-22 16:34:42 +01:00
Peter Kokot
de5557b02f 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.

Closes GH-12966
2023-12-22 16:24:40 +01:00
Cristian Rodríguez
927adfb1a6
Use a single version of mempcpy(3) (#12257)
While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_mempcpy, adds zend_mempcpy and transforms
open-coded parts into function calls.
2023-12-20 15:16:32 +00:00
Thomas Hurst
b90c9ca7db Enable ifunc checks on FreeBSD 12+
This was disabled in 2019 due to problems reported in FreeBSD 11. The original
report (PHP bug 77284) includes a comment that FreeBSD 12 worked - which also
happens to be the first version ifunc use appeared in libc.

Close GH-12288
2023-12-11 09:07:28 +00:00
David CARLIER
09838f17cb
zend_call_stack support proposal for solaris/illumos. (#12862) 2023-12-09 14:19:07 +00:00
Pierrick Charron
dc3641ea0f
PHP-8.2 is now for PHP 8.2.15-dev 2023-12-05 15:01:08 -05:00
Eric Mann
1fdf21fe84
PHP-8.3 is now for PHP 8.3.2-dev 2023-12-05 07:56:55 -08:00
Peter Kokot
40d1442cec
Remove unused gcov artifacts (#12786) 2023-11-27 02:07:05 +00:00
Peter Kokot
3665e90061
Remove unused PHP_COMPILE and CXX_PHP_COMPILE variables (#12760)
These were part of the old build system and are no longer used.
2023-11-24 01:35:24 +00:00
Peter Kokot
5140889c92
Remove unused build variables (#12746)
- LFLAGS
- PHP_LIBS
- SHARED_LIBTOOL
- EXT_LIBS

These were part of the build system in the past and are no longer used
in current code.
2023-11-22 19:15:30 +01:00
Jakub Zelenka
178d3acf4c
PHP 8.3 is now 8.3.1-dev 2023-11-21 14:54:52 +00:00
Peter Kokot
7d52f39954
Remove redundant PHP_SUBST_OLD(INCLUDE_PATH) (#12738)
The AC_SUBST(INCLUDE_PATH) is enough to only replace the variable in the
build-defs.h.in file.
2023-11-21 02:56:36 +00:00
Peter Kokot
77ea5c5691
Remove obsolescent AC_TYPE_SIZE_T (#12719)
The macro checks for existence of size_t in <stddef.h> otherwise it sets
it to 'unsigned int'. The size_t is part of C89 standard and all
platforms should have it. Macro is also marked to be made obsolete in
the future versions of Autoconf.

At this point there is still AC_FUNC_ALLOCA in PHP's configure.ac which
uses AC_TYPE_SIZE_T under the hood so the check is still done there in
the meantime.
2023-11-19 06:57:22 +00:00
Peter Kokot
a35a69ff0f
Clean duplicate headers check (#12710)
- AC_CHECK_HEADERS already includes the header(s) listed in the first
  argument, so additional net/if.h is redundant.
- The crypt.h is checked two times and HAVE_CRYPT_H is only needed in
  ext/standard.
- Remove duplicate <string.h> in ext/standard
- Remove duplicate <string.h> in getaddrinfo check in configure.ac
2023-11-18 04:20:36 +00:00
Peter Kokot
a6d5f3461b
Remove obsolete DG/UX check (#12713)
DG/UX is a discontinued Unix OS, the support for which ended in 2001.
2023-11-18 04:18:26 +00:00
David CARLIER
931a8b0739
inet_ntop requirement check at configure time instead (#12700) 2023-11-17 16:01:46 +00:00
Ilija Tovilo
a785b2fac0
Merge branch 'PHP-8.3'
* PHP-8.3:
  Disable -fsanitize=function on Clang 17
2023-11-11 21:11:08 +01:00
Ilija Tovilo
d5a25d51fc
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Disable -fsanitize=function on Clang 17
2023-11-11 21:11:02 +01:00
Ilija Tovilo
ca22505c8c
Disable -fsanitize=function on Clang 17
Closes GH-12642
2023-11-11 21:09:45 +01:00
Sergey Panteleev
239a26fa90
PHP-8.2 is now for PHP 8.2.14-dev 2023-11-07 17:12:19 +03:00
David Carlier
44f9c226aa following-up on GH-12551: removing inet_ntoa usage
Close GH-12554
2023-11-06 12:05:56 +00:00
Peter Kokot
7d485aa628
ext/sockets: Clean header checks (#12607)
- Unused header checks removed:
  HAVE_NETINET_TCP_H and HAVE_SYS_UN_H are not used in the code.
- Duplicate linux/filter.h check removed:
  HAVE_LINUX_FILTER_H is already defined in ext/sockets.
2023-11-04 15:12:16 +00:00
Ilija Tovilo
2efe366af6
Add zend_worklist.h to PHP_INSTALL_HEADERS (#12571)
Fixes GH-12565
2023-10-30 19:37:27 +01:00
Pierrick Charron
2642a08697
PHP-8.2 is now for PHP 8.2.13-dev 2023-10-10 11:45:26 -04:00
Ilija Tovilo
62e2402534
Use autoconf for recognizing __builtin_unreachable() (#12266)
Older versions of GCC don't support __has_builtin(), but do support
__builtin_unreachable().
2023-09-22 11:53:09 +02:00
Sergey Panteleev
5c1f746716
PHP-8.2 is now for PHP 8.2.12-dev 2023-09-12 14:53:56 +03:00
Jakub Zelenka
7deb84b7a6
Start PHP 8.4 development cycle 2023-08-29 17:19:01 +01:00
Peter Kokot
1413787884 Merge branch 'PHP-8.2'
* PHP-8.2:
  On riscv64 require libatomic if actually needed
2023-08-28 19:48:49 +02:00
Peter Kokot
a1043fe051 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  On riscv64 require libatomic if actually needed
2023-08-28 19:47:44 +02:00
Jeremie Courreges-Anglas
bf3fb4e5c9 On riscv64 require libatomic if actually needed
clang and newer gcc releases support byte-sized atomic accesses on
riscv64 through inline builtins.  In both cases the hard dependency on
libatomic added by GH-11321 isn't useful.

Stop using AC_CHECK_LIB() which is too naive to notice that libatomic
isn't needed.  Instead, PHP_CHECK_FUNC() will retry the check with -latomic
if required.

Closes GH-11790
2023-08-28 19:47:19 +02:00
Pierrick Charron
4467f33e89
PHP-8.2 is now for PHP 8.2.11-dev 2023-08-15 16:08:52 -04:00
Patrick Allaert
6e3f93f2f8
PHP-8.1 is now for PHP 8.1.24-dev 2023-08-15 21:09:58 +02:00
David CARLIER
3e315df6f8 Merge branch 'PHP-8.2' 2023-08-07 19:02:55 +01:00
David CARLIER
e9e5b4c1c8 Merge branch 'PHP-8.1' into PHP-8.2 2023-08-07 19:02:44 +01:00
Kévin Dunglas
96885bc04f fix: handle the GNU specific version of strerror_r
Close GH-11882
2023-08-07 19:01:24 +01:00
Peter Kokot
37d35f5ed8
Move --enable/--disable-fiber-asm help output (#11827)
This moves the fiber configure option in the Zend section. TSRM doesn't
currently have any specific configure options so it can be removed from
the ./configure --help output.
2023-07-31 15:29:14 +01:00
Peter Kokot
b132b7ab7e
Remove check for time.h and HAVE_TIME_H (#11726)
The `<time.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

The conditional include based on Windows is there so the win32/time.h
can be included on other places when needed.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2023-07-20 09:38:53 +02:00
Athos Ribeiro
d35df89c35 Fix #79026: Allow PHP_EXTRA_VERSION overrides
When building from sources, someone distributing PHP may want to add a
vendor specific string to the PHP_VERSION so users can differentiate
multiple vendor builds from the same PHP version. For instance, a vendor
backporting a bug fix to a no-longer-supported PHP version could extend
their PHP_EXTRA_VERSION to allow their users to identify that they carry
such fix by checking their PHP_VERSION.

Closes GH-11706
2023-07-19 12:14:42 +02:00
Ben Ramsey
6e3c520f51
PHP-8.1 is now for PHP-8.1.23-dev 2023-07-18 16:30:49 -05:00
Sergey Panteleev
796a75f967
PHP-8.2 is now for PHP 8.2.10-dev 2023-07-18 14:02:43 +03:00
Arnaud Le Blanc
d0731934b7
Expose time spent collecting cycles in gc_status() (#11523) 2023-07-16 12:34:28 +02:00
Ben Ramsey
097b08cbbe
Merge branch 'PHP-8.1' into PHP-8.2 2023-07-10 09:26:17 -05:00
Peter Kokot
41a3573fcc
Fix GH-9483: Autoconf warnings for newer Autoconf versions
Co-authored-by: Levi Morrison <morrison.levi@gmail.com>
2023-07-10 09:25:58 -05:00
Peter Kokot
cf587c1a1b
Fix GH-11603: Set LDFLAGS (#11605)
The two unsets before the last `unset LIBS LDFLAGS` are not necessary so
LDFLAGS can be adjusted via command line:

LDFLAGS="..." ./configure

Co-authored-by: Max Kellermann <max.kellermann@ionos.com>
2023-07-07 03:30:56 +01:00
Sergey Panteleev
884a53f39a
PHP-8.2 is now for PHP 8.2.9-dev 2023-06-20 17:25:30 +03:00
Patrick Allaert
6c4b1e0417
PHP-8.1 is now for PHP 8.1.22-dev 2023-06-20 16:07:05 +02:00
David Carlier
2e4369a171 Merge branch 'PHP-8.2' 2023-05-27 16:38:46 +01:00
David Carlier
350e449bd8 Merge branch 'PHP-8.1' into PHP-8.2 2023-05-27 16:37:48 +01:00
Daniil Gentili
1dfa277a96 Fix GCC 12 compilation on riscv64
Close GH-11321
2023-05-27 16:37:19 +01:00
Ben Ramsey
2f2fd06be0
PHP-8.1 is now for PHP 8.1.21-dev 2023-05-23 16:19:16 -05:00
Pierrick Charron
d5f68b50fc
PHP-8.2 is now for PHP 8.2.8-dev 2023-05-23 16:56:58 -04:00
Sergey Panteleev
8318f4a6b1
PHP-8.2 is now for PHP 8.2.7-dev 2023-04-25 18:33:13 +03:00
Patrick Allaert
725f136f9a
PHP-8.1 is now for PHP 8.1.20-dev 2023-04-25 16:18:30 +02:00
Dmitry Stogov
c9d728cbd6 Revert "Zend/zend_types.h: move zend_rc_debug to zend_rc_debug.h"
This reverts commit d6e95041e2.
2023-04-04 22:48:26 +03:00
Ben Ramsey
d9df750b22
PHP-8.1 is now for PHP 8.1.19-dev 2023-03-29 19:51:20 -05:00
Pierrick Charron
f7c692a940
PHP-8.2 is now for PHP 8.2.6-dev 2023-03-28 17:27:17 -04:00
Ilija Tovilo
5eb6905405
Disable --with-valgrind by default (#10934)
Same reasoning as GH-10876
2023-03-25 18:10:14 +01:00
Arnaud Le Blanc
0c7fc351ea Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  fix: support for timeouts with ZTS on Linux (#10141)
2023-03-03 11:56:34 +01:00
Arnaud Le Blanc
37030257b8 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  fix: support for timeouts with ZTS on Linux (#10141)
2023-03-03 11:45:50 +01:00
Kévin Dunglas
ad85e71421
fix: support for timeouts with ZTS on Linux (#10141) 2023-03-03 11:35:06 +01:00
Patrick Allaert
729f006de8
PHP-8.1 is now for PHP 8.1.18-dev 2023-02-28 21:37:52 +01:00
Sergey Panteleev
23ce3423c1
PHP-8.2 is now for PHP 8.2.5-dev 2023-02-28 18:15:20 +03:00
Max Kellermann
d6e95041e2 Zend/zend_types.h: move zend_rc_debug to zend_rc_debug.h
`zend_rc_debug` is not a type and does not really belong in
`zend_types.h`; this allows using `ZEND_RC_MOD_CHECK()` without
including the huge `zend_types.h` header and allows decoupling
circular header dependencies.
2023-02-26 14:16:53 +00:00
Ben Ramsey
586e81b259
Point to the issue tracker on GitHub 2023-02-14 13:49:02 -06:00
Pierrick Charron
dc054488da
PHP-8.2 is now for PHP 8.2.4-dev 2023-02-14 10:02:46 -05:00
Ben Ramsey
28d68f5013
PHP-8.1 is now for PHP 8.1.17-dev 2023-02-13 13:16:07 -06:00
Frank Du
a9437ceb6f
base64: add avx512 and vbmi version. (#6361)
1. Implementation based on https://github.com/WojciechMula/base64simd
2. Only runtime path is added to reduce the complexity of SIMD variants.
3. Expand test case to cover SIMD implementation.

Signed-off-by: Frank Du <frank.du@intel.com>
2023-02-13 03:30:47 +00:00
Derick Rethans
df853cb305 Bump minimum re2c version requirement to 1.0.3
The release VMs already enforced this, but PHP's configure script did
not.

re2c 0.13.5, which timelib's date/time parser requires is no longer
compatible with the current version of Zend/zend_language_scanner.l, as
it starts spinning in a loop.
2023-02-09 10:59:58 +00:00
Alex Dowad
c8ec2ed730 Add AVX2-accelerated UTF-16 decoding/encoding routines
As with other SIMD-accelerated functions in php-src, the new UTF-16
encoding and decoding routines can be compiled either with AVX2
acceleration "always on", "always off", or else with runtime detection
of AVX2 support.

With the new UTF-16 decoder/encoder, conversion of extremely short
strings (as in several bytes) has the same performance as before,
and conversion of medium-length (~100 character) strings is about 65%
faster, but conversion of long (~10,000 character) strings is around
6 times faster.

Many other mbstring functions will also be faster now when handling
UTF-16; for example, mb_strlen is almost 3 times faster on medium
strings, and almost 9 times faster on long strings. (Why does mb_strlen
benefit more from AVX2 acceleration than mb_convert_encoding? It's
because mb_strlen only needs to decode, but not re-encode, the input
string, and the UTF-16 decoder benefits much more from SIMD
acceleration than the UTF-16 encoder.)
2023-02-05 20:06:42 +02:00
Peter Kokot
bf5fdbd3a8
AC_PROG_CC_C99 is obsolete with autoconf >= 2.70 (#10383)
To make sure that compiler supports C99 before Autoconf 2.69, this was
needed. But with Autoconf 2.70 and later the macro is obsolete because
the checks are done in AC_PROG_CC and warnings are emitted when building
configure script.

Fixes part of GH-9483
2023-01-23 13:39:41 +00:00
Sergey Panteleev
eee988e86d
PHP-8.2 is now for PHP 8.2.3-dev 2023-01-17 20:55:22 +03:00
Patrick Allaert
c47a1a260d
PHP-8.1 is now for PHP 8.1.16-dev 2023-01-17 17:24:25 +01:00
Arnaud Le Blanc
a11c8a3039
Limit stack size (#9104) 2022-12-16 17:44:26 +01:00
Pierrick Charron
002d54db9f
PHP-8.2 is now for PHP 8.2.2-dev 2022-12-13 19:29:29 -05:00
Ben Ramsey
696bb385df
PHP-8.1 is now for PHP 8.1.15-dev 2022-12-07 11:29:37 -06:00
David CARLIER
3660bc31de opcache fixing w/x pages creation on freebsd 13.1 and above.
By default, the system allows these but admin can disable them system wide.
However the procctl api permits to control it per process.

Closes GH-9896.
2022-11-18 19:22:00 +00:00
Dmitry Stogov
05f4b84940 Fix cross-compilation for shadow_stack_exists 2022-11-17 15:39:43 +03:00
Pierrick Charron
44d652c00a
PHP-8.2 is now for PHP 8.2.1-dev and prepare NEWS for 8.2.0 2022-11-08 13:26:35 -05:00
Patrick Allaert
540488c74e
PHP-8.1 is now for PHP 8.1.14-dev 2022-11-08 17:57:34 +01:00
Bob Weinand
b3f3414ce9 Merge branch 'PHP-8.2' 2022-11-07 16:43:24 +01:00
Bob Weinand
5d7b64be1d Fix cross-compilation for copy_file_range 2022-11-07 16:39:08 +01:00
Chen, Hu
37b84b7e32
Fiber: add shadow stack support
Shadow stack is part of Intel's Control-Flow Enforcement Technology (CET).

Whenever a function is called, the return address is pushed onto both
the regular stack and the shadow stack. When that function returns, the
return addresses are popped off both stacks and compared; if they fail
to match, #CP raised.

With this commit, we create shadow stack for each fiber context and
switch the shadow stack accordingly during fcontext switch.

Signed-off-by: Chen, Hu <hu1.chen@intel.com>

Closes GH-9283.
2022-11-07 14:48:27 +01:00
Jakub Zelenka
b8d013a48d
Merge branch 'PHP-8.2' 2022-10-23 12:41:51 +01:00
Jakub Zelenka
b732d80329
Fix bug GH-9779: stream_copy_to_stream fail when dest in append mode 2022-10-23 12:40:22 +01:00
Ben Ramsey
865161af33
PHP-8.1 is now for PHP 8.1.13-dev 2022-10-11 19:47:00 -04:00
David Carlier
f9f9e7f053 Merge branch 'PHP-8.2' 2022-10-11 21:48:46 +01:00