Skip to content

'++nothing+crc' is not a recognized feature for this target (ignoring feature) when compiling C language on M1 / M2 mac #11785

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

Closed
youkidearitai opened this issue Jul 25, 2023 · 1 comment · Fixed by #11796

Comments

@youkidearitai
Copy link
Contributor

Description

Displays '++nothing+crc' is not a recognized feature for this target (ignoring feature) when compiling ext/standard/crc32.c on M1 / M2 mac.

$ make
/bin/sh /Users/tekimen/src/php-src/libtool --silent --preserve-dup-deps --tag CC --mode=compile cc -Iext/standard/ -I/Users/tekimen/src/php-src/ext/standard/ -I/Users/tekimen/src/php-src/include -I/Users/tekimen/src/php-src/main -I/Users/tekimen/src/php-src -I/Users/tekimen/src/php-src/ext/date/lib -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.8/include -I/Users/tekimen/src/php-src/ext/mbstring/libmbfl -I/Users/tekimen/src/php-src/ext/mbstring/libmbfl/mbfl -I/Users/tekimen/src/php-src/TSRM -I/Users/tekimen/src/php-src/Zend  -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -fvisibility=hidden -O0 -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /Users/tekimen/src/php-src/ext/standard/crc32.c -o ext/standard/crc32.lo  -MMD -MF ext/standard/crc32.dep -MT ext/standard/crc32.lo

Resulted in this output:

'++nothing+crc' is not a recognized feature for this target (ignoring feature)
'++nothing+crc' is not a recognized feature for this target (ignoring feature)

But I expected this output instead:

(displays nothing)

I think fix below on ext/standard/crc32.c line no 72, however I don't know well to #pragma target .

 72 #   pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)

PHP Version

PHP 8.3 (master)

Operating System

macOS 13.4.1

@youkidearitai
Copy link
Contributor Author

Ah, I found talk about "+nothing+crc" GCC mailing list
https://gcc.gnu.org/legacy-ml/gcc-patches/2015-07/msg02011.html

#pragma GCC target ("+nothing+crc") where the +nothing clears out aarch64_isa_flags,

Therefore, my idea is maybe wrong.

Girgias pushed a commit that referenced this issue Jul 29, 2023
… macOS compile target (#11796)

#pragma GCC target("+nothing+crc") is means clear outs aarch64_isa_flags.

However, #pragma clang attribute push(__attribute__((target("+nothing+crc") is not means any, then displays ignore feature. (Not reproduce Linux on ARM (ex: Raspberry Pi))

Therefore, Add new #pragma when compiling on M1/M2 macOS.
jorgsowa pushed a commit to jorgsowa/php-src that referenced this issue Aug 16, 2023
… M2 macOS compile target (php#11796)

#pragma GCC target("+nothing+crc") is means clear outs aarch64_isa_flags.

However, #pragma clang attribute push(__attribute__((target("+nothing+crc") is not means any, then displays ignore feature. (Not reproduce Linux on ARM (ex: Raspberry Pi))

Therefore, Add new #pragma when compiling on M1/M2 macOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant