libbitcoinconsensus.a is unusable #28779

issue hebasto openend this issue on November 2, 2023
  1. hebasto commented at 7:03 pm on November 2, 2023: member

    On Ubuntu 22.04, in the master branch @ 0857f2935f90df9c3d303582e5b62a9c8dedd9d7:

     0$ ./autogen.sh
     1$ ./configure --without-daemon --without-gui --without-utils --disable-tests --disable-bench --disable-fuzz-binary --disable-shared --prefix=/
     2$ make
     3$ make DESTDIR=~/CONSENSUS install
     4$ g++ testconsensus.cpp -o testconsensus -I ~/CONSENSUS/include -L ~/CONSENSUS/lib -l:libbitcoinconsensus.a
     5/usr/bin/ld: /home/hebasto/CONSENSUS/lib/libbitcoinconsensus.a(libbitcoinconsensus_la-pubkey.o): in function `ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature*, unsigned char const*, unsigned long)':
     6./src/pubkey.cpp:50: undefined reference to `secp256k1_context_static'
     7/usr/bin/ld: ./src/pubkey.cpp:50: undefined reference to `secp256k1_ecdsa_signature_parse_compact'
     8/usr/bin/ld: ./src/pubkey.cpp:179: undefined reference to `secp256k1_ecdsa_signature_parse_compact'
     9/usr/bin/ld: ./src/pubkey.cpp:173: undefined reference to `secp256k1_ecdsa_signature_parse_compact'
    10...
    11$ cat testconsensus.cpp 
    12#include <iostream>
    13
    14#include <bitcoinconsensus.h>
    15
    16int main()
    17{
    18    std::cout << "bitcoinconsensus version: " << bitcoinconsensus_version() << std::endl;
    19    return 0;
    20}
    

    It is worth mentioning that the static libbitcoinconsensus.a library is not shipped as a part of a release package.

    However, in the light of upcoming migration to CMake, 100% feature compatibility is expected, and a few options might be considered:

    1. Fix the current build system.
    2. Disable building static libraries in the current build system.
    3. Something else.
  2. hebasto added the label Bug on Nov 2, 2023
  3. hebasto added the label Build system on Nov 2, 2023
  4. hebasto commented at 7:03 pm on November 2, 2023: member
  5. hebasto added the label Brainstorming on Nov 2, 2023
  6. kcalvinalvin commented at 5:57 am on November 15, 2023: contributor
    1. Disable building static libraries in the current build system.

    I think this affects https://github.com/rust-bitcoin/rust-bitcoinconsensus (rust wrapper around libbitcoinconsensus).

    cc @tcharding @apoelstra

  7. apoelstra commented at 1:51 pm on November 15, 2023: contributor
    Thanks for the heads up. We already do something weird in rust-bitcoin to avoid bundling two copies of libsecp (or at least, we’ve talked a lot about this) so we might avoid this error. But if it pops up the next time we’re updating rust-bitcoinconsensus I will remember this issue!
  8. willcl-ark commented at 9:05 am on February 5, 2024: contributor

    Closing following #29189

    It seems like the rust-bitcoinconsensus folks are sufficiently aware of the deprecation of this lib and migration to libbitcoinkernel, and plan to possibly start a new crate based on the kernel libs.

  9. willcl-ark closed this on Feb 5, 2024

  10. tcharding commented at 8:02 pm on February 5, 2024: contributor
    Thanks for considering us.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me