Skip to content

Commit 3937cef

Browse files
committed
Merge #249: Upstream PRs 1160, 1193, 1169, 1190, 1192, 1194, 1196, 1195, 1170, 1172, 1200, 1199, 1203, 1201, 1206, 1078, 1209, 979, 1212, 1218, 1217, 1221, 1222
5d8f53e Remove redudent checks. (Russell O'Connor) d232112 Update Changelog (Tim Ruffing) b081f7e Add secp256k1_fe_add_int function (Pieter Wuille) 2ef1c9b Update overflow check (Russell O'Connor) 5660c13 prevent optimization in algorithms (Harshil Jani) ce3cfc7 doc: Describe Jacobi calculation in safegcd_implementation.md (Elliott Jin) 6be0103 Add secp256k1_fe_is_square_var function (Pieter Wuille) 1de2a01 Native jacobi symbol algorithm (Pieter Wuille) 04c6c1b Make secp256k1_modinv64_det_check_pow2 support abs val (Pieter Wuille) 5fffb2c Make secp256k1_i128_check_pow2 support -(2^n) (Pieter Wuille) e433034 ci: Shutdown wineserver whenever CI script exits (Tim Ruffing) 9a5a611 build: Suppress stupid MSVC linker warning (Tim Ruffing) 739c53b examples: Extend sig examples by call that uses static context (Tim Ruffing) 914276e build: Add SECP256K1_API_VAR to fix importing variables from DLLs (Tim Ruffing) e089eec group: Further simply gej_add_ge (Tim Ruffing) ac71020 group: Save a normalize_to_zero in gej_add_ge (Tim Ruffing) 8c7e0fc build: Add -Wreserved-identifier supported by clang (Tim Ruffing) 9b60e31 ci: Do not set git's `user.{email,name}` config options (Hennadii Stepanov) ef39721 Do not link `bench` and `ctime_tests` to `COMMON_LIB` (Hennadii Stepanov) c241586 ci: Don't fetch git history (Tim Ruffing) 0ecf318 ci: Use remote pull/merge ref instead of local git merge (Tim Ruffing) 9b7d186 Drop no longer used Autoheader macros (Hennadii Stepanov) eb6beba scalar: restrict split_lambda args, improve doc and VERIFY_CHECKs (Jonas Nick) 7f49aa7 ci: add test job with -DVERIFY (Jonas Nick) 620ba3d benchmarks: fix bench_scalar_split (Jonas Nick) e39d954 tests: Add CHECK_ILLEGAL(_VOID) macros and use in static ctx tests (Tim Ruffing) 61841fc contexts: Forbid randomizing secp256k1_context_static (Tim Ruffing) 4b6df5e contexts: Forbid cloning/destroying secp256k1_context_static (Tim Ruffing) 8f51229 ctime_tests: improve output when CHECKMEM_RUNNING is not defined (Jonas Nick) 2cd4e3c Drop no longer used `SECP_{LIBS,INCLUDE}` variables (Hennadii Stepanov) 613626f Drop no longer used `SECP_TEST_{LIBS,INCLUDE}` variables (Hennadii Stepanov) d6ff738 Ensure safety of ctz_debruijn implementation. (Russell O'Connor) ce60785 Introduce SECP256K1_B macro for curve b coefficient (Pieter Wuille) 4934aa7 Switch to exhaustive groups with small B coefficient (Pieter Wuille) e03ef86 Make all non-API functions (except main) static (Pieter Wuille) 0f088ec Rename CTIMETEST -> CTIMETESTS (Pieter Wuille) 74b026f Add runtime checking for DECLASSIFY flag (Pieter Wuille) 5e2e6fc Run ctime test in Linux MSan CI job (Pieter Wuille) 1897406 Make ctime tests building configurable (Pieter Wuille) 5048be1 Rename valgrind_ctime_test -> ctime_tests (Pieter Wuille) 6eed6c1 Update error messages to suggest msan as well (Pieter Wuille) 8e11f89 Add support for msan integration to checkmem.h (Pieter Wuille) 8dc6407 Add compile-time error to valgrind_ctime_test (Pieter Wuille) 0db05a7 Abstract interactions with valgrind behind new checkmem.h (Pieter Wuille) 4f1a54e Move valgrind CPPFLAGS into SECP_CONFIG_DEFINES (Pieter Wuille) d4a6b58 Add `noverify_tests` to `.gitignore` (Hennadii Stepanov) e862c4a Makefile: add -I$(top_srcdir)/src to CPPFLAGS for precomputed (Matt Whitlock) Pull request description: ACKs for top commit: real-or-random: tACK 0d540ec Tree-SHA512: bc54ccf752163ab6e1a12bb8c4e1f9339f4421d2e4f7716c408549514b3c902f2e9f727655799f1eecb085b0026761b04735b17be3c95c6cf54e07fbf7e86477
2 parents 897c765 + 0d540ec commit 3937cef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1695
-825
lines changed

.cirrus.yml

+21-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
env:
2+
### cirrus config
3+
CIRRUS_CLONE_DEPTH: 1
24
### compiler options
35
HOST:
46
WRAPPER_CMD:
@@ -30,7 +32,7 @@ env:
3032
SECP256K1_TEST_ITERS:
3133
BENCH: yes
3234
SECP256K1_BENCH_ITERS: 2
33-
CTIMETEST: yes
35+
CTIMETESTS: yes
3436
# Compile and run the tests
3537
EXAMPLES: yes
3638

@@ -47,8 +49,8 @@ cat_logs_snippet: &CAT_LOGS
4749
- cat noverify_tests.log || true
4850
cat_exhaustive_tests_log_script:
4951
- cat exhaustive_tests.log || true
50-
cat_valgrind_ctime_test_log_script:
51-
- cat valgrind_ctime_test.log || true
52+
cat_ctime_tests_log_script:
53+
- cat ctime_tests.log || true
5254
cat_bench_log_script:
5355
- cat bench.log || true
5456
cat_config_log_script:
@@ -61,10 +63,8 @@ cat_logs_snippet: &CAT_LOGS
6163
merge_base_script_snippet: &MERGE_BASE
6264
merge_base_script:
6365
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
64-
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
65-
- git config --global user.email "[email protected]"
66-
- git config --global user.name "ci"
67-
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
66+
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
67+
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
6868

6969
linux_container_snippet: &LINUX_CONTAINER
7070
container:
@@ -88,9 +88,10 @@ task:
8888
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes, EXPERIMENTAL: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes, BPPP: yes}
8989
- env: {WIDEMUL: int128, ASM: x86_64}
9090
- env: { RECOVERY: yes, SCHNORRSIG: yes, EXPERIMENTAL: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes, BPPP: yes}
91-
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
91+
- env: {CTIMETESTS: no, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, EXPERIMENTAL: yes, ECDSA_S2C: yes, RANGEPROOF: yes, WHITELIST: yes, GENERATOR: yes, MUSIG: yes, ECDSAADAPTOR: yes, BPPP: yes, CPPFLAGS: -DVERIFY}
92+
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH: no}
9293
- env: {CPPFLAGS: -DDETERMINISTIC}
93-
- env: {CFLAGS: -O0, CTIMETEST: no}
94+
- env: {CFLAGS: -O0, CTIMETESTS: no}
9495
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
9596
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
9697
matrix:
@@ -145,7 +146,7 @@ task:
145146
env:
146147
ASM: no
147148
WITH_VALGRIND: no
148-
CTIMETEST: no
149+
CTIMETESTS: no
149150
matrix:
150151
- env:
151152
CC: gcc
@@ -178,7 +179,7 @@ task:
178179
MUSIG: yes
179180
ECDSAADAPTOR: yes
180181
BPPP: yes
181-
CTIMETEST: no
182+
CTIMETESTS: no
182183
<< : *MERGE_BASE
183184
test_script:
184185
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
@@ -197,7 +198,7 @@ task:
197198
ECDH: yes
198199
RECOVERY: yes
199200
SCHNORRSIG: yes
200-
CTIMETEST: no
201+
CTIMETESTS: no
201202
matrix:
202203
- env: {}
203204
- env: {EXPERIMENTAL: yes, ASM: arm}
@@ -217,7 +218,7 @@ task:
217218
ECDH: yes
218219
RECOVERY: yes
219220
SCHNORRSIG: yes
220-
CTIMETEST: no
221+
CTIMETESTS: no
221222
<< : *MERGE_BASE
222223
test_script:
223224
- ./ci/cirrus.sh
@@ -234,7 +235,7 @@ task:
234235
ECDH: yes
235236
RECOVERY: yes
236237
SCHNORRSIG: yes
237-
CTIMETEST: no
238+
CTIMETESTS: no
238239
<< : *MERGE_BASE
239240
test_script:
240241
- ./ci/cirrus.sh
@@ -248,7 +249,7 @@ task:
248249
ECDH: yes
249250
RECOVERY: yes
250251
SCHNORRSIG: yes
251-
CTIMETEST: no
252+
CTIMETESTS: no
252253
matrix:
253254
- name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
254255
env:
@@ -278,7 +279,7 @@ task:
278279
MUSIG: yes
279280
ECDSAADAPTOR: yes
280281
BPPP: yes
281-
CTIMETEST: no
282+
CTIMETESTS: no
282283
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
283284
# This will detect some MinGW-w64 tools but then make will need only
284285
# the MSVC tools CC, AR and NM as specified below.
@@ -289,7 +290,7 @@ task:
289290
# Set non-essential options that affect the CLI messages here.
290291
# (They depend on the user's taste, so we don't want to set them automatically in configure.ac.)
291292
CFLAGS: -nologo -diagnostics:caret
292-
LDFLAGS: -XCClinker -nologo -XCClinker -diagnostics:caret
293+
LDFLAGS: -Xlinker -Xlinker -Xlinker -nologo
293294
matrix:
294295
- name: "x86_64 (MSVC): Windows (Debian stable, Wine)"
295296
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct)"
@@ -326,7 +327,7 @@ task:
326327
MUSIG: yes
327328
ECDSAADAPTOR: yes
328329
BPPP: yes
329-
CTIMETEST: no
330+
CTIMETESTS: no
330331
matrix:
331332
- name: "Valgrind (memcheck)"
332333
container:
@@ -379,10 +380,11 @@ task:
379380
MUSIG: yes
380381
ECDSAADAPTOR: yes
381382
BPPP: yes
382-
CTIMETEST: no
383+
CTIMETESTS: yes
383384
CC: clang
384385
SECP256K1_TEST_ITERS: 32
385386
ASM: no
387+
WITH_VALGRIND: no
386388
container:
387389
memory: 2G
388390
matrix:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ bench_generator
55
bench_rangeproof
66
bench_internal
77
bench_whitelist
8+
noverify_tests
89
tests
910
example_musig
1011
exhaustive_tests
1112
precompute_ecmult_gen
1213
precompute_ecmult
13-
valgrind_ctime_test
14+
ctime_tests
1415
ecdh_example
1516
ecdsa_example
1617
schnorr_example

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
## [Unreleased]
1212

