-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow-ups to making all tables fully static #1041
Conversation
6f8faeb
to
f233242
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was quick1
Concept ACK
f233242
to
51512b0
Compare
51512b0
to
cf38e94
Compare
Sigh, this isn't a solution either. |
Going to try a different approach. |
What was the problem with this approach? Just asking because I was in the middle of reviewing this. |
The problem was that if you build with "make -j", and it involves rebuilding the precomputed table files (4 in this PR as is), it'll trigger 4 invocations of a sub-make command to build the "precompute" binary, which end up overwriting each other, and race conditions. The solution is something called "grouped targets" in Makefiles, where you indicate that multiple files get built simultaneously by one rule, but it seems the macOs make doesn't support this feature. The approach I'm going to try next is keeping precompute_ecmult and precompute_ecmult_gen separate, and only having them generate the precomputed_*.c file. The corresponding .h file can be a normal checked-in file in the repository. |
I see. Thanks. |
e05da9e Fix c++ build (Pieter Wuille) c45386d Cleanup preprocessor indentation in precompute{,d}_ecmult{,_gen} (Pieter Wuille) 19d96e1 Split off .c file from precomputed_ecmult.h (Pieter Wuille) 1a6691a Split off .c file from precomputed_ecmult_gen.h (Pieter Wuille) bb36331 Simplify precompute_ecmult_print_* (Pieter Wuille) 38cd84a Compute ecmult tables at runtime for tests_exhaustive (Pieter Wuille) e458ec2 Move ecmult table computation code to separate file (Pieter Wuille) fc1bf9f Split ecmult table computation and printing (Pieter Wuille) 31feab0 Rename function secp256k1_ecmult_gen_{create_prec -> compute}_table (Pieter Wuille) 725370c Rename ecmult_gen_prec -> ecmult_gen_compute_table (Pieter Wuille) 075252c Rename ecmult_static_pre_g -> precomputed_ecmult (Pieter Wuille) 7cf47f7 Rename ecmult_gen_static_prec_table -> precomputed_ecmult_gen (Pieter Wuille) f95b810 Rename gen_ecmult_static_pre_g -> precompute_ecmult (Pieter Wuille) bae7768 Rename gen_ecmult_gen_static_prec_table -> precompute_ecmult_gen (Pieter Wuille) Pull request description: This PR implements a number of changes to follow up after merging #988: * Naming consistency: * All precomputed table files now have name `precomputed_*.*` * All source files related to the creation of the precomputed table files have name `precompute_*.*`. * All source files related to the computation of tables (whether they go in precomputed files or not) have name `*_compute_table.*`. * Make the tables for exhaustive tests be computed at runtime rather than compile time (this was already the case for ecmult_gen, but not ecmult). This is a preparation for the next point, as the alternative would be to have separate precomputed libraries for the exhaustive tests and other binaries. * Moves the actual tables to separate `precomputed_*.c` files, which are compiled only once as part of a new `libsecp256k1_precomputed.la`, included where relevant. The corresponding `precomputed_*.h` file are normal source files. Retry of #1041. ACKs for top commit: real-or-random: ACK e05da9e jonasnick: ACK e05da9e Tree-SHA512: 71eadd66e30e511b786e910755e0eda53330dfa163b37e33602c3392f7b893569f56d3ca9870e85cbb3de83880fc5aef61ac3d55d759d7395086a69023f13f03
This PR implements a number of changes to follow up after merging #988:
precompute_ecmult
andprecompute_ecmult_gen
prefixes (avoiding the "gen" ambiguity).precomputed_ecmult
andprecomputed_ecmult_gen
prefixes.precompute
.precomputed_ecmult.c
andprecomputed_ecmult_gen.c
files, which are compiled only once as part of a newlibsecp256k1_precomputed.la
, included where relevant.