Skip to content

Commit

Permalink
Merge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM
Browse files Browse the repository at this point in the history
c848352 Makefile.am: Don't pass a variable twice (Tim Ruffing)
2161f31 Makefile.am: Honor config when building gen_context (Tim Ruffing)
99f47c2 gen_context: Don't use external ASM because it complicates the build (Tim Ruffing)

Pull request description:

  Obsoletes #935.

ACKs for top commit:
  gmaxwell:
    ACK c848352   looks good and works here. Undefign is kinda yuck, but it is already doing it and it's cleaner than the obvious alternatives.
  sipa:
    utACK c848352. I verified that building still works on ARM64, but without asm of course.

Tree-SHA512: fc5500688b2aecc4238e21c32f65559bcbfd1e83d1ae4d2c8e15573e94613667731064d8b5f2b9e4209016d88118263802ff4b9a73c1f37c224ccf2a4a1d6536
  • Loading branch information
sipa committed May 4, 2021
2 parents 98e0358 + c848352 commit d0bd269
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if VALGRIND_ENABLED
tests_CPPFLAGS += -DVALGRIND
noinst_PROGRAMS += valgrind_ctime_test
valgrind_ctime_test_SOURCES = src/valgrind_ctime_test.c
valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_LIBS) $(COMMON_LIB)
valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB)
endif
if !ENABLE_COVERAGE
tests_CPPFLAGS += -DVERIFY
Expand Down Expand Up @@ -129,7 +129,7 @@ CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) -I$(builddir)/src
gen_context_OBJECTS = gen_context.o
gen_context_BIN = gen_context$(BUILD_EXEEXT)
gen_%.o: src/gen_%.c src/libsecp256k1-config.h
$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
$(CC_FOR_BUILD) $(DEFS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@

$(gen_context_BIN): $(gen_context_OBJECTS)
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@
Expand Down
5 changes: 5 additions & 0 deletions src/gen_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
/* We can't require the precomputed tables when creating them. */
#undef USE_ECMULT_STATIC_PRECOMPUTATION

/* In principle we could use external ASM, but this yields only a minor speedup in
build time and it's very complicated. In particular when cross-compiling, we'd
need to build the external ASM for the build and the host machine. */
#undef USE_EXTERNAL_ASM

#include "include/secp256k1.h"
#include "assumptions.h"
#include "util.h"
Expand Down

0 comments on commit d0bd269

Please sign in to comment.