-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue compiling on OpenBSD 6.7 #768
Comments
Okay, I believe that's really just a bug. The problem is that all of this is a little bit hacky (because autoconf is a huge hack for the C mess and is hacky by itself) and annoying. I just don't see why this issue didn't appear in earlier revisions. So we call The definition is imported here then: So I believe the simple way to fix this is to add |
Sure. I assume you meant diff --git a/src/basic-config.h b/src/basic-config.h
index e9be39d..3ad77c2 100644
--- a/src/basic-config.h
+++ b/src/basic-config.h
@@ -9,6 +9,7 @@
#ifdef USE_BASIC_CONFIG
+#undef HAVE___INT128
#undef USE_ASM_X86_64
#undef USE_ECMULT_STATIC_PRECOMPUTATION
#undef USE_ENDOMORPHISM ./autogen.sh
./configure CC=cc MAKE=gmake
....
Build Options:
with endomorphism = no
with ecmult precomp = yes
with external callbacks = no
with benchmarks = yes
with coverage = no
module ecdh = no
module recovery = no
asm = x86_64
bignum = no
field = 64bit
scalar = 64bit
ecmult window size = 15
ecmult gen prec. bits = 4
valgrind = no
CC = cc
CFLAGS = -O2 -fvisibility=hidden -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -g
CPPFLAGS =
LDFLAGS =
...
gmake check -j6
...
PASS: exhaustive_tests
PASS: tests Everything seems to be working ok. |
Ok, thanks, this PR should fix it then. We could also let the autoconf script to do the following
It's somewhat surprising that GCC is used when you set CC to clang. We could also just note this in the "Build steps" section in the README. |
Great. Thanks for the quick followup and fix. |
This commits simply uses CC as CC_FOR_BUILD and the same for corresponding flags if we're not cross-compiling. This has a number of benefits in this common case: - It avoids strange cases where very old compilers are used (bitcoin-core#768). - Flags are consistently set for CC and CC_FOR_BUILD. - ./configure is faster. - You get compiler x consistently if you set CC=x; we got this wrong in CI in the past. ./configure warns if a _FOR_BUILD variable is set but ignored because we're not cross-compiling. The change exposed that //-style comments are used in gen_context.c, which is also fixed by this commit. This commit also reorganizes code in configure.ac to have a cleaner separation of sections.
This commits simply uses CC as CC_FOR_BUILD and the same for corresponding flags if we're not cross-compiling. This has a number of benefits in this common case: - It avoids strange cases where very old compilers are used (bitcoin-core#768). - Flags are consistently set for CC and CC_FOR_BUILD. - ./configure is faster. - You get compiler x consistently if you set CC=x; we got this wrong in CI in the past. ./configure warns if a _FOR_BUILD variable is set but ignored because we're not cross-compiling. The change exposed that //-style comments are used in gen_context.c, which is also fixed by this commit. This commit also reorganizes code in configure.ac to have a cleaner separation of sections.
This commits simply uses CC as CC_FOR_BUILD and the same for corresponding flags if we're not cross-compiling. This has a number of benefits in this common case: - It avoids strange cases where very old compilers are used (bitcoin-core#768). - Flags are consistently set for CC and CC_FOR_BUILD. - ./configure is faster. - You get compiler x consistently if you set CC=x; we got this wrong in CI in the past. ./configure warns if a _FOR_BUILD variable is set but ignored because we're not cross-compiling. The change exposed that //-style comments are used in gen_context.c, which is also fixed by this commit. This commit also reorganizes code in configure.ac to have a cleaner separation of sections.
Since the secp256k1 subtree update in bitcoin/bitcoin#19228, it hasn't been possible to cleanly compile Bitcoin Core on OpenBSD. Building fails with (excerpt from just building libsecp,
cc
is Clang 8.0.1):libsecp does some native compiler detection in configure, and then uses that compiler specifically for the ecmult precomputation. i.e:
secp256k1/configure.ac
Lines 186 to 188 in 3f4a5a1
and then:
secp256k1/Makefile.am
Lines 129 to 130 in 3f4a5a1
The problem is that this ends up picking up and using OpenBSDs GCC 4.2.1, which barfs when it gets to util.h:
secp256k1/src/util.h
Line 179 in 3f4a5a1
I realise there might not be much that can be done here, given that it's the
AX_PROG_CC_FOR_BUILD
macro that is returninggcc
to use. However thought I'd open an issue here for any thoughts, before we update our docs. I've suggested that affected users can just passCC_FOR_BUILD=cc
to configure when building. Issue here: bitcoin/bitcoin#19559.The text was updated successfully, but these errors were encountered: