Skip to content

Fix '++nothing+crc' is not a recognized feature for target when compiling M1 / M2 macOS #11796

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

Merged
merged 2 commits into from
Jul 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ext/standard/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ static inline int has_crc32_insn(void) {
# if!defined(__clang__)
# pragma GCC push_options
# pragma GCC target ("+nothing+crc")
# elif defined(__APPLE__)
# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)
# else
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
# endif
Expand Down Expand Up @@ -96,6 +98,8 @@ static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) {
# if defined(__GNUC__)
# if !defined(__clang__)
# pragma GCC pop_options
# elif defined(__APPLE__)
# pragma clang attribute pop
Comment on lines +101 to +102
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would just remove this - it doesn't make much sense - just unnecessary code duplication but it's a NIT really..

# else
# pragma clang attribute pop
# endif
Expand Down