Skip to content
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

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

Open
3 of 9 tasks
real-or-random opened this issue May 2, 2021 · 3 comments
Open
3 of 9 tasks

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

real-or-random opened this issue May 2, 2021 · 3 comments
Labels
build user-documentation user-facing documentation

Comments

@real-or-random
Copy link
Contributor

real-or-random commented May 2, 2021

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:

@real-or-random
Copy link
Contributor Author

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

@real-or-random real-or-random changed the title Tracking issue for non-autotool builds Tracking issue for non-autotools builds Dec 9, 2021
@real-or-random
Copy link
Contributor Author

real-or-random commented Dec 20, 2021

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

real-or-random added a commit to real-or-random/secp256k1 that referenced this issue Jun 30, 2022
This simplifies building without a build system.

This is in line with bitcoin-core#925; the paths fixed here were either forgotten
there or only introduced later. This commit also makes the Makefile
stricter so that further "wrong" #include paths will lead to build
errors even in autotools builds.

This belongs to bitcoin-core#929.
real-or-random added a commit to real-or-random/secp256k1 that referenced this issue Jun 30, 2022
This simplifies building without a build system.

This is in line with bitcoin-core#925; the paths fixed here were either forgotten
there or only introduced later. This commit also makes the Makefile
stricter so that further "wrong" #include paths will lead to build
errors even in autotools builds.

This belongs to bitcoin-core#929.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
real-or-random added a commit to real-or-random/secp256k1 that referenced this issue Jul 1, 2022
This simplifies building without a build system.

This is in line with bitcoin-core#925; the paths fixed here were either forgotten
there or only introduced later. This commit also makes the Makefile
stricter so that further "wrong" #include paths will lead to build
errors even in autotools builds.

This belongs to bitcoin-core#929.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
real-or-random added a commit that referenced this issue Jul 1, 2022
… arguments

40a3473 build: Fix #include "..." paths to get rid of further -I arguments (Tim Ruffing)

Pull request description:

  This simplifies building without a build system.

  This is in line with #925; the paths fixed here were either forgotten
  there or only introduced later. This commit also makes the Makefile
  stricter so that further "wrong" #include paths will lead to build
  errors even in autotools builds.

  This belongs to #929.

ACKs for top commit:
  hebasto:
    ACK 40a3473

Tree-SHA512: 6f4d825ea3cf86b13f294e2ec19fafc29660fa99450e6b579157d7a6e9bdb3404d761edf89c1135fa89b984d6431a527beeb97031dc90f2fae9761528f4d06d1
@real-or-random real-or-random changed the title Tracking issue for non-autotools builds Tracking issue for manual (non-autotools) builds Jul 6, 2022
real-or-random added a commit to real-or-random/secp256k1 that referenced this issue Jul 6, 2022
This simplifies manual builds and solves one item in bitcoin-core#929.
@real-or-random real-or-random added user-documentation user-facing documentation build labels Jan 5, 2023
dderjoel pushed a commit to dderjoel/secp256k1 that referenced this issue May 23, 2023
This simplifies building without a build system.

This is in line with bitcoin-core#925; the paths fixed here were either forgotten
there or only introduced later. This commit also makes the Makefile
stricter so that further "wrong" #include paths will lead to build
errors even in autotools builds.

This belongs to bitcoin-core#929.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
dderjoel pushed a commit to dderjoel/secp256k1 that referenced this issue May 23, 2023
This simplifies manual builds and solves one item in bitcoin-core#929.
@hebasto
Copy link
Member

hebasto commented Jul 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build user-documentation user-facing documentation
Projects
None yet
Development

No branches or pull requests

2 participants