13+
#### Added
14+
- Usage examples: Added a recommended method for securely clearing sensitive data, e.g., secret keys, from memory.
15+
- Tests: Added a new test binary `noverify_tests`. This binary runs the tests without some additional checks present in the ordinary `tests` binary and is thereby closer to production binaries. The `noverify_tests` binary is automatically run as part of the `make check` target.
16+
17+
#### Fixed
18+
- Fixed declarations of API variables for MSVC (`__declspec(dllimport)`). This fixes MSVC builds of programs which link against a libsecp256k1 DLL dynamically and use API variables (and not only API functions). Unfortunately, the MSVC linker now will emit warning `LNK4217` when trying to link against libsecp256k1 statically. Pass `/ignore:4217` to the linker to suppress this warning.
19+
20+
#### Changed
21+
- Forbade cloning or destroying `secp256k1_context_static`. Create a new context instead of cloning the static context. (If this change breaks your code, your code is probably wrong.)
22+
- Forbade randomizing (copies of) `secp256k1_context_static`. Randomizing a copy of `secp256k1_context_static` did not have any effect and did not provide defense-in-depth protection against side-channel attacks. Create a new context if you want to benefit from randomization.
23+
24+
#### Removed
25+
- Removed the configuration header `src/libsecp256k1-config.h`. We recommend passing flags to `./configure` to set configuration options (see `./configure --help`). If you cannot or do not want to use `./configure`, pass configuration flags such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG` manually to the compiler (see the file `configure.ac` for supported flags).
26+
1327
## [0.2.0] - 2022-12-12
1428

1529
#### Added

Makefile.am

+27-27
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ noinst_HEADERS += src/modinv64_impl.h
4949
noinst_HEADERS += src/precomputed_ecmult.h
5050
noinst_HEADERS += src/precomputed_ecmult_gen.h
5151
noinst_HEADERS += src/assumptions.h
52+
noinst_HEADERS += src/checkmem.h
5253
noinst_HEADERS += src/util.h
5354
noinst_HEADERS += src/int128.h
5455
noinst_HEADERS += src/int128_impl.h
@@ -70,12 +71,14 @@ noinst_HEADERS += contrib/lax_der_parsing.h
7071
noinst_HEADERS += contrib/lax_der_parsing.c
7172
noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
7273
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
73-
noinst_HEADERS += examples/random.h
74+
noinst_HEADERS += examples/examples_util.h
7475

7576
PRECOMPUTED_LIB = libsecp256k1_precomputed.la
7677
noinst_LTLIBRARIES = $(PRECOMPUTED_LIB)
7778
libsecp256k1_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
78-
libsecp256k1_precomputed_la_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
79+
# We need `-I$(top_srcdir)/src` in VPATH builds if libsecp256k1_precomputed_la_SOURCES have been recreated in the build tree.
80+
# This helps users and packagers who insist on recreating the precomputed files (e.g., Gentoo).
81+
libsecp256k1_precomputed_la_CPPFLAGS = -I$(top_srcdir)/src $(SECP_CONFIG_DEFINES)
7982

8083
if USE_EXTERNAL_ASM
8184
COMMON_LIB = libsecp256k1_common.la
@@ -94,42 +97,32 @@ endif
9497
endif
9598

9699
libsecp256k1_la_SOURCES = src/secp256k1.c
97-
libsecp256k1_la_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
98-
libsecp256k1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
100+
libsecp256k1_la_CPPFLAGS = $(SECP_CONFIG_DEFINES)
101+
libsecp256k1_la_LIBADD = $(COMMON_LIB) $(PRECOMPUTED_LIB)
99102
libsecp256k1_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
100103

101-
if VALGRIND_ENABLED
102-
libsecp256k1_la_CPPFLAGS += -DVALGRIND
103-
endif
104-
105104
noinst_PROGRAMS =
106105
if USE_BENCHMARK
107106
noinst_PROGRAMS += bench bench_internal bench_ecmult
108107
bench_SOURCES = src/bench.c
109-
bench_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
108+
bench_LDADD = libsecp256k1.la
110109
bench_CPPFLAGS = $(SECP_CONFIG_DEFINES)
111110
bench_internal_SOURCES = src/bench_internal.c
112-
bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
113-
bench_internal_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
111+
bench_internal_LDADD = $(COMMON_LIB) $(PRECOMPUTED_LIB)
112+
bench_internal_CPPFLAGS = $(SECP_CONFIG_DEFINES)
114113
bench_ecmult_SOURCES = src/bench_ecmult.c
115-
bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
116-
bench_ecmult_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
114+
bench_ecmult_LDADD = $(COMMON_LIB) $(PRECOMPUTED_LIB)
115+
bench_ecmult_CPPFLAGS = $(SECP_CONFIG_DEFINES)
117116
endif
118117

119118
TESTS =
120119
if USE_TESTS
121120
TESTS += noverify_tests
122121
noinst_PROGRAMS += noverify_tests
123122
noverify_tests_SOURCES = src/tests.c
124-
noverify_tests_CPPFLAGS = $(SECP_INCLUDES) $(SECP_TEST_INCLUDES) $(SECP_CONFIG_DEFINES)
125-
noverify_tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
123+
noverify_tests_CPPFLAGS = $(SECP_CONFIG_DEFINES)
124+
noverify_tests_LDADD = $(COMMON_LIB) $(PRECOMPUTED_LIB)
126125
noverify_tests_LDFLAGS = -static
127-
if VALGRIND_ENABLED
128-
noverify_tests_CPPFLAGS += -DVALGRIND
129-
noinst_PROGRAMS += valgrind_ctime_test
130-
valgrind_ctime_test_SOURCES = src/valgrind_ctime_test.c
131-
valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB)
132-
endif
133126
if !ENABLE_COVERAGE
134127
TESTS += tests
135128
noinst_PROGRAMS += tests
@@ -140,15 +133,22 @@ tests_LDFLAGS = $(noverify_tests_LDFLAGS)
140133
endif
141134
endif
142135

136+
if USE_CTIME_TESTS
137+
noinst_PROGRAMS += ctime_tests
138+
ctime_tests_SOURCES = src/ctime_tests.c
139+
ctime_tests_LDADD = libsecp256k1.la
140+
ctime_tests_CPPFLAGS = $(SECP_CONFIG_DEFINES)
141+
endif
142+
143143
if USE_EXHAUSTIVE_TESTS
144144
noinst_PROGRAMS += exhaustive_tests
145145
exhaustive_tests_SOURCES = src/tests_exhaustive.c
146-
exhaustive_tests_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
146+
exhaustive_tests_CPPFLAGS = $(SECP_CONFIG_DEFINES)
147147
if !ENABLE_COVERAGE
148148
exhaustive_tests_CPPFLAGS += -DVERIFY
149149
endif
150150
# Note: do not include $(PRECOMPUTED_LIB) in exhaustive_tests (it uses runtime-generated tables).
151-
exhaustive_tests_LDADD = $(SECP_LIBS) $(COMMON_LIB)
151+
exhaustive_tests_LDADD = $(COMMON_LIB)
152152
exhaustive_tests_LDFLAGS = -static
153153
TESTS += exhaustive_tests
154154
endif
@@ -203,12 +203,12 @@ EXTRA_PROGRAMS = precompute_ecmult precompute_ecmult_gen
203203
CLEANFILES = $(EXTRA_PROGRAMS)
204204

205205
precompute_ecmult_SOURCES = src/precompute_ecmult.c
206-
precompute_ecmult_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
207-
precompute_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB)
206+
precompute_ecmult_CPPFLAGS = $(SECP_CONFIG_DEFINES)
207+
precompute_ecmult_LDADD = $(COMMON_LIB)
208208

209209
precompute_ecmult_gen_SOURCES = src/precompute_ecmult_gen.c
210-
precompute_ecmult_gen_CPPFLAGS = $(SECP_INCLUDES) $(SECP_CONFIG_DEFINES)
211-
precompute_ecmult_gen_LDADD = $(SECP_LIBS) $(COMMON_LIB)
210+
precompute_ecmult_gen_CPPFLAGS = $(SECP_CONFIG_DEFINES)
211+
precompute_ecmult_gen_LDADD = $(COMMON_LIB)
212212

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

ci/cirrus.sh

+17-12
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ print_environment() {
1414
ECMULTWINDOW ECMULTGENPRECISION ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
1515
EXPERIMENTAL ECDH RECOVERY SCHNORRSIG \
1616
ECDSA_S2C GENERATOR RANGEPROOF WHITELIST MUSIG ECDSAADAPTOR BPPP \
17-
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETEST\
17+
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
1818
EXAMPLES \
1919
HOST WRAPPER_CMD \
2020
CC CFLAGS CPPFLAGS AR NM
@@ -35,6 +35,8 @@ print_environment
3535
# This speeds up jobs with many invocations of wine (e.g., ./configure with MSVC) tremendously.
3636
case "$WRAPPER_CMD" in
3737
*wine*)
38+
# Make sure to shutdown wineserver whenever we exit.
39+
trap "wineserver -k || true" EXIT INT HUP
3840
# This is apparently only reliable when we run a dummy command such as "hh.exe" afterwards.
3941
wineserver -p && wine hh.exe
4042
;;
@@ -67,6 +69,7 @@ fi
6769
--enable-module-schnorrsig="$SCHNORRSIG" --enable-module-musig="$MUSIG" --enable-module-ecdsa-adaptor="$ECDSAADAPTOR" \
6870
--enable-module-schnorrsig="$SCHNORRSIG" \
6971
--enable-examples="$EXAMPLES" \
72+
--enable-ctime-tests="$CTIMETESTS" \
7073
--with-valgrind="$WITH_VALGRIND" \
7174
--host="$HOST" $EXTRAFLAGS
7275

@@ -83,14 +86,15 @@ export LOG_COMPILER="$WRAPPER_CMD"
8386

8487
make "$BUILD"
8588

89+
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
90+
EXEC='./libtool --mode=execute'
91+
if [ -n "$WRAPPER_CMD" ]
92+
then
93+
EXEC="$EXEC $WRAPPER_CMD"
94+
fi
95+
8696
if [ "$BENCH" = "yes" ]
8797
then
88-
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
89-
EXEC='./libtool --mode=execute'
90-
if [ -n "$WRAPPER_CMD" ]
91-
then
92-
EXEC="$EXEC $WRAPPER_CMD"
93-
fi
9498
{
9599
$EXEC ./bench_ecmult
96100
$EXEC ./bench_internal
@@ -102,9 +106,13 @@ then
102106
} >> bench.log 2>&1
103107
fi
104108

105-
if [ "$CTIMETEST" = "yes" ]
109+
if [ "$CTIMETESTS" = "yes" ]
106110
then
107-
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
111+
if [ "$WITH_VALGRIND" = "yes" ]; then
112+
./libtool --mode=execute valgrind --error-exitcode=42 ./ctime_tests > ctime_tests.log 2>&1
113+
else
114+
$EXEC ./ctime_tests > ctime_tests.log 2>&1
115+
fi
108116
fi
109117

110118
# Rebuild precomputed files (if not cross-compiling).
@@ -114,9 +122,6 @@ then
114122
make precomp
115123
fi
116124

117-
# Shutdown wineserver again
118-
wineserver -k || true
119-
120125
# Check that no repo files have been modified by the build.
121126
# (This fails for example if the precomp files need to be updated in the repo.)
122127
git diff --exit-code

0 commit comments

Comments
 (0)