C++11 build/runtime fixes #7302

pull theuni wants to merge 4 commits into bitcoin:master from theuni:c++11-prep changing 6 files +123 −96
  1. theuni commented at 10:22 pm on January 5, 2016: member

    In preparation for switching to the c++11 requirement, I’ve done depends builds on all supported OSs and fixed up any snags along the way.

    Note that this does not enable c++11 anywhere, it simply enables c++11 builds to pass.

    Once merged, we can begin moving forward with enabling.

  2. c++11: detect and correct for boost builds with an incompatible abi
    This is ugly, but temporary. boost::filesystem will likely be dropped soon
    after c++11 is enabled. Otherwise, we could simply roll our own copy_file. I've
    fixed this at the buildsystem level for now in order to avoid mixing in
    functional changes.
    
    Explanation:
    If boost (prior to 1.57) was built without c++11, it emulated scoped enums
    using c++98 constructs. Unfortunately, this implementation detail leaked into
    the abi. This was fixed in 1.57.
    
    When building against that installed version using c++11, the headers pick up
    on the native c++11 scoped enum support and enable it, however it will fail to
    link. This can be worked around by disabling c++11 scoped enums if linking will
    fail.
    
    Add an autoconf test to determine incompatibility. At build-time, if native
    enums are being used (a c++11 build), and force-disabling them causes a
    successful link, we can be sure that there's an incompatibility and enable the
    work-around.
    76ac35f36d
  3. c++11: don't throw from the reverselock destructor
    noexcept is default for destructors as of c++11. By throwing in reverselock's
    destructor if it's lock has been tampered with, the likely result is
    std::terminate being called. Indeed that happened before this change.
    
    Once reverselock has taken another lock (its ctor didn't throw), it makes no
    sense to try to grab or lock the parent lock. That is be broken/undefined
    behavior depending on the parent lock's implementation, but it shouldn't cause
    the reverselock to fail to re-lock when destroyed.
    
    To avoid those problems, simply swap the parent lock's contents with a dummy
    for the duration of the lock. That will ensure that any undefined behavior is
    caught at the call-site rather than the reverse lock's destruction.
    
    Barring a failed mutex unlock which would be indicative of a larger problem,
    the destructor should now never throw.
    89f71c68c0
  4. c++11: CAccountingEntry must be defined before use in a list
    c++11ism. This fixes builds against libc++.
    57d2f62c99
  5. c++11: fix libbdb build against libc++ in c++11 mode
    atomic_init clashes with
    3968922b96
  6. dcousens commented at 10:37 pm on January 5, 2016: contributor
    utACK 3968922
  7. fanquake commented at 11:29 pm on January 5, 2016: member

    conceptACK, will start testing shortly.

    On Wednesday, 6 January 2016, Daniel Cousens notifications@github.com wrote:

    utACK

    — Reply to this email directly or view it on GitHub #7302 (comment).

  8. jonasschnelli commented at 7:58 am on January 6, 2016: contributor
    code review ACK.
  9. jonasschnelli added the label Build system on Jan 6, 2016
  10. MarcoFalke commented at 12:11 pm on January 6, 2016: member
    utACK 3968922
  11. jgarzik commented at 2:08 pm on January 6, 2016: contributor
    utACK
  12. sipa commented at 7:28 pm on January 6, 2016: member
    utACK
  13. paveljanik commented at 8:07 pm on January 6, 2016: contributor

    minor nits: new configure line output is:

    0checking for mismatched boost c++11 scoped enums... ok
    

    Will we use C++11 like we use C++? Ie. capital C? Or is small c ok?

    Can you please add a comment to configure.ac (e.g. reuse the commit message) above the new part?

    Otherwise ACK Thanks!

  14. laanwj commented at 7:55 am on January 7, 2016: member
    utACK
  15. laanwj merged this on Jan 7, 2016
  16. laanwj closed this on Jan 7, 2016

  17. laanwj referenced this in commit 41f1a3e99b on Jan 7, 2016
  18. zkbot referenced this in commit 33f7145fb2 on Nov 29, 2017
  19. zkbot referenced this in commit b2399c1951 on Nov 30, 2017
  20. zkbot referenced this in commit d3ca2706a8 on Nov 30, 2017
  21. zkbot referenced this in commit 02c4467cb5 on Nov 30, 2017
  22. DrahtBot locked this on Sep 8, 2021

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 03:12 UTC

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