Repository: bitcoin/bitcoin (language: cpp)

Issue:
guix: building for `arm64-apple-darwin` fails on arm64-apple (M1)
Similar but different to #22458. The build fails in depends while building libdmg-hfsplus:
```bash
time BASE_CACHE="/base_cache" SOURCES_PATH="/sources" SDK_PATH="/SDKs" HOSTS="arm64-apple-darwin" ./contrib/guix/guix-build
< snipped >
[ 48%] Building C object hfs/CMakeFiles/hfs.dir/hfscompress.c.o
[ 51%] Linking C static library libhfs.a
make[3]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
[ 51%] Built target hfs
make[3]: Entering directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
make[3]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
make[3]: Entering directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
[ 55%] Building C object dmg/CMakeFiles/dmg.dir/adc.c.o
[ 59%] Building C object dmg/CMakeFiles/dmg.dir/base64.c.o
[ 62%] Building C object dmg/CMakeFiles/dmg.dir/checksum.c.o
[ 66%] Building C object dmg/CMakeFiles/dmg.dir/dmgfile.c.o
[ 70%] Building C object dmg/CMakeFiles/dmg.dir/filevault.c.o
[ 74%] Building C object dmg/CMakeFiles/dmg.dir/dmglib.c.o
[ 77%] Building C object dmg/CMakeFiles/dmg.dir/io.c.o
[ 81%] Building C object dmg/CMakeFiles/dmg.dir/resources.c.o
[ 85%] Building C object dmg/CMakeFiles/dmg.dir/partition.c.o
[ 88%] Building C object dmg/CMakeFiles/dmg.dir/udif.c.o
[ 92%] Linking C static library libdmg.a
make[3]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
[ 92%] Built target dmg
make[3]: Entering directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
make[3]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
make[3]: Entering directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
[ 96%] Building C object dmg/CMakeFiles/dmg-bin.dir/dmg.c.o
[100%] Linking C executable dmg
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(abort.o): in function `abort':
(.text.unlikely+0x34): undefined reference to `__aarch64_cas4_acq'
ld: (.text.unlikely+0xa0): undefined reference to `__aarch64_swp4_rel'
ld: (.text.unlikely+0xe4): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(libc-start.o): in function `__libc_start_main':
(.text+0x330): undefined reference to `__aarch64_ldadd4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(assert.o): in function `__assert_fail_base':
(.text+0x114): undefined reference to `__aarch64_swp8_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dcigettext.o): in function `_nl_find_msg':
(.text+0x7d8): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x8c8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x90c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x928): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x994): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x9e4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(loadmsgcat.o): in function `_nl_load_domain':
(.text+0x44): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x438): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(localealias.o): in function `_nl_expand_alias':
(.text+0x3f8): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x490): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x554): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(exit.o): in function `__run_exit_handlers':
(.text+0x5c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x84): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xb4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x100): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x17c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1b8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(cxa_atexit.o): in function `__internal_atexit':
(.text+0x150): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x188): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1c4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(vfscanf-internal.o): in function `__vfscanf_internal':
(.text+0x1ec): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xa48): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(vfprintf-internal.o): in function `__vfprintf_internal':
(.text+0x2528): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x26a0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x4628): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x46a8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(fxprintf.o): in function `__vfxprintf':
(.text+0x224): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2a4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(fxprintf.o): in function `__fxprintf_nocancel':
(.text+0x3f4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x480): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(iofclose.o): in function `_IO_new_fclose':
(.text+0x48): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xe4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x104): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1b0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x23c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(iofflush.o): in function `_IO_fflush':
(.text+0x44): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xd0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x138): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(iofread.o): in function `_IO_fread':
(.text+0x5c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xf8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x154): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(iofwrite.o): in function `_IO_fwrite':
(.text+0x5c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x160): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x17c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1f8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(ioputs.o): in function `_IO_puts':
(.text+0x54): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x148): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1d0): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(putchar.o): in function `putchar':
(.text+0x4c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xf0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x154): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(wfileops.o): in function `_IO_wfile_underflow':
(.text+0xb4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x59c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x654): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(fseeko.o): in function `__fseeko':
(.text+0x4c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xc0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x11c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(ftello.o): in function `__ftello':
(.text+0x40): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xb8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x154): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1cc): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(libc_fatal.o): in function `__libc_message':
(.text+0x234): undefined reference to `__aarch64_swp8_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(fileops.o): in function `_IO_new_file_underflow':
(.text+0x28c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2f8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x508): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o):(.text+0x5c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o):(.text+0x90): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o):(.text+0x2d4): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o):(.text+0x318): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o):(.text+0x3f8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o):(.text+0x46c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o): in function `_IO_link_in':
(.text+0x554): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x594): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x5e0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x680): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o): in function `_IO_flush_all_lockp':
(.text+0x1618): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x167c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x178c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x17c0): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o): in function `_IO_cleanup':
(.text+0x188c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1904): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x19a4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1a18): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1ab0): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o): in function `_IO_flush_all_linebuffered':
(.text+0x1b60): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1bb0): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1c5c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1cd4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o): in function `_IO_list_lock':
(.text+0x2180): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(genops.o): in function `_IO_list_unlock':
(.text+0x21e8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(libc-lowlevellock.o): in function `__lll_lock_wait_private':
(.text+0x24): undefined reference to `__aarch64_swp4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `_dl_tunable_set_mxfast':
(.text+0x824): undefined reference to `__aarch64_ldadd4_acq'
ld: (.text+0x830): undefined reference to `__aarch64_ldadd8_acq'
ld: (.text+0x96c): undefined reference to `__aarch64_ldadd8_acq'
ld: (.text+0x98c): undefined reference to `__aarch64_cas8_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `_dl_tunable_set_mallopt_check':
(.text+0xb58): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xc0c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1114): undefined reference to `__aarch64_swp8_acq'
ld: (.text+0x14c4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x1584): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x15a0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x15f0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x164c): undefined reference to `__aarch64_cas8_rel'
ld: (.text+0x19a8): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1e3c): undefined reference to `__aarch64_ldadd4_acq'
ld: (.text+0x1e5c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1e74): undefined reference to `__aarch64_ldadd8_acq'
ld: (.text+0x1e94): undefined reference to `__aarch64_cas8_acq'
ld: (.text+0x2374): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x23a4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x23e8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x24c8): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x24f4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x255c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x25d0): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x25fc): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2628): undefined reference to `__aarch64_cas8_acq'
ld: (.text+0x2750): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2778): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x2794): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x27bc): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x27d4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2844): undefined reference to `__aarch64_cas8_acq'
ld: (.text+0x28d8): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x291c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x2934): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2964): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x2b80): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x2b9c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2bc4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x2f88): undefined reference to `__aarch64_cas8_acq'
ld: (.text+0x3460): undefined reference to `__aarch64_cas8_acq'
ld: (.text+0x3b04): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x3b2c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x3e60): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x3e8c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x4204): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x4228): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x4268): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x42dc): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x4428): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x444c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__malloc_fork_lock_parent':
(.text+0x454c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x456c): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__malloc_fork_unlock_parent':
(.text+0x45d8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x4604): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__libc_malloc':
(.text+0x48dc): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x4900): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x4b78): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x4ba0): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__malloc_arena_thread_freeres':
(.text+0x4ee0): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x4f14): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__libc_realloc':
(.text+0x51cc): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x51f4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__libc_calloc':
(.text+0x5618): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x5694): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x56c8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__malloc_trim':
(.text+0x57c4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x58d4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x593c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__libc_mallinfo2':
(.text+0x5afc): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x5b18): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__malloc_stats':
(.text+0x5c90): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x5cec): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(malloc.o): in function `__libc_mallopt':
(.text+0x5e00): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x5e54): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x5f00): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x5f50): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(wcsmbsload.o): in function `__wcsmbs_clone_conv':
(.text+0x318): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x368): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(tzset.o): in function `__tzset':
(.text+0xe64): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xea4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(tzset.o): in function `__tz_convert':
(.text+0xf28): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xf78): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x102c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(gconv_db.o): in function `__gconv_find_transform':
(.text+0xa98): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xb4c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0xb90): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0xbec): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0xc6c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(gconv_db.o): in function `__gconv_close_transform':
(.text+0xcd4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xd98): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(setenv.o): in function `__add_to_environ':
(.text+0x4c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xf8): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x184): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2e0): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(setenv.o): in function `__unsetenv':
(.text+0x3fc): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x44c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(setenv.o): in function `__clearenv':
(.text+0x500): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x52c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x55c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(random.o): in function `__srandom':
(.text+0x24): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x44): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(random.o): in function `__initstate':
(.text+0xc0): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xf4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(random.o): in function `__setstate':
(.text+0x178): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1a8): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(random.o): in function `__random':
(.text+0x220): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x240): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(reg-printf.o): in function `__register_printf_specifier':
(.text+0x3c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x68): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(reg-modifier.o): in function `__register_printf_modifier':
(.text+0x88): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x104): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(reg-type.o): in function `__register_printf_type':
(.text+0x28): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x6c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(funlockfile.o): in function `__funlockfile':
(.text+0x34): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(vfwprintf-internal.o): in function `__vfwprintf_internal':
(.text+0x26b0): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x2808): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x48b4): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x4928): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(iofputs.o): in function `_IO_fputs':
(.text+0x50): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x10c): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x170): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(iogetdelim.o): in function `_IO_getdelim':
(.text+0x1a0): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x224): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x2cc): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(ioseekoff.o): in function `_IO_seekoff':
(.text+0x168): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x1dc): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x238): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(fseek.o): in function `fseek':
(.text+0x4c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xc0): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x11c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(libc-cancellation.o): in function `__libc_enable_asynccancel':
(.text+0x38): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x90): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(libc-cancellation.o): in function `__libc_disable_asynccancel':
(.text+0xd8): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(rewinddir.o): in function `__rewinddir':
(.text+0x20): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x4c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(readdir64.o): in function `__readdir64':
(.text+0x3c): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0xc4): undefined reference to `__aarch64_swp4_rel'
ld: (.text+0x110): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-lookup.o): in function `_dl_lookup_symbol_x':
(.text+0x1130): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-profile.o): in function `_dl_mcount':
(.text+0x7e8): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x850): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x8ac): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x918): undefined reference to `__aarch64_cas4_acq'
ld: (.text+0x990): undefined reference to `__aarch64_cas4_acq'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-profile.o):(.text+0x9e4): more undefined references to `__aarch64_cas4_acq' follow
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-thread_gscope_wait.o): in function `__thread_gscope_wait':
(.text+0x1a4): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-runtime.o): in function `_dl_fixup':
(.text+0x16c): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-runtime.o): in function `_dl_profile_fixup':
(.text+0x438): undefined reference to `__aarch64_swp4_rel'
ld: /gnu/store/pm2ghr2rjc93q5r0l79jfzz0bmw38q6n-gcc-toolchain-7.5.0-static/lib/libc.a(dl-sym.o):(.text+0x240): undefined reference to `__aarch64_swp4_rel'
collect2: error: ld returned 1 exit status
make[3]: *** [dmg/CMakeFiles/dmg-bin.dir/build.make:100: dmg/dmg] Error 1
make[3]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
make[2]: *** [CMakeFiles/Makefile2:184: dmg/CMakeFiles/dmg-bin.dir/all] Error 2
make[2]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build'
make[1]: *** [Makefile:136: all] Error 2
make[1]: Leaving directory '/bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build/dmg'
make: *** [funcs.mk:282: /bitcoin/depends/work/build/arm64-apple-darwin/native_libdmg-hfsplus/7ac55ec64c96f7800d9818ce64c79670e7f02b67-9689ef82609/build/.stamp_built] Error 2
make: Leaving directory '/bitcoin/depends'
```


