mirror of https://github.com/php/php-src
Browse Source
The existing check for -fvisibility=hidden support came from a time when only GCC had it. The test for it used a regular expression to parse the GCC major version from the output of `$CC --version`, and would look for version 4 or greater. The regular expression used to accomplish this is doomed, however, since GCC can be built with a custom version string (--with-pkgversion). Moreover, the $CC variable can be set to something that confuses it but is otherwise valid. For example, it would fail with CC=x86_64-pc-linux-gnu-gcc. This commit fixes two aspects of the feature test. First, it no longer limits the test to GCC. At least clang now supports the flag, and can make use of it when GCC is its backend. Second, support for the flag is tested directly, by attempting to pass it to the compiler, rather than by parsing its version string. The latter is accomplished with a new macro, AX_CHECK_COMPILE_FLAG, taken from the autoconf archive. The new macro has been added to acinclude.m4, and the test stanza in configure.in has been replaced with a single call to the new macro. Note that the new macro calls AC_PREREQ(2.64) -- a more stringent requirement than the existing AC_PREREQ(2.59) in configure.in. The difference represents about six years of autoconf releases, from v2.59 in December of 2003 to v2.64 in July of 2009. This problem was noticed by Brian Evans, who also suggested the fix. PHP-Bug: 73062pull/2124/head
2 changed files with 22 additions and 14 deletions
Loading…
Reference in new issue