Bitcoin fails to build on OpenBSD 6.5 #15951

issue grim-trigger openend this issue on May 4, 2019
  1. grim-trigger commented at 11:24 am on May 4, 2019: contributor

    Bitcoin fails to build on OpenBSD 6.5 amd64.

    This bug appears to have been introduced in 2c35fe6

    gmake exits with the following error:

     0  CXX      util/libbitcoin_util_a-threadnames.o
     1util/threadnames.cpp:26:5: error: use of undeclared identifier
     2      'pthread_set_name_np'
     3    pthread_set_name_np(pthread_self(), name);
     4    ^
     51 error generated.
     6gmake[2]: *** [Makefile:8653: util/libbitcoin_util_a-threadnames.o] Error 1
     7gmake[2]: Leaving directory '/home/bitcoin/bitcoin/src'
     8gmake[1]: *** [Makefile:13396: all-recursive] Error 1
     9gmake[1]: Leaving directory '/home/bitcoin/bitcoin/src'
    10gmake: *** [Makefile:775: all-recursive] Error 1
    11Making check in src
    12gmake[1]: Entering directory '/home/bitcoin/bitcoin/src'
    13gmake[2]: Entering directory '/home/bitcoin/bitcoin/src'
    14  CXX      util/libbitcoin_util_a-threadnames.o
    15util/threadnames.cpp:26:5: error: use of undeclared identifier
    16      'pthread_set_name_np'
    17    pthread_set_name_np(pthread_self(), name);
    18    ^
    191 error generated.
    20gmake[2]: *** [Makefile:8653: util/libbitcoin_util_a-threadnames.o] Error 1
    21gmake[2]: Leaving directory '/home/bitcoin/bitcoin/src'
    22gmake[1]: *** [Makefile:13396: check-recursive] Error 1
    23gmake[1]: Leaving directory '/home/bitcoin/bitcoin/src'
    24gmake: *** [Makefile:775: check-recursive] Error 1
    

    Configured using:

    0./configure --with-gui=qt5 CC=cc CXX=c++ \
    1    BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \
    2    BDB_CFLAGS="-I${BDB_PREFIX}/include" \
    3    LDFLAGS="-L${BDB_PREFIX}/lib -L/usr/X11R6/lib" \
    4    CPPFLAGS="-I${BDB_PREFIX}/include -I/usr/X11R6/include" \
    5    --disable-dependency-tracking
    
  2. fanquake added the label Linux/Unix on May 4, 2019
  3. fanquake commented at 11:26 am on May 4, 2019: member
  4. grim-trigger commented at 1:26 am on May 5, 2019: contributor

    It’s just some missing #includes.

    https://man.openbsd.org/pthread_set_name_np

    Here is a workaround diff for compiling on openbsd:

     0diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp
     1index 7b0d744ae..f7df267c6 100644
     2--- a/src/util/threadnames.cpp
     3+++ b/src/util/threadnames.cpp
     4@@ -9,6 +9,9 @@
     5 #include <atomic>
     6 #include <thread>
     7 
     8+#include <pthread.h>
     9+#include <pthread_np.h>
    10+
    11 #include <util/threadnames.h>
    12 
    13 #ifdef HAVE_SYS_PRCTL_H
    

    A subsequent gmake check passes all tests.

  5. practicalswift commented at 8:06 am on May 5, 2019: contributor
    Would the CirrusCI integration discussed in #15338 have caught this? Ping @MarcoFalke
  6. grim-trigger commented at 12:13 pm on May 5, 2019: contributor

    Yes, and if better tools are available, they should be used. See Reg. XII [1].

    [1] https://en.wikipedia.org/wiki/Rules_for_the_Direction_of_the_Mind

    XII: Finally we ought to employ all the help of understanding, imagination, sense and memory, first for the purpose of having a distinct intuition of simple propositions; partly also in order to compare the propositions

  7. MarcoFalke commented at 1:54 pm on May 6, 2019: member

    Yeah, it fails on the master branch in my repo:

    https://cirrus-ci.com/github/MarcoFalke/bitcoin/master

  8. MarcoFalke commented at 1:56 pm on May 6, 2019: member
    @grim-trigger Mind to create a pull request with your fix?
  9. practicalswift commented at 2:09 pm on May 6, 2019: contributor
    @MarcoFalke How has the CirrusCI experience been? Is it stable (in the sense that build failures reflect real issues), or is it build-roulette? :-)
  10. MarcoFalke commented at 2:33 pm on May 6, 2019: member
    There have been some timeouts or intermittent issues, but no real issues. Though, I am not sure if the regular devs that can respin travis can also respin cirrus ci. There is also some cost to having different solutions with different permission setups.
  11. grim-trigger referenced this in commit 1b05dff080 on May 7, 2019
  12. laanwj referenced this in commit 47ec8318a6 on May 16, 2019
  13. fanquake commented at 12:35 pm on May 16, 2019: member
    Fixed in #15968.
  14. fanquake closed this on May 16, 2019

  15. sidhujag referenced this in commit c78ed7fe76 on May 18, 2019
  16. HashUnlimited referenced this in commit 0fa94936cb on Aug 30, 2019
  17. barrystyle referenced this in commit bffe8b4ecf on Nov 11, 2019
  18. ftrader referenced this in commit 00c47844fb on Dec 1, 2020
  19. linuxsh2 referenced this in commit 13b0efe1bd on Aug 11, 2021
  20. DrahtBot locked this on Dec 16, 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-21 15:12 UTC

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