-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix detection of unknown gcc function attributes #8483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As described in autoconf-archive upstream [1], from where `build/ax_gcc_func_attribute.m4` is forked, the old unknown func attr detection method would throw a false negative anytime an unrelated warning was raised. This results in `ax_cv_have_func_attribute_target` being set to `no` whenever certain compiler Warning flags are switched on. Namely, having `-Wall` on, which is a default CFLAG for some linux distributions, will result in ``` warning: ‘bar’ declared ‘static’ but never defined [-Wunused-function] ``` when evaluating support for the `target` function attribute. With that configuration value set to `no`, the compiled php binaries will not support x86_64 v3 instructions such as avx2 and sse2, which should speed up specific tasks ran by PHP. This issue was originally reported in Ubuntu [2]. [1] http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commitdiff;h=df0894ad1a8195df67a52108b931e07d708cec9a [2] https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1882279
Thank you for the PR, and the thorough explanation!
Ugh, that is bad. I think this PR should target the PHP-8.0 branch, and we may consider to update all autoconf files copyied from upstream to the latest revisions for the master branch. |
I based it in the php-8.0 branch but forgot to target it in this PR. Fixed. Should I go ahead and update the other macros in this PR or would it be OK to file another PR for that matter? |
Please submit a separate PR for this, and target the "master" branch. This very PR is about fixing a bug; the full update might cause issues for the stable branches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Some *nix devs may like to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you ! |
GCC outputs a warning when Wstrict-prototypes is on, in such case the attribute detection always fails even if the attribute is actually supported. This change checks for the "-Wattributes" warning in conftest.err instead of the existence of the file. Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1882279 Forwarded: php/php-src#8483 Origin: http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commitdiff;h=df0894ad1a8195df67a52108b931e07d708cec9a Last-Update: 2022-05-02 Gbp-Pq: Name 0046-Update-gcc-func-attr-macro.patch
As described in autoconf-archive upstream [1], from where
build/ax_gcc_func_attribute.m4
is forked, the old unknown func attrdetection method would throw a false negative anytime an unrelated
warning was raised.
This results in
ax_cv_have_func_attribute_target
being set tono
whenever certain compiler Warning flags are switched on. Namely, having
-Wall
on, which is a default CFLAG for some linux distributions, willresult in
when evaluating support for the
target
function attribute.With that configuration value set to
no
, the compiled php binarieswill not support x86_64 v3 instructions such as avx2 and sse2, which
should speed up specific tasks ran by PHP.
This issue was originally reported in Ubuntu [2].
[1] http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commitdiff;h=df0894ad1a8195df67a52108b931e07d708cec9a
[2] https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1882279