depends: OpenBSD (aarch64) needs gcc (instruction) for libevent #32691

issue Sjors openend this issue on June 6, 2025
  1. Sjors commented at 8:09 am on June 6, 2025: member

    Current behaviour

    The current depends instructions for OpenBSD do not mention gcc, which is required to build libevent.

    A simple pkg_add gcc doesn’t cut it either, because that only installs egcc: https://unix.stackexchange.com/questions/554752/no-gcc-executable-after-pkg-add-gcc-on-openbsd

    Expected behaviour

    Explain what the user needs to do to build depends (or change depends).

    A simple symlink seems to do the trick, but I’m not if it’s appropriate:

    0ln -s /usr/local/bin/egcc /usr/local/bin/gcc
    

    Steps to reproduce

    Fresh OpenBSD installation. Clone repo on master.

     0gmake -C depends NO_QT=1 NO_QR=1 NO_ZMQ=1 NO_USDT=1
     1
     2gmake: Entering directory '/home/sjors/src/bitcoin/depends'
     3Configuring libevent...
     4CMake Deprecation Warning at CMakeLists.txt:22 (cmake_minimum_required):
     5  Compatibility with CMake < 3.10 will be removed from a future version of
     6  CMake.
     7
     8  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
     9  to tell CMake that the project requires at least <min> but has been updated
    10  to work with policies introduced by <max> or earlier.
    11
    12
    13CMake Error at /usr/local/share/cmake/Modules/CMakeDetermineCCompiler.cmake:49 (message):
    14  Could not find compiler set in environment variable CC:
    15
    16  gcc.
    17Call Stack (most recent call first):
    18  CMakeLists.txt:47 (project)
    19
    20
    21CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    22-- Configuring incomplete, errors occurred!
    23gmake: *** [funcs.mk:343: /home/sjors/src/bitcoin/depends/aarch64-unknown-openbsd7.7/.libevent_stamp_configured] Error 1
    24gmake: Leaving directory '/home/sjors/src/bitcoin/depends'
    

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master

    Operating system and version

    OpenBSD 7.7

    Machine specifications

    VM inside UTM, host machine is M4 macOS 15.5

  2. hebasto commented at 8:19 am on June 6, 2025: member

    I’m not sure. The following seems working:

    0          prepare: pkg_add bash curl gmake gtar-- cmake git ccache python py3-zmq
    
  3. maflcko commented at 9:19 am on June 6, 2025: member

    I’m not sure. The following seems working:

    This was tested on x86:

    0to: /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/x86_64-unknown-openbsd7.7
    

    However this issue happens on aarch64:

    0gmake: *** [funcs.mk:343: /home/sjors/src/bitcoin/depends/aarch64-unknown-openbsd7.7
    

    Does UTM allow to spin up an x86_64 openbsd for testing?

  4. maflcko added the label Build system on Jun 6, 2025
  5. Sjors commented at 9:25 am on June 6, 2025: member

    @maflcko I can choose between Virtualize and Emulate, the latter being a bit slower, but might avoid this issue. I’ll try.

    Update: unfortunately the installer just ends up in a boot loop

  6. Sjors commented at 1:21 pm on June 6, 2025: member

    I tried again using a Hetzner VM running OpenBSD 7.7 amd64 (to install, just pick any distro, mount OpenBSD from their list of ISO images and reboot into the installer - get an IPv4 address unless you enjoy pain).

    gcc/g++ are not present by default, nor after pkg_add bash gmake gtar

    Initially the libevent installer fails because cmake isn’t installed (also missing from the instruction, but the error is clear enough so it shouldn’t confuse anyone).

    Once cmake is install the depends build succeeds, so it doesn’t seem to need gcc on this configuration.

  7. Sjors commented at 1:37 pm on June 6, 2025: member

    I spun up an equivalent aarch64 VM. I installed bash gmake gtar and cmake (and git to clone the repo). Ran into the same error as with UTM.

    So it seems to be an arm thing?

  8. Sjors renamed this:
    depends: OpenBSD needs gcc (instruction) for libevent
    depends: OpenBSD (aarch64) needs gcc (instruction) for libevent
    on Jun 6, 2025
  9. hebasto commented at 3:17 pm on June 6, 2025: member

    I spun up an equivalent aarch64 VM. I installed bash gmake gtar and cmake (and git to clone the repo). Ran into the same error as with UTM.

    So it seems to be an arm thing?

    Seems like a bug in CMake’s CMakeDetermineCCompiler module.

  10. hebasto commented at 3:22 pm on June 6, 2025: member

    @Sjors

    What are outputs of the printenv and which cc commands on your OpenBSD aarch64?

  11. Sjors commented at 3:27 pm on June 6, 2025: member
     0_=/usr/bin/printenv
     1LOGNAME=root
     2PWD=/root
     3HOME=/root
     4SSH_TTY=/dev/ttyp0
     5MAIL=/var/mail/root
     6SSH_CLIENT=******** 10013 22
     7PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
     8TERM=xterm-256color
     9SHELL=/bin/ksh
    10SSH_CONNECTION=*************
    11USER=root
    
    0which cc
    1/usr/bin/cc
    

    And for the regular user that I used for compiling:

     0_=/usr/bin/printenv
     1LOGNAME=sjors
     2PWD=/home/sjors
     3HOME=/home/sjors
     4SSH_TTY=/dev/ttyp0
     5MAIL=/var/mail/sjors
     6SSH_CLIENT=*************
     7PATH=/home/sjors/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
     8TERM=xterm-256color
     9SHELL=/bin/ksh
    10SSH_CONNECTION= ****************
    11USER=sjors
    
  12. hebasto commented at 3:35 pm on June 6, 2025: member

    @Sjors

    Could you please execute the following CMakeLists.txt on your machine:

    0cmake_minimum_required(VERSION 3.31)
    1project(openbsd_cc C)
    

    and submit a bug report to https://gitlab.kitware.com/cmake/cmake?

  13. Sjors commented at 3:58 pm on June 6, 2025: member
    0$ cmake -B build
    1-- The C compiler identification is Clang 16.0.6
    2-- Detecting C compiler ABI info
    3-- Detecting C compiler ABI info - done
    4-- Check for working C compiler: /usr/bin/cc - skipped
    5-- Detecting C compile features
    6-- Detecting C compile features - done
    7-- Configuring done (1.5s)
    8-- Generating done (0.0s)
    9-- Build files have been written to: /home/sjors/src/debug/build
    

    The output is identical to that on x86 machine, so I’m not sure what the bug is?

  14. hebasto commented at 5:01 pm on June 6, 2025: member

    This patch seems working.

    cc @theStack

  15. Sjors commented at 11:49 am on June 9, 2025: member

    @hebasto I cherry-picked your patch on top of master @ e2174378aa8a339c7be8b4e91311513ed520a16d and indeed libevent now builds fine.

    It also works on top of #32690 (I also ran the unit and functional test suite).

    Can you open a PR with it?

  16. hebasto commented at 2:03 pm on June 10, 2025: member

    Can you open a PR with it?

    Sure :)

    #32716.


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: 2025-06-15 06:13 UTC

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