build failure on M1 (arm64): error: unknown target CPU ‘armv8-a+crc+crypto’ #25556

issue pinheadmz openend this issue on July 6, 2022
  1. pinheadmz commented at 4:20 pm on July 6, 2022: member

    System:

    0--> uname -a
    1Darwin   21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 arm64
    2
    3--> gcc -v
    4Apple clang version 13.1.6 (clang-1316.0.21.2.5)
    5Target: arm64-apple-darwin21.4.0
    6Thread model: posix
    7InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    

    Bitcoin: (master branch)

    0--> git rev-parse HEAD
    1aeab1b42e67cc8146bfc7d127d15633bd652fe60
    

    Build command:

    0./autogen.sh
    1./configure --without-gui --with-incompatible-bdb
    2make -j 4
    

    Error output:

     0...
     130 warnings generated.
     2  CXX      zmq/libbitcoin_zmq_a-zmqutil.o
     3  CXX      primitives/libbitcoin_consensus_a-block.o
     4  CXX      primitives/libbitcoin_consensus_a-transaction.o
     5  CXX      crypto/libbitcoin_crypto_base_la-aes.lo
     6  CXX      crypto/libbitcoin_crypto_base_la-chacha_poly_aead.lo
     7  CXX      crypto/libbitcoin_crypto_base_la-chacha20.lo
     8  CXX      crypto/libbitcoin_crypto_base_la-hkdf_sha256_32.lo
     9  CXX      crypto/libbitcoin_crypto_base_la-hmac_sha256.lo
    10  CXX      crypto/libbitcoin_crypto_base_la-hmac_sha512.lo
    11  CXX      crypto/libbitcoin_crypto_base_la-poly1305.lo
    12  CXX      crypto/libbitcoin_crypto_base_la-muhash.lo
    13  CXX      crypto/libbitcoin_crypto_base_la-ripemd160.lo
    14  CXX      crypto/libbitcoin_crypto_base_la-sha1.lo
    15  CXX      crypto/libbitcoin_crypto_base_la-sha256.lo
    16  CXX      crypto/libbitcoin_crypto_base_la-sha3.lo
    17  CXX      crypto/libbitcoin_crypto_base_la-sha512.lo
    18  CXX      crypto/libbitcoin_crypto_base_la-siphash.lo
    19  CXX      crypto/libbitcoin_crypto_base_la-sha256_sse4.lo
    20  CXX      crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo
    21  CXX      leveldb/db/libleveldb_la-builder.lo
    22error: unknown target CPU 'armv8-a+crc+crypto'
    23note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
    24make[2]: *** [crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo] Error 1
    25make[2]: *** Waiting for unfinished jobs....
    26make[1]: *** [all-recursive] Error 1
    27make: *** [all-recursive] Error 1
    
  2. pinheadmz added the label Bug on Jul 6, 2022
  3. sipa commented at 4:22 pm on July 6, 2022: member
    Bizarre, it looks like your compiler is targetting x86_64, not arm64.
  4. pinheadmz commented at 4:26 pm on July 6, 2022: member

    indeed, the M1 mac has been quite skitzophrenic when it comes to architecture and compiling native code, but I have had success with other projects. I just found something that might be part of the issue:

    0--> make -v
    1GNU Make 3.81
    2Copyright (C) 2006  Free Software Foundation, Inc.
    3This is free software; see the source for copying conditions.
    4There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    5PARTICULAR PURPOSE.
    6
    7This program built for i386-apple-darwin11.3.0
    
  5. fanquake added the label macOS on Jul 6, 2022
  6. pinheadmz commented at 5:07 pm on July 6, 2022: member

    output of ./configure includes:

    0
    1checking build system type... aarch64-apple-darwin21.4.0
    2checking host system type... aarch64-apple-darwin21.4.0
    
  7. fanquake commented at 5:26 pm on July 6, 2022: member
    This will almost certainly be something like rosseta inferering where it shouldn’t be, and confusing autotools / the compiler etc.
  8. pinheadmz commented at 5:31 pm on July 6, 2022: member

    libtool is dual arch:

    0--> file `which libtool`
    1/usr/bin/libtool: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
    2- Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e
    3- Mach-O 64-bit executable arm64e]
    4/usr/bin/libtool (for architecture x86_64):	Mach-O 64-bit executable x86_64
    5/usr/bin/libtool (for architecture arm64e):	Mach-O 64-bit executable arm64e
    

    but for some reason keeps generating glibtoolize with the wrong arch:

    0
    1When reporting a bug, please describe a test case to reproduce it and
    2include the following information:
    3
    4       host-triplet:   aarch64-apple-darwin21.3.0
    5       version:        $progname (GNU libtool) 2.4.7
    6       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
    7       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
    
  9. dongcarl commented at 7:28 pm on July 6, 2022: member
    Hmmm interesting… Could you do a make V=1 so we can see the CXX line?
  10. pinheadmz commented at 7:30 pm on July 6, 2022: member

    Thanks Carl,

    0/usr/local/bin/ccache g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config  -fmacro-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION -I. -I./minisketch/include -I./secp256k1/include -I./univalue/include -I/usr/local/include -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -I./leveldb/include  -fdebug-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -Wstack-protector -fstack-protector-all -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wno-unused-parameter -Wno-self-assign -Wno-deprecated-copy       -g -O2 -MT bitcoind-bitcoind.o -MD -MP -MF .deps/bitcoind-bitcoind.Tpo -c -o bitcoind-bitcoind.o `test -f 'bitcoind.cpp' || echo './'`bitcoind.cpp
    

    wrapped:

    /usr/local/bin/ccache g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config -fmacro-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION -I. -I./minisketch/include -I./secp256k1/include -I./univalue/include -I/usr/local/include -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -I./leveldb/include -fdebug-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -Wstack-protector -fstack-protector-all -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wno-unused-parameter -Wno-self-assign -Wno-deprecated-copy -g -O2 -MT bitcoind-bitcoind.o -MD -MP -MF .deps/bitcoind-bitcoind.Tpo -c -o bitcoind-bitcoind.o test -f 'bitcoind.cpp' || echo './'bitcoind.cpp

  11. pinheadmz commented at 7:31 pm on July 6, 2022: member

    oh heres right before the error:

    0/bin/sh ../libtool  --tag=CXX --preserve-dup-deps  --mode=compile /usr/local/bin/ccache g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config  -fmacro-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION -DENABLE_ARM_SHANI  -fdebug-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -Wstack-protector -fstack-protector-all -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wno-unused-parameter -Wno-self-assign -Wno-deprecated-copy       -static -march=armv8-a+crc+crypto -g -O2 -MT crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo -MD -MP -MF crypto/.deps/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.Tpo -c -o crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo `test -f 'crypto/sha256_arm_shani.cpp' || echo './'`crypto/sha256_arm_shani.cpp
    1libtool: compile:  /usr/local/bin/ccache g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config -fmacro-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION -DENABLE_ARM_SHANI -fdebug-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -Wstack-protector -fstack-protector-all -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wno-unused-parameter -Wno-self-assign -Wno-deprecated-copy -march=armv8-a+crc+crypto -g -O2 -MT crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo -MD -MP -MF crypto/.deps/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.Tpo -c crypto/sha256_arm_shani.cpp  -fno-common -DPIC -o crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.o
    

    /bin/sh ../libtool –tag=CXX –preserve-dup-deps –mode=compile /usr/local/bin/ccache g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config -fmacro-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION -DENABLE_ARM_SHANI -fdebug-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -Wstack-protector -fstack-protector-all -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wno-unused-parameter -Wno-self-assign -Wno-deprecated-copy -static -march=armv8-a+crc+crypto -g -O2 -MT crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo -MD -MP -MF crypto/.deps/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.Tpo -c -o crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo test -f 'crypto/sha256_arm_shani.cpp' || echo './'crypto/sha256_arm_shani.cpp libtool: compile: /usr/local/bin/ccache g++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config -fmacro-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION -DENABLE_ARM_SHANI -fdebug-prefix-map=/Users/matthewzipkin/Desktop/work/bitcoin=. -Wstack-protector -fstack-protector-all -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wno-unused-parameter -Wno-self-assign -Wno-deprecated-copy -march=armv8-a+crc+crypto -g -O2 -MT crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.lo -MD -MP -MF crypto/.deps/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.Tpo -c crypto/sha256_arm_shani.cpp -fno-common -DPIC -o crypto/libbitcoin_crypto_arm_shani_la-sha256_arm_shani.o

  12. pinheadmz commented at 7:42 pm on July 6, 2022: member

    okay seeing the full gcc line gave me a clue and I upgraded ccache which was migrated from my old intel based mac. After updating ccache build still failed but it got a lot farther:

     0  CXXLD    univalue/test/object
     1  CXXLD    univalue/test/unitester
     2  CXXLD    univalue/test/no_nul
     3  CXXLD    bitcoind
     4ld: warning: ignoring file /usr/local/Cellar/zeromq/4.3.4/lib/libzmq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
     5  CXXLD    bitcoin-cli
     6  CXXLD    test/test_bitcoin
     7ld: warning: ignoring file /usr/local/Cellar/zeromq/4.3.4/lib/libzmq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
     8  CXXLD    test/fuzz/fuzz
     9Undefined symbols for architecture arm64:
    10  "_zmq_msg_data", referenced from:
    11      zmq_send_multipart(void*, void const*, unsigned long, ...) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    12  "_zmq_msg_init_size", referenced from:
    13      zmq_send_multipart(void*, void const*, unsigned long, ...) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    14  "_zmq_socket", referenced from:
    15      CZMQAbstractPublishNotifier::Initialize(void*) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    16  "_zmq_ctx_term", referenced from:
    17      CZMQNotificationInterface::Shutdown() in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqnotificationinterface.o)
    18  "_zmq_bind", referenced from:
    19      CZMQAbstractPublishNotifier::Initialize(void*) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    20  "_zmq_setsockopt", referenced from:
    21      CZMQAbstractPublishNotifier::Initialize(void*) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    22      CZMQAbstractPublishNotifier::Shutdown() in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    23  "_zmq_msg_send", referenced from:
    24      zmq_send_multipart(void*, void const*, unsigned long, ...) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    25  "_zmq_msg_close", referenced from:
    26      zmq_send_multipart(void*, void const*, unsigned long, ...) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    27  "_zmq_close", referenced from:
    28      CZMQAbstractPublishNotifier::Initialize(void*) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    29      CZMQAbstractPublishNotifier::Shutdown() in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqpublishnotifier.o)
    30  "_zmq_ctx_new", referenced from:
    31      CZMQNotificationInterface::Initialize() in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqnotificationinterface.o)
    32  "_zmq_version", referenced from:
    33      CZMQNotificationInterface::Initialize() in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqnotificationinterface.o)
    34  "_zmq_strerror", referenced from:
    35      zmqError(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libbitcoin_zmq.a(libbitcoin_zmq_a-zmqutil.o)
    36ld: symbol(s) not found for architecture arm64
    37clang: error: linker command failed with exit code 1 (use -v to see invocation)
    38make[2]: *** [bitcoind] Error 1
    39make[2]: *** Waiting for unfinished jobs....
    40ld: warning: ignoring file /usr/local/Cellar/zeromq/4.3.4/lib/libzmq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    41ld: warning: ignoring file /usr/local/Cellar/zeromq/4.3.4/lib/libzmq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    42make[1]: *** [all-recursive] Error 1
    43make: *** [all-recursive] Error 1
    

    Looks like ZMQ just needs an upgrade from intel->arm next…

  13. pinheadmz commented at 7:48 pm on July 6, 2022: member

    SUCCESS!!

    Sheesh.

    For future frustrated nerds: ccache may need to be wiped out / upgraded, and old intel-homebrew packages in /usr/local/Cellar may need to be wiped out too (like ZMQ). Let arm-brew install new packages in /opt/homebrew

  14. pinheadmz closed this on Jul 6, 2022

  15. DrahtBot locked this on Jul 6, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me