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

Build liboqs for MacOS M1 (arm64) #1973

Open
ivcantero opened this issue Nov 2, 2024 · 1 comment
Open

Build liboqs for MacOS M1 (arm64) #1973

ivcantero opened this issue Nov 2, 2024 · 1 comment
Labels
platform-specific Issue related to a specific platform configuration; core team may not have required platform

Comments

@ivcantero
Copy link

ivcantero commented Nov 2, 2024

Hi
I've tried to build liboqs for arm64 MacOS in a intel MacOS. The main purpose is to build later Chromium for that arm64 architecture, but it will apply to other purposes also. I used the proper parameter -DCMAKE_OSX_ARCHITECTURES=arm64 in the following command:
cmake .. -G"Ninja" -DCMAKE_INSTALL_PREFIX=$CHROMIUM_ROOT/third_party/boringssl/src/oqs -DOQS_USE_OPENSSL=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64

image

but when I run ninja I'm having errors as if the code wasn't ready to support this arm64 architecture.
Code would have to be adapted to be valid for that architecture.

image image image

I think that the problem are these headers shouldn't be used in arm64 architectures according to link:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/wmmintrin.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/emmintrin.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/xmmintrin.h

Once removed, other parts of the code have to be changed also to fix code, such as aes128_ni.c or aes256_ni.c
Created this Issue as suggested here

@SWilson4
Copy link
Member

SWilson4 commented Nov 4, 2024

I'm a little out of my depth when it comes to the intricacies of building the library on a Mac, but perhaps this could this be fixed with an appropriate CMake toolchain file, similarly to the way we handle cross-compiling for ARM on an x86_64 Linux machine?

@SWilson4 SWilson4 added the platform-specific Issue related to a specific platform configuration; core team may not have required platform label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-specific Issue related to a specific platform configuration; core team may not have required platform
Projects
Status: Todo
Development

No branches or pull requests

2 participants