Tracking issue for manual (non-autotools) builds #929

issue real-or-random opened this issue on May 2, 2021
  1. real-or-random commented at 10:16 AM on May 2, 2021: contributor

    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:

    • -DSECP256K1_BUILD: #928
    • -I #925
    • -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: #929 (comment)
    • -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
  2. real-or-random commented at 8:34 PM on May 2, 2021: contributor

    -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.

  3. real-or-random renamed this:
    Tracking issue for non-autotool builds
    Tracking issue for non-autotools builds
    on Dec 9, 2021
  4. real-or-random commented at 10:56 AM on December 20, 2021: contributor

    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
    
  5. real-or-random referenced this in commit d63719fb10 on Jun 30, 2022
  6. real-or-random referenced this in commit ac39773ba9 on Jun 30, 2022
  7. real-or-random referenced this in commit 40a3473a9d on Jul 1, 2022
  8. real-or-random referenced this in commit af65d30cc8 on Jul 1, 2022
  9. real-or-random renamed this:
    Tracking issue for non-autotools builds
    Tracking issue for manual (non-autotools) builds
    on Jul 6, 2022
  10. real-or-random referenced this in commit d0cf55e13a on Jul 6, 2022
  11. real-or-random added the label documentation on Jan 5, 2023
  12. real-or-random added the label build on Jan 5, 2023
  13. dderjoel referenced this in commit 16062f8875 on May 23, 2023
  14. dderjoel referenced this in commit c65199ef4a on May 23, 2023
  15. hebasto commented at 10:41 AM on July 2, 2023: member
    • -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.

    Agreed, both options should be left to the user.

    When building a shared library, providing the -Wl,--no-undefined option might be a good way to ensure that the resulted library is OK:

    gcc -O2 -fPIC -c src/secp256k1.c src/precomputed_*.c
    gcc secp256k1.o precomputed_*.o -shared -Wl,--no-undefined -o libsecp256k1.so
    

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC