build: Check for std::atomic::exchange rather than std::atomic_exchange #25599

pull achow101 wants to merge 1 commits into bitcoin:master from achow101:specifc-atomics-check changing 2 files +7 −4
  1. achow101 commented at 11:31 pm on July 12, 2022: member

    Our usage of std::atomic is with it’s own exchange function, not std::atomic_exchange. So we should be looking specifically for that function.

    This removes the need for -latomic for riscv builds, which resolves a guix cross architecture reproducibility issue.

  2. DrahtBot added the label Build system on Jul 12, 2022
  3. maflcko added the label DrahtBot Guix build requested on Jul 13, 2022
  4. hebasto commented at 7:10 am on July 13, 2022: member

    This removes the need for -latomic for riscv builds, which resolves a guix cross architecture reproducibility issue.

    Out of curiosity, how did you find it out?

  5. fanquake commented at 9:18 am on July 13, 2022: member
    Concept ACK over #25559. We just also need to test with older GCC.
  6. fanquake commented at 9:36 am on July 13, 2022: member

    Looks like this isn’t quite enough for matching builds. I’m still seeing a store path:

    0guix-build-bc3528bf224c/output/riscv64-linux-gnu/bitcoin-bc3528bf224c/bin$ strings bitcoin-cli | grep "gnu/store"
    1/gnu/store/xkwi4lbycx9wilxfbgkkpdin0kjnlwwl-gcc-cross-riscv64-linux-gnu-10.3.0-lib/riscv64-linux-gnu/lib
    

    x86_64:

    0b0bdb6899ea90e44790c2220e255a5c7a5b4b412028f4f0a50fe27c0aad76908  guix-build-bc3528bf224c/output/dist-archive/bitcoin-bc3528bf224c.tar.gz
    11abfcac48d50a4c2897f325162dd0db2a4a07ee69283ac4111da05114822f936  guix-build-bc3528bf224c/output/riscv64-linux-gnu/SHA256SUMS.part
    28030227acc2c34feefb3faf6ac5931f2234d57aa2dccc1a829f77b33d5fc0251  guix-build-bc3528bf224c/output/riscv64-linux-gnu/bitcoin-bc3528bf224c-riscv64-linux-gnu-debug.tar.gz
    36788a3d89284c50038bdbe9af37926649b1ccb2a12c0815a4cabd3bb2a40f680  guix-build-bc3528bf224c/output/riscv64-linux-gnu/bitcoin-bc3528bf224c-riscv64-linux-gnu.tar.gz
    

    arm64:

    0b0bdb6899ea90e44790c2220e255a5c7a5b4b412028f4f0a50fe27c0aad76908  guix-build-bc3528bf224c/output/dist-archive/bitcoin-bc3528bf224c.tar.gz
    1a5b54f1c209b271ba14ca5285a02c35d1bb958e71e61e775bb152f8efeab61e4  guix-build-bc3528bf224c/output/riscv64-linux-gnu/SHA256SUMS.part
    28030227acc2c34feefb3faf6ac5931f2234d57aa2dccc1a829f77b33d5fc0251  guix-build-bc3528bf224c/output/riscv64-linux-gnu/bitcoin-bc3528bf224c-riscv64-linux-gnu-debug.tar.gz
    37bbf5566d71d57abeeeafe1d7a4f83301bac8d929505a3923698aeb6492d21b8  guix-build-bc3528bf224c/output/riscv64-linux-gnu/bitcoin-bc3528bf224c-riscv64-linux-gnu.tar.gz
    
  7. achow101 force-pushed on Jul 13, 2022
  8. achow101 commented at 6:01 pm on July 13, 2022: member

    Apparently -pthread has an effect on whether -latomic is needed, so I’ve updated the check to also include the pthreads flags that we would use for the actual build. This (for some reason) eliminates the need for -latomic and so riscv will not have the store path

    x86_64

    08ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    10dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    2cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    3b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    

    arm64

    08ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    10dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    2cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    3b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    
  9. fanquake commented at 6:07 pm on July 13, 2022: member

    Guix Build (x86_64):

    08ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    10dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    2cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    3b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    

    Guix Build (arm64):

    08ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    10dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    2cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    3b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    
  10. DrahtBot commented at 9:40 pm on July 13, 2022: contributor

    Guix builds

    File commit 1d89fc695a3aeb3e3dcadf371b7667572b38c836(master) commit 378963ff5ab32333cf717652f1af938d5b5e7495(master and this pull)
    SHA256SUMS.part 040a20b01cc3e1c8... 21190638c43dd2cd...
    *-aarch64-linux-gnu-debug.tar.gz 56017c6d2db18ad9... ca1d9fed5f246a93...
    *-aarch64-linux-gnu.tar.gz 5a93d659668679f4... 1bae3f64af5c4d6b...
    *-arm-linux-gnueabihf-debug.tar.gz 002cd2af12d57c35... 8dad66275cb1056e...
    *-arm-linux-gnueabihf.tar.gz 19cb3a7d9585279b... f4370f160b76f042...
    *-arm64-apple-darwin-unsigned.dmg a3848d04c8ca26e3... 22569eb76106fb4c...
    *-arm64-apple-darwin-unsigned.tar.gz 55e3ae4038758e6b... 26c523d3d3910be7...
    *-arm64-apple-darwin.tar.gz 4d2dcf75335a6cf7... 1c21d4dd5f003186...
    *-powerpc64-linux-gnu-debug.tar.gz e46b28154dc314db... 73c13b506728cb44...
    *-powerpc64-linux-gnu.tar.gz 61adf9530c3ccfa8... b913f2c6bf99c640...
    *-powerpc64le-linux-gnu-debug.tar.gz 350ab7d1be444bf5... 276cd372b30c72a9...
    *-powerpc64le-linux-gnu.tar.gz bcfbddb1fe67357f... e7b2e53666ffec03...
    *-riscv64-linux-gnu-debug.tar.gz 101a4389989874e4... c660d681b24311f6...
    *-riscv64-linux-gnu.tar.gz 642508f58b5982af... dbc38e6cd4d73bc0...
    *-win64-debug.zip 1812d54be66789fc... 01e4a6996e499518...
    *-win64-setup-unsigned.exe 7b2b98eca1d8aaf0... 3ec1396c5bacaead...
    *-win64-unsigned.tar.gz 3e5ce015d3ed1ed0... 2eda4479463614af...
    *-win64.zip 18be84e6e2e208ff... 5ef35f94dbaa7b3e...
    *-x86_64-apple-darwin-unsigned.dmg c311a0f445ad9902... 7d24ae5cb83ca36d...
    *-x86_64-apple-darwin-unsigned.tar.gz 4f7f40dfaef0abc0... b21172a8d547ce87...
    *-x86_64-apple-darwin.tar.gz 420de2d1def18b1c... aabf61c1a81301f7...
    *-x86_64-linux-gnu-debug.tar.gz dc46da902834dafe... a63437d4bfd819b0...
    *-x86_64-linux-gnu.tar.gz 6be28a23d66b3b5a... 683b8a57cce38c66...
    *.tar.gz de6bc76ab68358b7... 1249494da08ad1d1...
    guix_build.log a7dca2a54a90c9d6... 3c811e963e0e55fa...
    guix_build.log.diff 5c810aab1bec4f9b...
  11. DrahtBot removed the label DrahtBot Guix build requested on Jul 13, 2022
  12. hebasto commented at 8:15 am on July 14, 2022: member

    Guix builds on x86_64:

    0$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    18ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    20dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    3cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    4b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    
  13. maflcko added the label DrahtBot Guix build requested on Jul 14, 2022
  14. fanquake commented at 1:50 pm on July 14, 2022: member

    Apparently -pthread has an effect on whether -latomic is needed,

    When you use -pthread you end up with --push-state --as-needed -latomic --pop-state on the link line. This is done by GCC, see here:

    0/* Because RISC-V only has word-sized atomics, it requries libatomic where
    1   others do not.  So link libatomic by default, as needed.  */
    2#undef LIB_SPEC
    3#ifdef LD_AS_NEEDED_OPTION
    4#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \
    5  " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}"
    6#else
    7#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
    8#endif
    

    If you take the code from our atomic check code, and compile it once with -latomic, and once with -pthread, i.e:

    0# riscv64-linux-gnu-g++ (Ubuntu 11.2.0-16ubuntu1) 11.2.0
    1
    2riscv64-linux-gnu-g++ atomic.cpp -v -latomic -o a.atomic
    3# vs
    4riscv64-linux-gnu-g++ atomic.cpp -v -pthread -o a.pthread
    

    you end up with “basically” the same binary. The assembly is identical, but the ELF headers and some sections differ, but this is just ordering:

    Comparing a.pthread & a.atomic

    File has been modified after NT_GNU_BUILD_ID has been applied.

    readelf –wide –dynamic

     0@@ -1,13 +1,13 @@
     1 
     2 Dynamic section at offset 0xdf0 contains 29 entries:
     3   Tag        Type                         Name/Value
     4+ 0x0000000000000001 (NEEDED)             Shared library: [libatomic.so.1]
     5  0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
     6  0x0000000000000001 (NEEDED)             Shared library: [ld-linux-riscv64-lp64d.so.1]
     7- 0x0000000000000001 (NEEDED)             Shared library: [libatomic.so.1]
     8  0x0000000000000020 (PREINIT_ARRAY)      0x1dd8
     9  0x0000000000000021 (PREINIT_ARRAYSZ)    8 (bytes)
    10  0x0000000000000019 (INIT_ARRAY)         0x1de0
    11  0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
    12  0x000000000000001a (FINI_ARRAY)         0x1de8
    13  0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
    14  0x000000006ffffef5 (GNU_HASH)           0x2d8
    

    readelf –wide –notes

    0@@ -1,8 +1,8 @@
    1 
    2 Displaying notes found in: .note.gnu.build-id
    3   Owner                Data size 	Description
    4-  GNU                  0x00000014	NT_GNU_BUILD_ID (unique build ID bitstring)	    Build ID: 72a32f5b7270a5f338c45e3c74cc8764757f06e8
    5+  GNU                  0x00000014	NT_GNU_BUILD_ID (unique build ID bitstring)	    Build ID: 9beb4114ca7d27988c3cac8e257c717dbf6b7bb2
    6 
    7 Displaying notes found in: .note.ABI-tag
    8   Owner                Data size 	Description
    9   GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)	    OS: Linux, ABI: 4.15.0
    

    strings –all –bytes=8

     0@@ -1,18 +1,18 @@
     1 /lib/ld-linux-riscv64-lp64d.so.1
     2+_ITM_deregisterTMCloneTable
     3+_ITM_registerTMCloneTable
     4+__atomic_exchange_1
     5 __cxa_finalize
     6 __libc_start_main
     7 __stack_chk_fail
     8 __stack_chk_guard
     9-_ITM_deregisterTMCloneTable
    10-_ITM_registerTMCloneTable
    11-__atomic_exchange_1
    12+libatomic.so.1
    13 libc.so.6
    14 ld-linux-riscv64-lp64d.so.1
    15-libatomic.so.1
    16 LIBATOMIC_1.0
    17 GLIBC_2.27
    18 GLIBC_2.34
    19 GCC: (Ubuntu 11.2.0-16ubuntu1) 11.2.0
    20 rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0
    21 __abi_tag
    22 crtstuff.c
    

    readelf –wide –decompress –hex-dump=.dynstr

     0@@ -1,18 +1,18 @@
     1 
     2 Hex dump of section '.dynstr':
     3-  0x000003f0 005f5f63 78615f66 696e616c 697a6500 .__cxa_finalize.
     4-  0x00000400 5f5f6c69 62635f73 74617274 5f6d6169 __libc_start_mai
     5-  0x00000410 6e005f5f 73746163 6b5f6368 6b5f6661 n.__stack_chk_fa
     6-  0x00000420 696c005f 5f737461 636b5f63 686b5f67 il.__stack_chk_g
     7-  0x00000430 75617264 005f4954 4d5f6465 72656769 uard._ITM_deregi
     8-  0x00000440 73746572 544d436c 6f6e6554 61626c65 sterTMCloneTable
     9-  0x00000450 005f4954 4d5f7265 67697374 6572544d ._ITM_registerTM
    10-  0x00000460 436c6f6e 65546162 6c65005f 5f61746f CloneTable.__ato
    11-  0x00000470 6d69635f 65786368 616e6765 5f31006c mic_exchange_1.l
    12-  0x00000480 6962632e 736f2e36 006c642d 6c696e75 ibc.so.6.ld-linu
    13-  0x00000490 782d7269 73637636 342d6c70 3634642e x-riscv64-lp64d.
    14-  0x000004a0 736f2e31 006c6962 61746f6d 69632e73 so.1.libatomic.s
    15+  0x000003f0 005f4954 4d5f6465 72656769 73746572 ._ITM_deregister
    16+  0x00000400 544d436c 6f6e6554 61626c65 005f4954 TMCloneTable._IT
    17+  0x00000410 4d5f7265 67697374 6572544d 436c6f6e M_registerTMClon
    18+  0x00000420 65546162 6c65005f 5f61746f 6d69635f eTable.__atomic_
    19+  0x00000430 65786368 616e6765 5f31005f 5f637861 exchange_1.__cxa
    20+  0x00000440 5f66696e 616c697a 65005f5f 6c696263 _finalize.__libc
    21+  0x00000450 5f737461 72745f6d 61696e00 5f5f7374 _start_main.__st
    22+  0x00000460 61636b5f 63686b5f 6661696c 005f5f73 ack_chk_fail.__s
    23+  0x00000470 7461636b 5f63686b 5f677561 7264006c tack_chk_guard.l
    24+  0x00000480 69626174 6f6d6963 2e736f2e 31006c69 ibatomic.so.1.li
    25+  0x00000490 62632e73 6f2e3600 6c642d6c 696e7578 bc.so.6.ld-linux
    26+  0x000004a0 2d726973 63763634 2d6c7036 34642e73 -riscv64-lp64d.s
    27   0x000004b0 6f2e3100 4c494241 544f4d49 435f312e o.1.LIBATOMIC_1.
    28   0x000004c0 3000474c 4942435f 322e3237 00474c49 0.GLIBC_2.27.GLI
    29   0x000004d0 42435f32 2e333400                   BC_2.34.
    

    cc @laanwj @jarolrod as you can actually test these changes / produced binaries on hardware.

  15. hebasto commented at 4:41 pm on July 14, 2022: member

    Guix builds on arm64:

    0# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    18ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    20dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    3cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    4b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    
  16. DrahtBot commented at 8:50 pm on July 14, 2022: contributor

    Guix builds

    File commit 062b9db0ccb6af8bfbaa2b29132408cda9991b40(master) commit 2bd14f494f13544026d84b69f4798fb8d68d0d62(master and this pull)
    SHA256SUMS.part 90bfc40575c9ce38... 65c780d94495f025...
    *-aarch64-linux-gnu-debug.tar.gz 815c173e572ce731... eaba6630ba1fcfc3...
    *-aarch64-linux-gnu.tar.gz e41cde31acf92394... cc68432519b21682...
    *-arm-linux-gnueabihf-debug.tar.gz 8671324d547eb696... affba2a54f2bafc3...
    *-arm-linux-gnueabihf.tar.gz 0d191a575d78e25e... f408fe6a73c796fa...
    *-riscv64-linux-gnu-debug.tar.gz 09f927da6da46f72... 4e93bdb95d425ed1...
    *-riscv64-linux-gnu.tar.gz 9092c0ebbe32dcb6... 73d7e29fb7f02da1...
    *-x86_64-linux-gnu-debug.tar.gz fd2b6388f647848e... 1df1499b1327673c...
    *-x86_64-linux-gnu.tar.gz 4c378772cd12729c... cf05d58d097df580...
    *.tar.gz 6e304ca904cdaa5a... ed52438767f2734f...
    guix_build.log 11230304a9ef575c... c5affc0160161030...
    *-arm64-apple-darwin-unsigned.dmg dbc69c1a08e7905a...
    *-arm64-apple-darwin-unsigned.tar.gz 1b36b417ecac5b94...
    *-arm64-apple-darwin.tar.gz cea2fc3c2c42e4c1...
    *-powerpc64-linux-gnu-debug.tar.gz 08a21168b8d4d0dc...
    *-powerpc64-linux-gnu.tar.gz c4222ffdaa1e69f5...
    *-powerpc64le-linux-gnu-debug.tar.gz 122c230e1d1e1168...
    *-powerpc64le-linux-gnu.tar.gz 722dc88b9c97f0fd...
    *-win64-debug.zip fb9eacf1211d9f15...
    *-win64-setup-unsigned.exe 0d6839b282e8d5d5...
    *-win64-unsigned.tar.gz 2462f7ba69dcec11...
    *-win64.zip aedf7d43d1422f94...
    *-x86_64-apple-darwin-unsigned.dmg c7de069f27fefbe0...
    *-x86_64-apple-darwin-unsigned.tar.gz ab97dfed1177851f...
    *-x86_64-apple-darwin.tar.gz 3cd770e73f7d3868...
    guix_build.log.diff d7e61b0a2730b3a7...
  17. DrahtBot removed the label DrahtBot Guix build requested on Jul 14, 2022
  18. in build-aux/m4/l_atomic.m4:39 in e663787a4e outdated
    34@@ -35,16 +35,22 @@ AC_DEFUN([CHECK_ATOMIC], [
    35 
    36   AC_LANG_PUSH(C++)
    37 
    38+  LIBS_TEMP="$LIBS"
    39+  unset LIBS
    


    hebasto commented at 8:32 am on July 15, 2022:
    Why this line?
  19. in build-aux/m4/l_atomic.m4:40 in e663787a4e outdated
    34@@ -35,16 +35,22 @@ AC_DEFUN([CHECK_ATOMIC], [
    35 
    36   AC_LANG_PUSH(C++)
    37 
    38+  LIBS_TEMP="$LIBS"
    39+  unset LIBS
    40+  LIBS="$LIBS_TEMP $PTHREAD_CFLAGS $PTHREAD_LIBS"
    


    hebasto commented at 8:35 am on July 15, 2022:

    The PTHREAD_CFLAGS flags are only required. Suggesting to use them in a more idiomatic way:

     0--- a/build-aux/m4/l_atomic.m4
     1+++ b/build-aux/m4/l_atomic.m4
     2@@ -18,7 +18,7 @@ m4_define([_CHECK_ATOMIC_testbody], [[
     3 
     4   int main() {
     5     std::atomic<bool> lock{true};
     6-    std::atomic_exchange(&lock, false);
     7+    lock.exchange(false);
     8 
     9     std::atomic<std::chrono::seconds> t{0s};
    10     t.store(2s);
    11@@ -34,6 +34,8 @@ m4_define([_CHECK_ATOMIC_testbody], [[
    12 AC_DEFUN([CHECK_ATOMIC], [
    13 
    14   AC_LANG_PUSH(C++)
    15+  TEMP_CXXFLAGS="$CXXFLAGS"
    16+  CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
    17 
    18   AC_MSG_CHECKING([whether std::atomic can be used without link library])
    19 
    20@@ -51,5 +53,6 @@ AC_DEFUN([CHECK_ATOMIC], [
    21         ])
    22     ])
    23 
    24+  CXXFLAGS="$TEMP_CXXFLAGS"
    25   AC_LANG_POP
    26 ])
    

    fanquake commented at 9:46 am on July 18, 2022:
    I’ve Guix build a branch with this simplification, and it’s working as expected. @achow101 do you want to incorporate this change?

    fanquake commented at 10:10 am on July 18, 2022:

    I had some additional uneeded code left in that branch. Have force pushed to drop it, and done new builds. Guix Build (x86_64):

    0a79f45073561315f06a2123a0f77d8a2d151beee3a21b4fbacc79c88b7068ea1  guix-build-fbf863560bc3/output/dist-archive/bitcoin-fbf863560bc3.tar.gz
    104666a68e548e2965fe2bfcb80ef3851671f90b2e06b9cebaca2b8eba585b9dd  guix-build-fbf863560bc3/output/riscv64-linux-gnu/SHA256SUMS.part
    2172b5b301dcb3edd8bb562fd3d3522d8a18ccf69aa50e87723202dd5b1c8bc2a  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu-debug.tar.gz
    340df37725534781b81ac556be79ef54fc350de1f9fb6a88de182ea5a98bc6977  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu.tar.gz
    

    Guix Build (arm64):

    0a79f45073561315f06a2123a0f77d8a2d151beee3a21b4fbacc79c88b7068ea1  guix-build-fbf863560bc3/output/dist-archive/bitcoin-fbf863560bc3.tar.gz
    104666a68e548e2965fe2bfcb80ef3851671f90b2e06b9cebaca2b8eba585b9dd  guix-build-fbf863560bc3/output/riscv64-linux-gnu/SHA256SUMS.part
    2172b5b301dcb3edd8bb562fd3d3522d8a18ccf69aa50e87723202dd5b1c8bc2a  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu-debug.tar.gz
    340df37725534781b81ac556be79ef54fc350de1f9fb6a88de182ea5a98bc6977  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu.tar.gz
    

    hebasto commented at 10:26 am on July 18, 2022:

    Guix builds on x86_64 for @fanquake’s branch:

    0a79f45073561315f06a2123a0f77d8a2d151beee3a21b4fbacc79c88b7068ea1  guix-build-fbf863560bc3/output/dist-archive/bitcoin-fbf863560bc3.tar.gz
    104666a68e548e2965fe2bfcb80ef3851671f90b2e06b9cebaca2b8eba585b9dd  guix-build-fbf863560bc3/output/riscv64-linux-gnu/SHA256SUMS.part
    2172b5b301dcb3edd8bb562fd3d3522d8a18ccf69aa50e87723202dd5b1c8bc2a  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu-debug.tar.gz
    340df37725534781b81ac556be79ef54fc350de1f9fb6a88de182ea5a98bc6977  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu.tar.gz
    

    hebasto commented at 10:32 am on July 18, 2022:

    Guix builds on arm64 for @fanquake’s branch:

    0a79f45073561315f06a2123a0f77d8a2d151beee3a21b4fbacc79c88b7068ea1  guix-build-fbf863560bc3/output/dist-archive/bitcoin-fbf863560bc3.tar.gz
    104666a68e548e2965fe2bfcb80ef3851671f90b2e06b9cebaca2b8eba585b9dd  guix-build-fbf863560bc3/output/riscv64-linux-gnu/SHA256SUMS.part
    2172b5b301dcb3edd8bb562fd3d3522d8a18ccf69aa50e87723202dd5b1c8bc2a  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu-debug.tar.gz
    340df37725534781b81ac556be79ef54fc350de1f9fb6a88de182ea5a98bc6977  guix-build-fbf863560bc3/output/riscv64-linux-gnu/bitcoin-fbf863560bc3-riscv64-linux-gnu.tar.gz
    

    achow101 commented at 2:47 pm on July 18, 2022:
    Done
  20. jarolrod commented at 8:34 pm on July 15, 2022: member

    GUIX hashes

    x86:

    0$ env HOSTS='riscv64-linux-gnu' ./contrib/guix/guix-build 
    1$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    2
    38ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    40dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    5cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    6b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    

    arm64:

    0$ env HOSTS='riscv64-linux-gnu' ./contrib/guix/guix-build 
    1$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    2
    38ed44d4f8b34d9f71a0d4fef8fb6b0e3db8f6c99416cf651bffe84ff6e8a10b2  guix-build-e663787a4e4c/output/dist-archive/bitcoin-e663787a4e4c.tar.gz
    40dc739fdebad85b659940747c7458532b53eead8cea7ceb1fe60e45ef65983d0  guix-build-e663787a4e4c/output/riscv64-linux-gnu/SHA256SUMS.part
    5cf7ea6fa5a08f0b20c70f7cbcdc98978ae7f795427734c3d6197fa4f04dc36f4  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu-debug.tar.gz
    6b28c757be27657b62d5239b8c21c9f1cd7e8509ad899118670ee5defbae6d513  guix-build-e663787a4e4c/output/riscv64-linux-gnu/bitcoin-e663787a4e4c-riscv64-linux-gnu.tar.gz
    
  21. build: Check for std::atomic::exchange rather than std::atomic_exchange
    Our usage of std::atomic is with it's own exchange function, not
    std::atomic_exchange. So we should be looking specifically for that
    function.
    
    Additionally, -pthread and -lpthread have an effect on whether -latomic
    will be needed, so the atomics check needs to use these flags as well.
    This will make the flags in use better match what is actually used when
    linking.
    
    This removes the need for -latomic for riscv builds, which resolves a
    guix cross architecture reproducibility issue.
    4de4221ab4
  22. achow101 force-pushed on Jul 18, 2022
  23. achow101 commented at 3:09 pm on July 18, 2022: member

    Builds for 4de4221ab4b645ff77503c777c9b195a962e9fa1

    x86_64:

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    

    arm64:

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    
  24. hebasto commented at 3:19 pm on July 18, 2022: member

    Guix builds on x86_64:

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    
  25. hebasto commented at 3:23 pm on July 18, 2022: member

    Guix builds on arm64:

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    
  26. hebasto approved
  27. hebasto commented at 3:24 pm on July 18, 2022: member
    ACK 4de4221ab4b645ff77503c777c9b195a962e9fa1
  28. fanquake approved
  29. fanquake commented at 3:31 pm on July 18, 2022: member

    ACK 4de4221ab4b645ff77503c777c9b195a962e9fa1

    Guix Build (x86_64):

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    

    Guix Build (arm64):

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    
  30. fanquake merged this on Jul 18, 2022
  31. fanquake closed this on Jul 18, 2022

  32. sidhujag referenced this in commit 6d9677cfe6 on Jul 18, 2022
  33. jarolrod commented at 11:29 pm on July 18, 2022: member

    post merge ack

    guix built bitcoind binary from both an x86 host and arm64 host run fine on my riscv board

    x86:

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    

    arm64:

    0dc9280f79e129d533fe69b4a44edf46ce9e640d737fe080e0cb1709d0f4561bb  guix-build-4de4221ab4b6/output/dist-archive/bitcoin-4de4221ab4b6.tar.gz
    19d961549ce28292b8c632c40b071b80c77a9049a5b3f0b603e62dfad7c39aca2  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/SHA256SUMS.part
    25d9b5094dc4da68148663a108a55df8c6a671aaa7af80afd38e26055d47c2daf  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu-debug.tar.gz
    3c77e83b003d9dd25f91dbc4aa5c00c9ee5ab66320cc94f85639bf8fb9a788d9a  guix-build-4de4221ab4b6/output/riscv64-linux-gnu/bitcoin-4de4221ab4b6-riscv64-linux-gnu.tar.gz
    
  34. hebasto referenced this in commit 33111dca9e on Sep 21, 2022
  35. hebasto referenced this in commit c0ecb0801d on Sep 26, 2022
  36. bitcoin locked this on Jul 19, 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-11-17 09:12 UTC

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