Req #79895 [Opn->Csd]: PHP_CHECK_GCC_ARG does not allow flags with equal (=) sign
| From: | nikic@php.net | Date: | Wed, 29 Jul 2020 10:40:12 +0000 |
| Subject: | Req #79895 [Opn->Csd]: PHP_CHECK_GCC_ARG does not allow flags with equal (=) sign | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228270@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79895&edit=1
ID: 79895
Updated by: nikic@php.net
Reported by: santi at mola dot io
Summary: PHP_CHECK_GCC_ARG does not allow flags with equal
(=) sign
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: Unknown/Other Function
Operating System: Unix-like
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of santi@mola.io
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e767ca60a0b333fa387e23a0a56482fe2e81b564
Log: Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
Previous Comments:
------------------------------------------------------------------------
[2020-07-24 20:48:51] santi at mola dot io
The following pull request has been associated:
Patch Name: Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
On GitHub: https://github.com/php/php-src/pull/5890
Patch: https://github.com/php/php-src/pull/5890.patch
------------------------------------------------------------------------
[2020-07-24 20:41:02] santi at mola dot io
The following patch has been added/updated:
Patch Name: PHP_CHECK_GCC_ARG.patch
Revision: 1595623262
URL: https://bugs.php.net/patch-display.php?bug=79895&patch=PHP_CHECK_GCC_ARG.patch&revision=1595623262
------------------------------------------------------------------------
[2020-07-24 20:40:42] santi at mola dot io
Description:
------------
The PHP_CHECK_GCC_ARG m4 macro in acinclude.m4 does not support flags with equal (=) sign. This
affects detection of flags like -std=gnu99 or -fsanitize=address (clang).
I'm experiencing this on a private project, but I've seen at least one open source project
getting stuck there: https://github.com/mongodb/mongo-php-driver/blob/c81330c0778a1bd6d314ad3fd7c5d397d5df1dcb/config.m4#L46
The patch is pretty simple, but unfortunately it is backwards incompatible for projects that were
(incorrectly) using this macro to check -std=gnu99 support and were working without the check, since
the ./configure call may succeed anyway but the flag will not be added. So fixing this issue may
cause problems in projects that are using the macro for -std=gnu99 or similar and didn't
realize the flag is not added. I'm not sure if that kind of compatibility is supposed to be
kept at patch versions or if it would go to the next minor.
Test script:
---------------
PHP_CHECK_GCC_ARG(-std=gnu99, _CFLAGS="$_CFLAGS -std=gnu99")
Expected result:
----------------
$ phpize && ./configure
[...]
checking whether cc supports -std=gnu99... yes
[...]
Actual result:
--------------
$ phpize && ./configure
[...]
checking whether cc supports -std=gnu99... ./configure: line 4221: gnu99+:: command not found
gnu99=yes=gnu99
[...]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79895&edit=1