Commit Graph

163 Commits

Author SHA1 Message Date
Peter Kokot
1e0a4ac10e Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove dead code from configure.ac
2019-05-10 00:44:51 +02:00
Peter Kokot
f7b62b115e Remove dead code from configure.ac
SAPI apache has been removed and now there is apache2handler so this
warning hasn't been used for a while.
2019-05-10 00:44:09 +02:00
Dmitry Stogov
b27f97d858 Merge branch 'PHP-7.4'
* PHP-7.4:
  speed up add and sub operators with overflow detection
2019-05-07 15:38:27 +03:00
Sebastian Pop
adc3b72076 speed up add and sub operators with overflow detection
On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark              Time             CPU   Iterations
--------------------------------------------------------
BM_add_before       13.3 ns         13.3 ns     52626058
BM_sub_before       8.72 ns         8.72 ns     80259343
BM_add_after        4.80 ns         4.80 ns    145926004
BM_sub_after        4.80 ns         4.80 ns    145936496

Before the patch:
fast_long_add_function:
	ldr	x1, [x1]
	ldr	x2, [x2]
	add	x3, x1, x2
	eor	x4, x1, x2
	tbz	x4, #63, .L5
.L2:
	mov	w1, 4
	str	x3, [x0]
	str	w1, [x0, 8]
	ret
	.p2align 2
.L5:
	eor	x4, x1, x3
	tbz	x4, #63, .L2
	scvtf	d0, x1
	scvtf	d1, x2
	mov	w1, 5
	str	w1, [x0, 8]
	fadd	d0, d0, d1
	str	d0, [x0]
	ret

With the patch:
fast_long_add_function:
	ldr    x5, [x1]
	ldr    x6, [x2]
	adds	x5, x5, x6
	bvs	.L2
	mov	w6, 4
	str	x5, [x0]
	str	w6, [x0, 8]
	ret
.L2:
	ldr	x1, [x1]
	mov	w3, 5
	ldr	x2, [x2]
	str	w3, [x0, 8]
	scvtf	d0, x1
	scvtf	d1, x2
	fadd	d0, d0, d1
	str	d0, [x0]
	ret

    php$ ./sapi/cli/php Zend/bench.php

Base:                         Patch:
simple             0.091      simple             0.091
simplecall         0.014      simplecall         0.014
simpleucall        0.041      simpleucall        0.041
simpleudcall       0.045      simpleudcall       0.045
mandel             0.193      mandel             0.193
mandel2            0.229      mandel2            0.229
ackermann(7)       0.044      ackermann(7)       0.044
ary(50000)         0.010      ary(50000)         0.010
ary2(50000)        0.008      ary2(50000)        0.008
ary3(2000)         0.096      ary3(2000)         0.095
fibo(30)           0.149      fibo(30)           0.148
hash1(50000)       0.016      hash1(50000)       0.016
hash2(500)         0.020      hash2(500)         0.020
heapsort(20000)    0.055      heapsort(20000)    0.054
matrix(20)         0.057      matrix(20)         0.057
nestedloop(12)     0.091      nestedloop(12)     0.091
sieve(30)          0.032      sieve(30)          0.032
strcat(200000)     0.010      strcat(200000)     0.010
------------------------      ------------------------
Total              1.199      Total              1.197

    php$ ./sapi/cli/php Zend/micro_bench.php

