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

Apple M1 arm64 support #281

Closed
DarkSector opened this issue Dec 26, 2021 · 0 comments · Fixed by #283
Closed

Apple M1 arm64 support #281

DarkSector opened this issue Dec 26, 2021 · 0 comments · Fixed by #283
Assignees

Comments

@DarkSector
Copy link

DarkSector commented Dec 26, 2021

Describe the solution you'd like
cryptoauthlib can be built for arm64 for Apple M1 - Mac OS X Monterey

Describe alternatives you've considered
Can be built on x86_64 using rosetta but it requires a separate installation of Mac Homebrew

Additional context
Currently this error comes up

  • Clone repository
  • Use CMake
  • Use make to build
❯ cmake .
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for malloc
-- Looking for malloc - found
-- Looking for free
-- Looking for free - found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pronoyc/Code/cryptoauthlib
❯ ls
CMakeCache.txt           CONTRIBUTING.md          Makefile                 app                      cryptoauthlib.conf       lib                      package.xml              test
CMakeFiles               CPackConfig.cmake        README.md                cmake_install.cmake      dist-tools               license.txt              python                   third_party
CMakeLists.txt           CPackSourceConfig.cmake  SECURITY.md              cryptoauthlib-manual.pdf harmony                  module.xml               release_notes.md
❯ make
[  1%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_basic.c.o
[  2%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_cfgs.c.o
[  4%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_debug.c.o
[  5%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_device.c.o
[  7%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_helpers.c.o
[  8%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_iface.c.o
[ 10%] Building C object lib/CMakeFiles/cryptoauth.dir/atca_utils_sizes.c.o
[ 11%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_aes.c.o
[ 12%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_aes_gcm.c.o
[ 14%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_basic.c.o
[ 15%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_checkmac.c.o
[ 17%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_command.c.o
[ 18%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_counter.c.o
[ 20%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_derivekey.c.o
[ 21%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_ecdh.c.o
[ 22%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_execution.c.o
[ 24%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_gendig.c.o
[ 25%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_genkey.c.o
[ 27%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_helpers.c.o
[ 28%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_hmac.c.o
[ 30%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_info.c.o
[ 31%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_kdf.c.o
[ 32%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_lock.c.o
[ 34%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_mac.c.o
[ 35%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_nonce.c.o
[ 37%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_privwrite.c.o
[ 38%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_random.c.o
[ 40%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_read.c.o
[ 41%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_secureboot.c.o
[ 42%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_selftest.c.o
[ 44%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_sha.c.o
[ 45%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_sign.c.o
[ 47%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_updateextra.c.o
[ 48%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_verify.c.o
[ 50%] Building C object lib/CMakeFiles/cryptoauth.dir/calib/calib_write.c.o
[ 51%] Building C object lib/CMakeFiles/cryptoauth.dir/host/atca_host.c.o
[ 52%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/api_206a/api_206a.c.o
[ 54%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_client.c.o
[ 55%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_date.c.o
[ 57%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_def.c.o
[ 58%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_der.c.o
[ 60%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_host_hw.c.o
[ 61%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_host_sw.c.o
[ 62%] Building C object lib/CMakeFiles/cryptoauth.dir/atcacert/atcacert_pem.c.o
[ 64%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_hw_aes_cbc.c.o
[ 65%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_hw_aes_cbcmac.c.o
[ 67%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_hw_aes_ccm.c.o
[ 68%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_hw_aes_cmac.c.o
[ 70%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_hw_aes_ctr.c.o
[ 71%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_pbkdf2.c.o
[ 72%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_sw_ecdsa.c.o
[ 74%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_sw_rand.c.o
[ 75%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_sw_sha1.c.o
[ 77%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/atca_crypto_sw_sha2.c.o
[ 78%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/hashes/sha1_routines.c.o
[ 80%] Building C object lib/CMakeFiles/cryptoauth.dir/crypto/hashes/sha2_routines.c.o
[ 81%] Building C object lib/CMakeFiles/cryptoauth.dir/jwt/atca_jwt.c.o
[ 82%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tflxtls_cert_def_4_device.c.o
[ 84%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tng_atca.c.o
[ 85%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tng_atcacert_client.c.o
[ 87%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tng_root_cert.c.o
[ 88%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_1_signer.c.o
[ 90%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_2_device.c.o
[ 91%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_4_device.c.o
[ 92%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_1_signer.c.o
[ 94%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_2_device.c.o
[ 95%] Building C object lib/CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_3_device.c.o
[ 97%] Building C object lib/CMakeFiles/cryptoauth.dir/hal/atca_hal.c.o
[ 98%] Building C object lib/CMakeFiles/cryptoauth.dir/hal/hal_linux.c.o
[100%] Linking C shared library libcryptoauth.dylib
ld: warning: pointer not aligned at address 0x1C11B (_g_tflxtls_cert_def_4_device + 99 from CMakeFiles/cryptoauth.dir/__/app/tng/tflxtls_cert_def_4_device.c.o)
ld: warning: pointer not aligned at address 0x1C111 (_g_tflxtls_cert_def_4_device + 89 from CMakeFiles/cryptoauth.dir/__/app/tng/tflxtls_cert_def_4_device.c.o)
ld: warning: pointer not aligned at address 0x1C173 (_g_tnglora_cert_def_1_signer + 80 from CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_1_signer.c.o)
ld: warning: pointer not aligned at address 0x1C1F1 (_g_tnglora_cert_def_2_device + 99 from CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_2_device.c.o)
ld: warning: pointer not aligned at address 0x1C1E7 (_g_tnglora_cert_def_2_device + 89 from CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_2_device.c.o)
ld: warning: pointer not aligned at address 0x1C1DE (_g_tnglora_cert_def_2_device + 80 from CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_2_device.c.o)
ld: warning: pointer not aligned at address 0x1C252 (_g_tnglora_cert_def_4_device + 89 from CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_4_device.c.o)
ld: warning: pointer not aligned at address 0x1C249 (_g_tnglora_cert_def_4_device + 80 from CMakeFiles/cryptoauth.dir/__/app/tng/tnglora_cert_def_4_device.c.o)
ld: warning: pointer not aligned at address 0x1C2BD (_g_tngtls_cert_def_1_signer + 89 from CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_1_signer.c.o)
ld: warning: pointer not aligned at address 0x1C332 (_g_tngtls_cert_def_2_device + 99 from CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_2_device.c.o)
ld: warning: pointer not aligned at address 0x1C31F (_g_tngtls_cert_def_2_device + 80 from CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_2_device.c.o)
ld: warning: pointer not aligned at address 0x1C39D (_g_tngtls_cert_def_3_device + 99 from CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_3_device.c.o)
ld: warning: pointer not aligned at address 0x1C393 (_g_tngtls_cert_def_3_device + 89 from CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_3_device.c.o)
ld: warning: pointer not aligned at address 0x1C38A (_g_tngtls_cert_def_3_device + 80 from CMakeFiles/cryptoauth.dir/__/app/tng/tngtls_cert_def_3_device.c.o)
ld: unaligned pointer(s) for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libcryptoauth.dylib] Error 1
make[1]: *** [lib/CMakeFiles/cryptoauth.dir/all] Error 2
make: *** [all] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants