Commit Graph

192 Commits

Author SHA1 Message Date
Peter Kokot
51050427f4
Remove obsolescent AC_C_INLINE Autoconf macro (#13429)
This macro defines the inline keyword to be `__inline__`, `__inline`,
or empty, based on the compiler inline support. Since PHP requires C99,
which has the inline keyword definition and all current compilers
support it, this check is redundant and not needed anymore.
2024-02-18 23:55:50 +00:00
Kévin Dunglas
f84d0468ed
add support for Zend Max Exeuction Timers on FreeBSD (#13393) 2024-02-16 12:45:15 +01:00
Peter Kokot
e76f9e2b50
Remove DARWIN symbol (#13346)
When targeting Darwin systems (macOS, etc.), the compiler defines the
__APPLE__ symbol, which should be sufficient and a more established
detection method practice in these cases.
2024-02-07 21:07:48 +01:00
Peter Kokot
8f4dc71256
build: Fix check for sigsetjmp (#12606)
The usual check for presence of sigsetjmp will not be sufficient since
the sigsetjmp might be defined as a macro.
2023-11-04 15:13:01 +00:00
Peter Kokot
ba35ff0893
Remove unused HAVE_GCC_GLOBAL_REGS shell variable (#11877) 2023-08-08 00:51:56 +02:00
David CARLIER
2778b5d25f
zend vm savee registers support for riscv 64. (#11773)
x8 being already reserved, we can only pull x18 to x27.
2023-07-24 08:25:45 +01:00
Peter Kokot
9911ab7142
Remove unused ZEND_STACK_GROWS_DOWNWARDS constant (#11762) 2023-07-22 19:39:42 +02:00
David CARLIER
75e9980054
zend stack: prepare zend_call_stack_get implementation for OpenBSD. (#11578) 2023-07-07 18:03:07 +01:00
Ilija Tovilo
f60dc47f36
Re-enable -Wstrict-aliasing
We're not disabling -fstrict-aliasing to it's better to keep this warning.

Closes GH-10821
2023-03-10 17:15:46 +01:00
Kévin Dunglas
f0495855a3
feat: enable Zend Max Execution Timers by default in 8.3 (#10778) 2023-03-10 16:22:42 +01:00
Michael Orlitzky
fa65873502 */*.m4: update main() signatures.
The next generation of C compilers is going to enforce the C standard
more strictly:

  https://wiki.gentoo.org/wiki/Modern_C_porting

One warning that will soon become an error is -Wstrict-prototypes.
This is relatively easy to catch in most code (it will fail to
compile), but inside of autoconf tests it can go unnoticed because
many feature-test compilations fail by design. For example,

  $ export CFLAGS="$CFLAGS -Werror=strict-prototypes"
  $ ./configure
  ...
  checking if iconv supports errno... no
  configure: error: iconv does not support errno

(this is on a system where iconv *does* support errno). If errno
support were optional, that test would have "silently" disabled
it. The underlying issue here, from config.log, is

  conftest.c:211:5: error: function declaration isn't a prototype
  [-Werror=strict-prototypes]
    211 | int main() {

This commit goes through all of our autoconf tests, replacing main()
with main(void). Up to equivalent types and variable renamings, that's
one of the two valid signatures, and satisfies the compiler (gcc-12 in
this case).

Fixes GH-10751
2023-03-07 15:32:30 +00: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
Tim Düsterhus
a408781ab4 Remove now-unused check for /dev/urandom from Zend/Zend.m4 2023-01-23 17:38:50 +01:00
Arnaud Le Blanc
a11c8a3039
Limit stack size (#9104) 2022-12-16 17:44:26 +01:00
zeriyoshi
30ed8fb32d Merge remote-tracking branch 'upstream/PHP-8.1' 2022-08-05 00:08:36 +09:00
zeriyoshi
2d777466c0 Merge remote-tracking branch 'upstream/PHP-8.0' into PHP-8.1 2022-08-05 00:06:04 +09:00
Go Kudo
3725717de1
Remove ZEND_DVAL_TO_LVAL_CAST_OK (#9215)
* Remove ZEND_DVAL_TO_LVAL_CAST_OK
As far as I can see, this operation should always use the _slow method, and the results seem to be wrong when ZEND_DVAL_TO_LVAL_CAST_OK is enabled.

* update NEWS
2022-08-04 23:56:19 +09:00
George Peter Banyard
2c2ecba063
Determine value of ZEND_MM_* during config and fix sign conversion (#6981)
Also add a new ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT definition.

This fixes many [-Wsign-conversion] warnings.

Co-authored-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2022-04-01 15:43:42 +01:00
Nikita Popov
1c8bb6d681 Remove unnecessary LIBZEND_MM_ALIGN assignment
We're not using the variable in this branch.
2021-05-17 18:44:57 +02:00
George Peter Banyard
96adc806e0
Add -Wstrict-prototypes compiler warning
Disable it for the following extensions:
 - GD
 - pspell
 - readline

Closes GH-5888
2021-05-12 19:02:48 +01:00
George Peter Banyard
dcdc5d9069 Drop -Wno-implicit-fallthrough compiler flag
And add it back to ext/date, ext/hash, and ext/opcache
2021-04-19 13:59:18 +01:00
Dmitry Stogov
f1ad9199ef Better support for cross-compilation 2021-04-16 17:28:54 +03:00
Nikita Popov
7db29d2186 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80377
2020-11-25 11:48:51 +01:00
Nikita Popov
4633e70ab1 Fixed bug #80377
Make sure the $PHP_THREAD_SAFETY variable is always available
when configuring extensions. It was previously available for
phpized extensions, but for in-tree builds it was being set
too late.

Then, use $PHP_THREAD_SAFETY instead of $enable_zts to check for
ZTS in bundled extensions, which makes sure these checks also
work for phpize builds.
2020-11-25 11:47:05 +01:00
George Peter Banyard
49783e35f0 Add compiler flags which aren't included in -Wall or -Wextra
Adds the following compiler flags:
 . -Wduplicated-cond
 . -Wlogical-op
 . -Wformat-truncation
 . -fno-common

Closes GH-6199
2020-10-10 17:26:49 +01:00
Nikita Popov
d3cf597328 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix -Wimplicit-function-declaration in configure
2020-10-05 10:48:04 +02:00
Nikita Popov
9ad5381a2f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix -Wimplicit-function-declaration in configure
2020-10-05 10:46:46 +02:00
Nikita Popov
aa405b7da2 Fix -Wimplicit-function-declaration in configure
As this is an error with xcode 12, see bug #80171.
2020-10-05 10:43:58 +02:00
George Peter Banyard
5c1cf7669b Prepend compiler warning flags to CFLAG instead to append them
Credit to @bwoebi for the idea

Closes GH-6057
2020-09-01 14:45:57 +02:00
Alex Dowad
7e2147be23 Clean up some unused code (and fix some comments) in build scripts
- Fix typo in build/php.m4

- Nothing uses HAVE_INTTYPES_H; so remove check for header file

- Nothing defines ZEND_ACCONFIG_H_NO_C_PROTOS; so remove #ifndef

- `format_money` was removed in 2019, so <monetary.h> no longer needed

- Nothing uses HAVE_NETDB_H; so remove check for header file

- Nothing checks HAVE_TERMIOS_H; so remove check for header file

    (This was actually added when Wez Furlong was adding the original implementation of
    PTY support in `proc_open`, since replaced.)

- Nothing checks HAVE_SYS_AUXV_H; so remove check for header file

- PHP_BUILD_DATE variable is not used for anything, so remove it

    This variable was added to the Makefile, but from there, was not used for anything.
    The comments suggest it was intended to allow 'reproducible builds'. Presumably,
    this means that if a bug is found in a PHP binary somewhere, one could look at the
    Makefile which it was built from, see the date, and then could check the same
    code version out from source control. But... there can easily be multiple commits
    to the repo in the same day. Also, what makes us think that the Makefile which a
    binary was built from will be easily available?

    Besides, ext/standard/info.c already embeds the build date and time in each binary...
    but it does it using `__DATE__` and `__TIME__` (see `php_print_info`).

- Nothing checks HAVE_FINITE; so don't check for function

- Grammar fix to comment in build/php.m4

- Nothing sets $php_ldflags_add_usr_lib variable in configure, so remove conditional

    This was added in 2002, when Rasmus was having difficulty building PHP on some
    host and needed to have /usr/lib in the rpath. It was never documented and
    probably has never been used by anyone else.
2020-06-19 22:04:52 +02:00
Alex Dowad
3a19726bce Remove unneeded --disable-inline-optimization build parameter
In 1999, inline optimization was turned off by default. The commit log indicates this was
done because GCC was running out of memory on some hosts when building the Zend executor.
In 2003, inline optimization was re-enabled by default, but a build option was added to
turn it off if one runs out of memory when building.

Computing hardware has come a long way since 2003 and I doubt that anyone is running out
of memory when building PHP now.

Interestingly, this code set an unused variable called `INLINE_CFLAGS`. It actually
disabled inline optimization by adding -O0 to the build command, not using `INLINE_CFLAGS`.

Just to see how much memory GCC/Make are using when building PHP, I tried building with
successively higher values of `ulimit -v` until it succeeded. Interestingly, while most
of the codebase can be built with about 400MB of memory, ext/fileinfo/libmagic/apprentice.c
requires 1.2GB, doubtless because it includes ext/fileinfo/data_file.c, which is more
than 350,000 lines long. That is with GCC 7.5.0.

Most users get PHP as a binary package anyways, so the question is, are *packagers*
of PHP trying to build on machines with just 1GB RAM? And would they want to package
a PHP interpreter built with *no optimizations*? I can't imagine either being true.
2020-06-17 19:31:35 +02:00
George Peter Banyard
1c334db4c8 Add -Wextra compiler warnings and exclude the trigger happy ones
The compile warnings which are explicitly suppressed are:
 * -Wno-implicit-fallthrough
 * -Wno-unused-parameter
 * -Wno-sign-compare
 * -Wno-clobbered, only with GCC

Closes GH-5151
2020-04-14 22:22:35 +02:00
George Peter Banyard
92d5a2e48c Remove obsolete configure checks for isinf, isnan, and isfinite 2019-12-04 15:17:57 +01:00
George Peter Banyard
039d678fdf Remove now obsolete configure checks for INFINITY and NAN. 2019-12-04 13:50:10 +01:00
Florian Weimer
aeaab8ee3e Port various autoconf bits to C99 compilers
C99 no longer has implicit function declarations and implicit ints.
Current GCC versions enable them as an extension, but this will
change in a future GCC version.
2019-09-10 12:32:14 +02:00
Peter Kokot
cf197962e1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typo
  Simplify functions checks in m4
2019-07-17 03:55:04 +02:00
Peter Kokot
476339646c Simplify functions checks in m4
- AC_CHECK_FUNCS already automatically defines belonging HAVE_function
  symbols and executes given shell code.
2019-07-17 03:50:47 +02:00
Peter Kokot
98d0892dd8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync functions checks
2019-06-30 23:59:47 +02:00
Peter Kokot
9a3c8e51e3 Sync functions checks
Removed unused checks:
- mbsinit check removed, HAVE_MBSINIT removed (not used in php-src)
- mempcpy check removed, HAVE_MEMPCPY removed (not used in php-src anymore since
  560ed89bfb which uses PHP's own implementation)
- strpncpy check removed, added via a8c9e893b6 and
  not used.
- setpgid check removed since HAVE_SETPGID is not used

Moved to a central configure.ac:
- fpclass
- mbrlen moved to configure.ac (since the HAVE_MBRLEN is used accross the php-src)
- sigprocmask
- getcwd
- getwd
- glob
- strfmon
- nice

Duplicated checks removed:
- gethostname
- getlogin
- getpwuid_r
- socketpair

- mprotect check simplified
2019-06-30 23:57:54 +02:00
Peter Kokot
c48c6a021f Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_DEV_ARANDOM
2019-06-30 23:40:32 +02:00
Peter Kokot
1925102fe4 Remove HAVE_DEV_ARANDOM
The arandom check is not needed anymore since the implementations of:
3467526a65
and
6554f721f7
2019-06-30 23:39:44 +02:00
Peter Kokot
6bfa6bff0b Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean headers checks
2019-06-27 02:45:31 +02:00
Peter Kokot
2079b09854 Clean headers checks
Some headers were checked multiple times in the main configure.ac file
and in the bundled extensions or SAPIs themselves. Also many of these
checks are then used accross other extensions or SAPIs so a central
configure.ac makes most sense for these checks.
2019-06-27 02:45:09 +02:00
Peter Kokot
8d8333b498 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_STRTOD and strtod check
2019-06-26 23:13:01 +02:00
Peter Kokot
cc4134c04e Remove HAVE_STRTOD and strtod check
There is no need to check for the strtod function. It is part of C89
standard which PHP-7.4+ supports.

http://port70.net/~nsz/c/c89/c89-draft.html#4.10.1.4
2019-06-26 23:10:55 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
64b98c0e33 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove dead DEBUG_CFLAGS setting
2019-05-11 19:53:20 +02:00