Discussion / hints:
Probably caused by https://bugzilla.redhat.com/show_bug.cgi?id=1830472

> On aarch64 -moutline-atomics has been turned on by default, and those symbols are solely in libgcc.a, not in libgcc_s.so.*.

Suggested fix: add `-mno-outline-atomics` to C(XX)FLAGS
It happens for the `x86_64-apple-darwin` host as well.

Fix patch:
diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
index d296eb9543cba..143a32bbb64b0 100644
--- a/contrib/guix/manifest.scm
+++ b/contrib/guix/manifest.scm
@@ -593,24 +593,30 @@ inspecting signatures in Mach-O binaries.")
         ;; Git
         git
         ;; Tests
-        lief
-        ;; Native gcc 7 toolchain
-        gcc-toolchain-7
-        (list gcc-toolchain-7 "static"))
+        lief)
   (let ((target (getenv "HOST")))
     (cond ((string-suffix? "-mingw32" target)
            ;; Windows
-           (list zip
+           (list ;; Native GCC 10 toolchain
+                 gcc-toolchain-10
+                 (list gcc-toolchain-10 "static")
+                 zip
                  (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
                  (make-nsis-for-gcc-10 nsis-x86_64)
                  osslsigncode))
           ((string-contains target "-linux-")
-           (list (cond ((string-contains target "riscv64-")
+           (list ;; Native GCC 7 toolchain
+                 gcc-toolchain-7
+                 (list gcc-toolchain-7 "static")
+                 (cond ((string-contains target "riscv64-")
                         (make-bitcoin-cross-toolchain target
                                                       #:base-libc glibc-2.27/bitcoin-patched
                                                       #:base-kernel-headers linux-libre-headers-4.19))
                        (else
                         (make-bitcoin-cross-toolchain target)))))
           ((string-contains target "darwin")
-           (list clang-toolchain-10 binutils cmake xorriso python-signapple))
+           (list ;; Native GCC 10 toolchain
+                 gcc-toolchain-10
+                 (list gcc-toolchain-10 "static")
+                 clang-toolchain-10 binutils cmake xorriso python-signapple))
           (else '())))))


Test patch: