php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79895 PHP_CHECK_GCC_ARG does not allow flags with equal (=) sign
Submitted: 2020-07-24 20:40 UTC Modified: -
From: santi at mola dot io Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: Irrelevant OS: Unix-like
Private report: No CVE-ID: None
 [2020-07-24 20:40 UTC] 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
[...]

Patches

PHP_CHECK_GCC_ARG.patch (last revision 2020-07-24 20:41 UTC by santi at mola dot io)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-24 20:41 UTC] 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:48 UTC] 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-29 10:40 UTC] nikic@php.net
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
 [2020-07-29 10:40 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC