build: cannot compile on OpenBSD since libsecp256k1 subtree update #19559

issue fanquake openend this issue on July 20, 2020
  1. fanquake commented at 1:16 pm on July 20, 2020: member

    Since the secp256k1 subtree update in #19228 (8c97780db8c9dd33efed134385573ba97e9cd165), it hasn’t been possible to compile on OpenBSD. Building fails with (cc is Clang 8.0.1):

    0./autogen.sh
    1./configure --disable-wallet --with-gui=no CC=cc CXX=c++ MAKE=gmake
    2gmake -j6 V=1
    3...
    4gmake[3]: Entering directory '/home/vagrant/bitcoin/src/secp256k1'
    5gcc -I. -I./src -Wall -Wextra -Wno-unused-function -g -O2 -c src/gen_context.c -o gen_context.o
    6In file included from src/gen_context.c:16:
    7src/util.h:179: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'uint128_t'
    8gmake[3]: *** [Makefile:1689: gen_context.o] Error 1
    9gmake[3]: Leaving directory '/home/vagrant/bitcoin/src/secp256k1'
    

    The issue is that libsecp does some native compiler detection in configure, and then uses that compiler specifically for the ecmult precomputation. See here, (the call settings CC_FOR_BUILD is earlier): https://github.com/bitcoin/bitcoin/blob/476436b2dec254bb988f8c7a6cbec1d7bb7cecfd/src/secp256k1/configure.ac#L186-L188 and then here where it’s used: https://github.com/bitcoin/bitcoin/blob/476436b2dec254bb988f8c7a6cbec1d7bb7cecfd/src/secp256k1/Makefile.am#L129-L130

    The problem is that this ends up picking up and using OpenBSDs ancient GCC 4.2.1, which barfs when it gets to util.h: https://github.com/bitcoin/bitcoin/blob/476436b2dec254bb988f8c7a6cbec1d7bb7cecfd/src/secp256k1/src/util.h#L179

    If anyone does happen to run into this issue, the immediate workaround is to just pass CC_FOR_BUILD to configure, i.e: ./configure --disable-wallet --with-gui=no CC=cc CXX=c++ MAKE=gmake CC_FOR_BUILD=cc.

    However before we update any docs etc, I’m going to take the issue upstream.

  2. fanquake added the label Build system on Jul 20, 2020
  3. fanquake added the label Upstream on Jul 20, 2020
  4. fanquake referenced this in commit 01cd24c226 on Jul 28, 2020
  5. fanquake closed this on Aug 10, 2020

  6. fanquake referenced this in commit 6d5a9fec2d on Aug 10, 2020
  7. sidhujag referenced this in commit d61eebb471 on Aug 10, 2020
  8. DrahtBot locked this on Feb 15, 2022
  9. lyricidal referenced this in commit 640f5a2369 on Mar 24, 2023

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-12-21 15:12 UTC

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