Base:                                      Patch:
empty_loop         0.051                   empty_loop         0.051
func()             0.181    0.130          func()             0.181    0.130
undef_func()       0.186    0.135          undef_func()       0.186    0.135
int_func()         0.116    0.064          int_func()         0.116    0.064
$x = self::$x      0.235    0.183          $x = self::$x      0.233    0.182
self::$x = 0       0.198    0.147          self::$x = 0       0.198    0.147
isset(self::$x)    0.229    0.178          isset(self::$x)    0.229    0.178
empty(self::$x)    0.231    0.180          empty(self::$x)    0.231    0.180
$x = Foo::$x       0.144    0.093          $x = Foo::$x       0.144    0.093
Foo::$x = 0        0.107    0.056          Foo::$x = 0        0.107    0.056
isset(Foo::$x)     0.140    0.088          isset(Foo::$x)     0.140    0.088
empty(Foo::$x)     0.148    0.097          empty(Foo::$x)     0.148    0.097
self::f()          0.238    0.187          self::f()          0.238    0.187
Foo::f()           0.209    0.158          Foo::f()           0.209    0.158
$x = $this->x      0.123    0.072          $x = $this->x      0.123    0.072
$this->x = 0       0.124    0.073          $this->x = 0       0.124    0.073
$this->x += 2      0.151    0.099          $this->x += 2      0.153    0.101
++$this->x         0.137    0.086          ++$this->x         0.138    0.086
--$this->x         0.137    0.086          --$this->x         0.138    0.086
$this->x++         0.170    0.119          $this->x++         0.172    0.121
$this->x--         0.171    0.119          $this->x--         0.172    0.121
isset($this->x)    0.170    0.119          isset($this->x)    0.170    0.119
empty($this->x)    0.179    0.128          empty($this->x)    0.179    0.128
$this->f()         0.194    0.143          $this->f()         0.194    0.143
$x = Foo::TEST     0.188    0.137          $x = Foo::TEST     0.188    0.136
new Foo()          0.482    0.431          new Foo()          0.479    0.427
$x = TEST          0.109    0.058          $x = TEST          0.109    0.058
$x = $_GET         0.190    0.138          $x = $_GET         0.190    0.139
$x = $GLOBALS['v'] 0.242    0.191          $x = $GLOBALS['v'] 0.242    0.191
$x = $hash['v']    0.196    0.145          $x = $hash['v']    0.196    0.145
$x = $str[0]       0.146    0.094          $x = $str[0]       0.145    0.094
$x = $a ?: null    0.144    0.093          $x = $a ?: null    0.144    0.093
$x = $f ?: tmp     0.174    0.123          $x = $f ?: tmp     0.174    0.123
$x = $f ? $f : $a  0.153    0.101          $x = $f ? $f : $a  0.153    0.101
$x = $f ? $f : tmp 0.148    0.097          $x = $f ? $f : tmp 0.148    0.097
------------------------                   ------------------------
Total              6.143                   Total              6.143
2019-05-07 15:38:17 +03:00
Peter Kokot
465c82b1af Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove TSRM configuration header
2019-04-29 22:35:24 +02:00
Peter Kokot
ce65d2354c Remove TSRM configuration header
TSRM configuration header file was once created by separate autoconf
build system for TSRM and is with the current code not directly needed
like this anymore.
2019-04-29 22:34:43 +02:00
Nikita Popov
4c485586b4 Merge branch 'PHP-7.4' 2019-04-26 09:57:52 +02:00
Nikita Popov
33e8a7b368 Enable -Werror in CI
Add --enable-werror configure option and use it on Travis. It's not
possible to directly use CFLAGS, because it also affects configure
checks which often throw warnings.

We can't enable something similar for Windows builds at this time,
because they throw a lot more warnings.
2019-04-26 09:56:16 +02:00
Peter Kokot
d2e6c1aff1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Move Autoconf Archive macros to a common m4 dir
2019-04-23 20:38:57 +02:00
Peter Kokot
beb58ca128 Move Autoconf Archive macros to a common m4 dir
In PHP the build dir is used as a directory for external macros
including Autoconf Archive macros.
2019-04-23 20:37:31 +02:00
Peter Kokot
028ffddf69 Merge branch 'PHP-7.4'
* PHP-7.4:
  Move acinclude.m4 to build/php.m4
2019-04-23 20:32:03 +02:00
Peter Kokot
4e7064d173 Move acinclude.m4 to build/php.m4
The acinclude.m4 file is in a usual Autotools build processed with
Automake's aclocal tool. Since PHP currently doesn't use Automake and
aclocal this file can be moved into the build directory. PHP build
system currently generates a combined aclocal.m4 file that Autoconf
can processes automatically.

However, a newer practice is writing all local macros in separate
dedicated files prefixed with package name, in PHP's case PHP_MACRO_NAME
and putting them in a common `m4` directory. PHP uses currently `build`
directory for this purpose.

Name `php.m4` probably most resembles such file for PHP's case.

PHP manually created the aclocal.m4 file from acinclude.m4 and
build/libtool.m4. Which is also not a particularly good practice [1], so
this patch also removes the generated alocal.m4 usage and uses
m4_include() calls manually in the configure.ac and phpize.m4 files
manually.

- sort order is not important but can be alphabetical
- list of *.m4 files prerequisites for configure script generation
  updated
- Moving m4_include() before AC_INIT also removes all comments starting
  with hash character (`#`) in the included files.

[1] https://autotools.io/autoconf/macros.html
2019-04-23 20:28:45 +02:00
Peter Kokot
7eb8913e04 Merge branch 'PHP-7.4'
* PHP-7.4:
  Refactor Zend/acinclude.m4 local macro
