Skip to content
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

support macOS arm #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

support macOS arm #48

wants to merge 1 commit into from

Conversation

toge
Copy link

@toge toge commented Sep 28, 2024

I met compilation errors on macOS arm.
This error seems to be caused by 2 reasons.

First, LINUX_ARM is falsely defined by macOS arm.

#if defined(__ARM_ARCH) || defined(__ARM_NEON) || defined(__ARM_NEON__)
    #if !defined IOS
        #define LINUX_ARM
    #endif
#endif

It causes following compilation error.

gf256.cpp:35:10: fatal error: 'elf.h' file not found
   35 | #include <elf.h>
      |          ^~~~~~~

Second, tmmintrin.h is falsely included on macOS arm.

#if defined(ANDROID) || defined(IOS) || defined(LINUX_ARM) || defined(__powerpc__) || defined(__s390__)
    #define GF256_TARGET_MOBILE
#endif // ANDROID

It causes following compilation error due to including tmmintrin.h.

In file included from gf256.cpp:30:
In file included from gf256.h:75:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/tmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
   14 | #error "This header is only meant to be used on x86 and x64 architecture"
      |  ^

This PR tries to fix these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant