secp256k1
secp256k1 copied to clipboard
Tracking issue for manual (non-autotools) builds
The current method to build a static library manually (using default options) is:
gcc -O2 -c src/secp256k1.c src/precomputed_*.c
ar rcs libsecp256k1.a secp256k1.o precomputed_*.o
(clang
also works)
The goal is to get rid of most of the command line arguments, at least on GCC and clang:
- [x]
-DSECP256K1_BUILD
: #928 - [x]
-I
#925 - [x]
-D ECMULT_GEN_PREC_BITS=4 -D ECMULT_WINDOW_SIZE=15
: See discussion in #918. We could even print the config using#pragma message
) - [ ]
-D DUSE_EXTERNAL_ASM
: https://github.com/bitcoin-core/secp256k1/issues/929#issuecomment-830982926 - [ ]
-Wno-unused-function
: We could add a#pragma
or better add__attribute__ ((unsused))
to the relevant functions. - [ ]
-Wall -Wextra
: We could set this via#pragmas
but maybe we should leave this to the user. - [ ]
-O2
: I think we should really leave this to the user. - [ ] Add section to README
- [ ] Add CI jobs to test these builds
-Wno-unused-function: We could add a #pragma or better add attribute ((unsused)) to the relevant functions.
There are no unused functions except for ones that are unneeded because of test harness or module configuration options.
Sure? I think at least the multimultiplication functions and the scratch space functions are currently unused.
Now that #1042 has been merged, we need to build multiple modules:
gcc -c src/secp256k1.c src/precomputed_*.c -DECMULT_GEN_PREC_BITS=4 -DECMULT_WINDOW_SIZE=15
ar rcs libsecp256k1.a secp256k1.o precomputed_*.o