2019-04-21 15:53:44 +02:00
Peter Kokot
b1d3509e8c Refactor Zend/acinclude.m4 local macro
There is now only a single M4 macro in the legacy acinclude.m4 file. A
separate acinclude file was once used with a standalone Zend engine
building but with current build system this can be simplified a bit.
2019-04-21 15:53:19 +02:00
Peter Kokot
57cfd706e4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove PHP_READDIR_R_TYPE
2019-04-13 04:51:03 +02:00
Peter Kokot
769db42341 Remove PHP_READDIR_R_TYPE
The PHP_READDIR_R_TYPE m4 macro has been removed via
2b28f71891.

HAVE_POSIX_READDIR_R in windows header file is also not needed anymore.
2019-04-13 04:50:05 +02:00
Peter Kokot
8afb3e6856 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove duplicated substitude for Makefile
2019-04-09 02:11:57 +02:00
Peter Kokot
8021d52fb6 Remove duplicated substitude for Makefile
The substitution is already done in the CLI's config.m4 file. Current
SAPIs only provide one PHP_EXECUTABLE variable, i.e. PHP CLI so the one
in the configure.ac can be removed.
2019-04-09 02:09:42 +02:00
Peter Kokot
e6f86fb17c Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove checks for locale.h, setlocale, localeconv
2019-04-07 18:34:02 +02:00
Peter Kokot
e06836a1a3 Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.

Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.

The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

Omit the bundled libmagic files
2019-04-07 18:32:54 +02:00
Peter Kokot
06fc66ed7c Merge branch 'PHP-7.4'
* PHP-7.4:
  Refactor AC_INIT in configure.ac and PHP versions
2019-04-07 05:54:12 +02:00
Peter Kokot
afd52f9d99 Refactor AC_INIT in configure.ac and PHP versions
Since Autoconf 2.53 the AC_INIT call with only a single argument has
been made obsolete and now includes several other optional arguments to
make installation experience a bit better by providing program version
and links to the project in the `./configure -h` output. This patch also
updates win build version. The phpize.m4 AC_INIT has been updated with
the call without arguments.
2019-04-07 05:52:14 +02:00
Dmitry Stogov
9a06876072 Added JIT compiler for x86 and x86_64 2019-04-01 10:27:11 +03:00
Peter Kokot
d31a40dbcd Merge branch 'PHP-7.4'
* PHP-7.4:
  Join README.GIT-RULES and CONTRIBUTING.md
2019-03-30 16:01:53 +01:00
Peter Kokot
a8e879c53f Join README.GIT-RULES and CONTRIBUTING.md
This patch joins two very much related pieces of docs together in a
single file dedicated to all sorts of contributing info.

Some more changes:
- Branches info copied from the current master branch
- LXR and bonsai info removed
- Duplicated info reduced a bit
- Security branch updated to 7.1
- Refactor intro for Git commit rules
- Updated README.GIT-RULES file usage in win32/build/confutils.js
- Refactored configure.ac
2019-03-30 15:58:23 +01:00
Peter Kokot
b49022b3dc Merge branch 'PHP-7.4'
* PHP-7.4:
  Refactor PHP_PROG_BISON and PHP_PROG_RE2C
2019-03-30 02:02:14 +01:00
Peter Kokot
3207741df0 Refactor PHP_PROG_BISON and PHP_PROG_RE2C
This patch refactors these macros to also checks for the required given
versions of bison and re2c.

- PHP_PROG_RE2C and PHP_PROG_BISON take optional args - minmimum version
  required, and bison also excluded versions.
- Instead of caching values this uses manual checking and messaging
  outputs.
- It looks like the minimum version of RE2C 0.13.4 is working ok so far.

The genfiles script improvements:
- Add make override in genfiles
- Move checkings from makedist to genfiles
- Refactored output messages
- Various minor enhancements
2019-03-30 02:01:02 +01:00
Peter Kokot
011c935ae3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove php7.spec.in file
2019-03-28 17:45:02 +01:00
Peter Kokot
5e16f5b8d8 Remove php7.spec.in file
RPM specification file was introduced via
7c2f1384d4 for PHP to include official
RPM packages long time agon. With removal of the makerpm script via
3d51d4c90c and Linux repositories to
manage such updated and customized info in their repositories this file
is most likely not needed anymore.
2019-03-28 17:42:11 +01:00
Joe Watkins
f43ce705fe
remove last enable-maintainer-zts mention from source 2019-03-26 18:28:18 +01:00
Joe Watkins
bd73607b9e
TSRM cleanup for PHP8 2019-03-25 08:00:17 +01:00
Joe Watkins
161adfff3f
For consistency with Windows, and because ZTS is not experimental or a "maintainer" feature, this commits renames --enable-maintainer-zts to --enable-zts in the autotools build, and related documentation 2019-03-23 07:34:54 +01:00
Peter Kokot
347128a12b Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync AC_CHECK_SIZEOF m4 macro calls
2019-03-18 02:13:12 +01:00
Peter Kokot
ccc29473ec Sync AC_CHECK_SIZEOF m4 macro calls
- AC_CHECK_SIZEOF is now called mostly only in PHP_CHECK_STDINT_TYPES()
  macro except for some parts checking for the 32 or 64 bit architecture.
