depends: fix BDB compilation on OpenBSD #29443

pull theStack wants to merge 1 commits into bitcoin:master from theStack:202402-depends-fix_bdb_build_on_openbsd changing 1 files +0 −1
  1. theStack commented at 1:40 AM on February 18, 2024: contributor

    Compiling C++ code with -D_XOPEN_SOURCE=600 causes problems on OpenBSD. If that define is set, the C++ standard header detection routine in BDB's configure script fails due to a missing type name for locale_t (see https://gist.github.com/theStack/b41884e31ebc5cdca3220bcaa674cb70 for the relevant config.log part).

    This results in HAVE_CXX_STDHEADERS not being defined, which then it turn leads to the inclusion of <iostream.h> (rather than <iostream>), which doesn't exist, as described in #28963.

    According to a mailing list post discussing a similar problem [1], "OpenBSD provides the POSIX APIs by default", so we don't need this define anyway and can remove it. This fixes the BDB build problem as described in issue #28963. See also https://github.com/google/flatbuffers/pull/6205/commits/f87e75ae71a2301daf2ad59b180977fc30c6abe4 for a similar fix for google's flatbuffer project.

    Tested on OpenBSD 7.4 with clang 13.0.0. Fixes #28963.

    [1] https://www.mail-archive.com/tech@openbsd.org/msg63386.html

  2. depends: fix BDB compilation on OpenBSD
    Compiling C++ code with `-D_XOPEN_SOURCE=600` causes problems on
    OpenBSD. If that define is set, the C++ standard header detection
    routine in BDB's configure script fails. This results in
    `HAVE_CXX_STDHEADERS` not being defined, which then it turn leads to
    the inclusion of `<iostream.h>` (rather than `<iostream>`), which
    doesn't exist.
    
    According to a mailing list post discussing a similar problem [1],
    "OpenBSD provides the POSIX APIs by default", so we don't need this
    define anyway and can remove it. This fixes the BDB build problem as
    described in issue #28963.
    
    Tested on OpenBSD 7.4 with clang 13.0.0.
    
    [1] https://www.mail-archive.com/tech@openbsd.org/msg63386.html
    0fbf051fec
  3. DrahtBot commented at 1:40 AM on February 18, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fanquake
    Concept ACK jessebarton

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #28710 (Remove the legacy wallet and BDB dependency by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. DrahtBot added the label Build system on Feb 18, 2024
  5. jessebarton commented at 7:48 PM on February 23, 2024: contributor

    Testing this on a fresh OpenBSD 7.4 VM I had to also install gtar when running gmake -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1

    Confirmed when building master I got the error mentioned about <iostream.h> not existing.

    After switching branches to #29443 I experienced no issues.

    Might be worth updating the OpenBSD Doc to add a note about installing gtar. I can do this if its agreed that makes sense. @theStack

  6. jessebarton commented at 10:25 PM on February 23, 2024: contributor

    ACK

  7. theStack commented at 12:38 AM on February 24, 2024: contributor

    Testing this on a fresh OpenBSD 7.4 VM I had to also install gtar when running gmake -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1

    Confirmed when building master I got the error mentioned about <iostream.h> not existing.

    After switching branches to #29443 I experienced no issues.

    Thanks for testing!

    Might be worth updating the OpenBSD Doc to add a note about installing gtar. I can do this if its agreed that makes sense. @theStack

    Note that the gtar dependency is mentioned in depends/README.md already: https://github.com/bitcoin/bitcoin/blob/1ac627c485a43e50a9a49baddce186ee3ad4daad/depends/README.md?plain=1#L88-L90

    Maybe linking to that README.md file part in doc/build-openbsd.md would be a good idea. In the course of touching this file, you could also take the chance and bump the "Updated for OpenBSD" version number from 7.3 to 7.4 if you want to test the other build instructions as well, since you are on a fresh OpenBSD 7.4 VM anyway. Feel free to ping me as reviewer if you open a PR.

  8. fanquake approved
  9. fanquake commented at 11:30 AM on February 26, 2024: member

    ACK 0fbf051fec723f86f49ab14ea15c91bb1435c656

  10. DrahtBot requested review from jessebarton on Feb 26, 2024
  11. fanquake merged this on Feb 26, 2024
  12. fanquake closed this on Feb 26, 2024

  13. theStack deleted the branch on Feb 26, 2024
  14. jessebarton referenced this in commit fccfdb25b2 on Feb 26, 2024
  15. fanquake referenced this in commit 6a7ed5e237 on Feb 27, 2024
  16. weezyb0893 commented at 12:37 PM on March 12, 2024: none

    Yeah Yeah

  17. PastaPastaPasta referenced this in commit 46d6dde921 on Oct 24, 2024
  18. PastaPastaPasta referenced this in commit 9b6a05df66 on Oct 24, 2024
  19. PastaPastaPasta referenced this in commit aaccc9ea51 on Oct 24, 2024
  20. bitcoin locked this on Mar 12, 2025

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-14 21:13 UTC

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