From 99f47c20ec41279075d6b3ae64c9c1a84b40a6f8 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Mon, 3 May 2021 14:11:08 +0200 Subject: [PATCH 1/3] gen_context: Don't use external ASM because it complicates the build Fixes #931. --- src/gen_context.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gen_context.c b/src/gen_context.c index 024c55726..0fb361fb9 100644 --- a/src/gen_context.c +++ b/src/gen_context.c @@ -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" From 2161f31785e66e4e46471208610b5e3e98331849 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Mon, 3 May 2021 13:05:33 +0200 Subject: [PATCH 2/3] Makefile.am: Honor config when building gen_context This passes $(DEFS) (which should literally be "-DHAVE_CONFIG_H") to the compiler when building gen_context. This has currently no effect because gen_context.c does not check for this macro but it's conceivable that it may do so in the future. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 053e435fb..a0d78f90c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 $@ From c8483520c9077905a1dc8b9adb88b6ea2a3bd9ef Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Mon, 3 May 2021 14:11:38 +0200 Subject: [PATCH 3/3] Makefile.am: Don't pass a variable twice --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index a0d78f90c..23b29281d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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