Skip to content

Commit 7dfcece

Browse files
build: Remove #undef hack for ASM in the precomputation programs
This was necessary because we used to cross-compile the library but compile the precomputation programs for the build host. Now it's no longer necessary and we can cleanly link even the external ASM (which was the intent of #935). On the way, remove an obsolete "-I" parameter.
1 parent bb36fe9 commit 7dfcece

3 files changed

+7
-13
lines changed

Makefile.am

+7-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ endif
119119
if USE_EXHAUSTIVE_TESTS
120120
noinst_PROGRAMS += exhaustive_tests
121121
exhaustive_tests_SOURCES = src/tests_exhaustive.c
122-
exhaustive_tests_CPPFLAGS = -I$(top_srcdir)/src $(SECP_INCLUDES)
122+
exhaustive_tests_CPPFLAGS = $(SECP_INCLUDES)
123123
if !ENABLE_COVERAGE
124124
exhaustive_tests_CPPFLAGS += -DVERIFY
125125
endif
@@ -131,8 +131,14 @@ endif
131131
### Precomputed tables
132132
EXTRA_PROGRAMS = gen_ecmult_static_pre_g gen_ecmult_gen_static_prec_table
133133
CLEANFILES = $(EXTRA_PROGRAMS)
134+
134135
gen_ecmult_static_pre_g_SOURCES = src/gen_ecmult_static_pre_g.c
136+
gen_ecmult_static_pre_g_CPPFLAGS = $(SECP_INCLUDES)
137+
gen_ecmult_static_pre_g_LDADD = $(SECP_LIBS) $(COMMON_LIB)
138+
135139
gen_ecmult_gen_static_prec_table_SOURCES = src/gen_ecmult_gen_static_prec_table.c
140+
gen_ecmult_gen_static_prec_table_CPPFLAGS = $(SECP_INCLUDES)
141+
gen_ecmult_gen_static_prec_table_LDADD = $(SECP_LIBS) $(COMMON_LIB)
136142

137143
# See Automake manual, Section "Errors with distclean".
138144
# We don't list any dependencies for the prebuilt files here because

src/gen_ecmult_gen_static_prec_table.c

-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
#include <inttypes.h>
88
#include <stdio.h>
99

10-
/* In principle we could use ASM, but this yields only a minor speedup in
11-
build time and it's very complicated. In particular when cross-compiling, we'd
12-
need to build the ASM for the build and the host machine. */
13-
#undef USE_EXTERNAL_ASM
14-
#undef USE_ASM_X86_64
15-
1610
#include "../include/secp256k1.h"
1711
#include "assumptions.h"
1812
#include "util.h"

src/gen_ecmult_static_pre_g.c

-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
#include "libsecp256k1-config.h"
1414
#endif
1515

16-
/* In principle we could use ASM, but this yields only a minor speedup in
17-
build time and it's very complicated. In particular when cross-compiling, we'd
18-
need to build the ASM for the build and the host machine. */
19-
#undef USE_EXTERNAL_ASM
20-
#undef USE_ASM_X86_64
21-
2216
#include "../include/secp256k1.h"
2317
#include "assumptions.h"
2418
#include "util.h"

0 commit comments

Comments
 (0)