|  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
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:

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


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


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
 [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:
 [2020-07-29 10:40 UTC]
Automatic comment on behalf of
Log: Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
 [2020-07-29 10:40 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 24 13:01:31 2024 UTC