Skip to content

support macOS arm - #48

Open
toge wants to merge 1 commit into
catid:masterfrom
toge:support-macos-arm
Open

support macOS arm#48
toge wants to merge 1 commit into
catid:masterfrom
toge:support-macos-arm

Conversation

@toge

@toge toge commented Sep 28, 2024

Copy link
Copy Markdown

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