random: don't special case clock usage on macOS #17800

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:random_macos_clocks changing 1 files +0 −14
  1. fanquake commented at 3:47 AM on December 24, 2019: member

    clock_gettime(), CLOCK_MONOTONIC and CLOCK_REALTIME are all available for use on macOS (now that we require macOS >=10.12 and build against 10.14). Use them rather than the deprecated mach_timespec_t time API.

    I mentioned the possibility for this change in [#17270](/bitcoin-bitcoin/17270/).

    master:

    2019-12-23T20:49:43Z Feeding 216 bytes of dynamic environment data into RNG
    2019-12-23T20:50:43Z Feeding 216 bytes of dynamic environment data into RNG
    

    This PR:

    2019-12-23T20:32:41Z Feeding 232 bytes of dynamic environment data into RNG
    2019-12-23T20:33:42Z Feeding 232 bytes of dynamic environment data into RNG
    

    Depends on #16392. Merged.

  2. fanquake added the label macOS on Dec 24, 2019
  3. fanquake added the label Utils/log/libs on Dec 24, 2019
  4. fanquake added the label Needs gitian build on Dec 24, 2019
  5. fanquake requested review from sipa on Dec 24, 2019
  6. sipa commented at 3:51 AM on December 24, 2019: member

    Concept ACK

  7. fanquake removed the label Needs gitian build on Dec 24, 2019
  8. fanquake commented at 1:21 PM on December 24, 2019: member

    Note that the build failure in the macOS 10.12 build is because we are still building against the 10.11 SDK, which doesn't contain the required clock functions. Bumping to the 10.14 SDK is being done in #16392.

    randomenv.cpp:240:21: error: unused variable 'ts' [-Werror,-Wunused-variable]
        struct timespec ts = {};
                        ^
    1 error generated.
    Makefile:9345: recipe for target 'libbitcoin_util_a-randomenv.o' failed
    
  9. sanjaykdragon commented at 3:35 PM on December 29, 2019: contributor

    ACK 4738d99: good change, but would this cause issues for backwards compatibility?

  10. laanwj commented at 1:35 PM on January 4, 2020: member

    MacOS 10.12: oh, so this depends on #16392, good to know, added to OP

    /usr/bin/ccache /home/travis/build/bitcoin/bitcoin/depends/x86_64-apple-darwin16/native/bin/clang++ -target x86_64-apple-darwin16 -mmacosx-version-min=10.12 --sysroot /home/travis/build/bitcoin/bitcoin/depends/SDKs/MacOSX10.11.sdk -mlinker-version=253.9 -stdlib=libc++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I.  -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/home/travis/build/bitcoin/bitcoin/depends/x86_64-apple-darwin16/share/../include -I./leveldb/include -I./leveldb/helpers/memenv -I./secp256k1/include -I./univalue/include -Qunused-arguments -I/home/travis/build/bitcoin/bitcoin/depends/x86_64-apple-darwin16/share/../include/  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0  -Wstack-protector -fstack-protector-all   -Werror=vla -Werror=switch -Werror=thread-safety-analysis -Werror=unused-variable    -pipe -O2  -fvisibility=hidden -c -o libbitcoin_util_a-randomenv.o `test -f 'randomenv.cpp' || echo './'`randomenv.cpp
    
    randomenv.cpp:240:21: error: unused variable 'ts' [-Werror,-Wunused-variable]
    
        struct timespec ts = {};
    
                        ^
    
    1 error generated.
    
  11. laanwj commented at 1:29 PM on February 5, 2020: member

    Restarted Travis now that #16392 is in.

    but would this cause issues for backwards compatibility?

    Luckily, that tends to not really an issue for MacOS users.

  12. random: don't special case clock usage on macOS
    clock_gettime(), CLOCK_MONOTONIC and CLOCK_REALTIME are all available for use on
    macOS (now that we require macOS >=10.12). Use them rather than the deprecated
    mach_timespec_t time API.
    
    master:
    2019-12-23T20:49:43Z Feeding 216 bytes of dynamic environment data into RNG
    2019-12-23T20:50:43Z Feeding 216 bytes of dynamic environment data into RNG
    
    this commit:
    2019-12-23T20:32:41Z Feeding 232 bytes of dynamic environment data into RNG
    2019-12-23T20:33:42Z Feeding 232 bytes of dynamic environment data into RNG
    dc9305b616
  13. fanquake force-pushed on Feb 6, 2020
  14. fanquake commented at 1:48 AM on February 6, 2020: member

    The macOS builds looked ok, but I've rebased to fix two unrelated Travis errors. Should be all green shortly.

  15. fanquake added the label Needs gitian build on Feb 14, 2020
  16. DrahtBot commented at 10:22 AM on February 17, 2020: member

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds

    File commit 2a2631fb0dc781504df0f3fe8b42f21cbdb6f20d<br>(master) commit 068842a90b80b2cf09cd764f37e20f300f9a8892<br>(master and this pull)
    bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz 51392e3413128845... a67e8e35111fdd9e...
    bitcoin-0.19.99-aarch64-linux-gnu.tar.gz 9c68060f909b176a... 1c2f351a67e49c90...
    bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz a4c6bc9d98b02c39... 063e024ae4f2ac86...
    bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz 91c276c85c6ea8f0... 4f311d98ebd0f77f...
    bitcoin-0.19.99-osx-unsigned.dmg 71c8478f6158f433... 15d05fd11ac521c5...
    bitcoin-0.19.99-osx64.tar.gz e9f498c9b0694e08... a2a45cbfb530f19b...
    bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz e53b974b60b018a7... 07e22acff6843c58...
    bitcoin-0.19.99-riscv64-linux-gnu.tar.gz 3ae4b4f4bf44d8ed... cd3ec14377490b08...
    bitcoin-0.19.99-win64-debug.zip 88fc928933abadaf... 3bdaa28ca467642a...
    bitcoin-0.19.99-win64-setup-unsigned.exe 78c96ebfdbda69a3... d8808da2ebc9c5d3...
    bitcoin-0.19.99-win64.zip be3e701005cfa682... dcb36a978a3b0fa7...
    bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz bdbbb809f6569067... 1418700e7c348fc9...
    bitcoin-0.19.99-x86_64-linux-gnu.tar.gz 185e77d19a57404c... 2cd1930aceed0923...
    bitcoin-0.19.99.tar.gz bd8f4dff76b14fe8... 7bdf831bdf018172...
    bitcoin-core-linux-0.20-res.yml c3a41885d43ad9c1... 77c98388238cc921...
    bitcoin-core-osx-0.20-res.yml 2ea28d851bd7def3... d53a6cba9dc61463...
    bitcoin-core-win-0.20-res.yml db5c46d54aa23a95... 79fd45237150c4a6...
    linux-build.log 67c5b5639d5edc84... 8da29ad907b7ac2c...
    osx-build.log 635adff0cbd384f3... 924396cfb5f03fe2...
    win-build.log f9061ed05f12c5c0... 96e602189eb0613e...
    bitcoin-core-linux-0.20-res.yml.diff 000127fd53902ea0...
    bitcoin-core-osx-0.20-res.yml.diff 706ff787ca84c901...
    bitcoin-core-win-0.20-res.yml.diff 039f57a3c4ef7c12...
    linux-build.log.diff 0613df3736b31f9d...
    osx-build.log.diff 090a6bcd3af0d7dc...
    win-build.log.diff 6efca77f01f918c5...
  17. DrahtBot removed the label Needs gitian build on Feb 17, 2020
  18. laanwj commented at 9:51 PM on February 28, 2020: member

    ACK dc9305b6162ec615ff5fb2876e4f312051b543af

  19. laanwj merged this on Feb 28, 2020
  20. laanwj closed this on Feb 28, 2020

  21. fanquake deleted the branch on Feb 28, 2020
  22. sidhujag referenced this in commit 639537df89 on Feb 29, 2020
  23. fanquake referenced this in commit 715dbbe9e8 on Feb 29, 2020
  24. sidhujag referenced this in commit 6fb7217883 on Feb 29, 2020
  25. sidhujag referenced this in commit 45b75873ec on Nov 10, 2020
  26. sidhujag referenced this in commit 0426e598a4 on Nov 10, 2020
  27. Fabcien referenced this in commit dd28d04454 on Jan 4, 2021
  28. DrahtBot locked this on Feb 15, 2022

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: 2026-04-13 15:14 UTC

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