- SIZEOF_CHAR removed since it is always 1
- ZEND_BIN_ID is now of a more logical pattern `BIN_48888` on 64bit
  architectures and `BIN_44444` on 32bit instead of literal string
  `BIN_SIZEOF_CHAR48888` on 64bit and `BIN_SIZEOF_CHAR44444` on 32bit.
  The unneeded SIZEOF_CHAR part has been removed.
- XMLRPC_TYPE_CHECKS removed
- The `long long int` is the same as `long long` and redundant checks
  removed accordingly.
- Removed PHP_CHECK_64BIT macro. Checking if current platform is 64bit
  or not can be also done simply by using a check of the long type on
  place. This removes redundant m4 macro PHP_CHECK_64BIT.
2019-03-18 02:11:23 +01:00
Peter Kokot
160f3636db Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean build system
2019-03-14 20:21:30 +01:00
Peter Kokot
97d25c87d2 Clean build system
Changes:
- AC_TYPE_SIZE_T called on only one place (configure.ac)
- AC_FUNC_ALLOCA called on only one place (configure.ac)
- AC_TYPE_UID_T called on only one place (configure.ac)
- HAVE_STRSTR removed since strstr is part of C89 standard [1]
- Remove checks for strtol and strpbrk
- Checking for the presence of perror function is not needed anymore
  since it is part of C89 standard and PHP calls it unconditionally.
- Checking for functions strdup, setenv, strerror, and memmove done only
  on one place (configure.ac)
- outdated check for snprintf removed

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 20:20:12 +01:00
Peter Kokot
4b3da12363 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_STRFTIME
2019-03-14 19:43:45 +01:00
Peter Kokot
3a857852a8 Remove HAVE_STRFTIME
Function strftime is part of the C89 standard [1] and current systems
don't need to check for its presence anymore.

Additionally, checks for strftime function in tests have been removed
since the PHP strftime function is now always available.

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 19:42:29 +01:00
Remi Collet
f9f422659c Merge branch 'PHP-7.4'
* PHP-7.4:
  add --enable-rtld-now in upgrade info
  use DL_LOAD in litespeed
  add --enable-rtld-now build option to change dlopen behavior
2019-03-12 08:26:36 +01:00
Remi Collet
d633cbac1c add --enable-rtld-now build option to change dlopen behavior 2019-03-12 08:23:06 +01:00
Joe Watkins
99230784f5
Merge branch 'PHP-7.4'
* PHP-7.4:
  zend_weakrefs
2019-03-12 00:37:28 +01:00
Joe Watkins
6529d7acd9
zend_weakrefs 2019-03-12 00:35:35 +01:00
Peter Kokot
80bebdd0e1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean *nix build system
2019-03-07 21:00:36 +01:00
Peter Kokot
f5fa9ddbd5 Clean *nix build system
- remove some outdated and not used macro calls
- remove some unused variables
- Remove not needed comment from tokenizer config.m4
- Remove not needed comment
- remove not needed local variables for editors and syntax highlighting
2019-03-07 20:58:14 +01:00
Peter Kokot
d0fd9fe977 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add AS_HELP_STRING to *nix build configure options
2019-03-07 20:38:04 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
2968a1d7f2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove legacy AC_CHECK_TYPE calls for uint and ulong
2019-03-06 22:50:46 +01:00
Peter Kokot
bebcdcc745 Remove legacy AC_CHECK_TYPE calls for uint and ulong
The AC_CHECK_TYPE was refactored in more recent versions of Autoconf
and the call with two arguments is obsolete and not recommended anymore.

This patch also refactors some leftovers of using ulong and uint which
are not standard nor common usages of types in C.

The ulong can be used as zend_ulong and uint usage is actually
`unsigned int`.

The usage of HAVE_ULONG removed since it is not used in current code
base.

Legacy edgecase for some legacy HPUX systems removed:
- sys/stream.h header is not checked and the HAVE_SYS_STREAM_H is
  not defined with current build system.

- flags are unsigned int
- max_allowed_packet changed to unsigned int
2019-03-06 22:49:16 +01:00
Peter Kokot
e624c596a5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Move Makefile.global and Makefile.gcov to build directory
2019-03-04 12:32:39 +01:00
Peter Kokot
2957651c5c Move Makefile.global and Makefile.gcov to build directory
These files can be stored in the build directory instead of bloating the
project root directory.
2019-03-04 12:30:42 +01:00