udefined reference to SignatureHashSchnorr #23856

issue techy2 opened this issue on December 24, 2021
  1. techy2 commented at 1:32 AM on December 24, 2021: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core.

    General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com.

    For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/.

    If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue!

    Any report, issue or feature request related to the GUI should be reported at https://github.com/bitcoin-core/gui/issues/ -->

    <!-- Describe the issue -->

    building from GIT source failure occurs in downloaded TAR file as well as GIT pull and build 22.x branch

    <!--- What behavior did you expect? -->

    expected successful build

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    CXXLD bitcoin-tx libbitcoin_common.a(libbitcoin_common_a-sign.o): In function MutableTransactionSignatureCreator::CreateSchnorrSig(SigningProvider const&, std::vector<unsigned char, std::allocator<unsigned char> >&, XOnlyPubKey const&, uint256 const*, uint256 const*, SigVersion) const': sign.cpp:(.text+0x220d): undefined reference to bool SignatureHashSchnorr<CMutableTransaction>(uint256&, ScriptExecutionData const&, CMutableTransaction const&, unsigned int, unsigned char, SigVersion, PrecomputedTransactionData const&, MissingDataBehavior)' collect2: error: ld returned 1 exit status Makefile:5270: recipe for target 'bitcoin-tx' failed make[2]: *** [bitcoin-tx] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/master/gitrepo/bitcoin/src' Makefile:15532: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/master/gitrepo/bitcoin/src' Makefile:821: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    happens exactly the same every time

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    git clone https://github.com/bitcoin/bitcoin cd bitcoin/depends make (is successful) cd ../ ./autogen.sh ./configure --enable-glibc-back-compat --prefix=$(pwd)/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++" --enable-cxx --enable-static --disable-shared --disable-debug --disable-tests --disable-bench --with-pic CPPFLAGS="-fPIC -O3 --param ggc-min-expand=1 --param ggc-min-heapsize=32768" CXXFLAGS="-fPIC -O3 --param ggc-min-expand=1 --param ggc-min-heapsize=32768"

    make -j3 produces error above every time looks to me like there is a dependency missing did you forget to put the Schnorr library in "depends"?

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    24 core Xeon + 192GB memory, 1T managed high speed disk array 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    no GUI issues

    <!-- Any extra information that might be useful in the debugging process. -->

    All previous versions for the last couple of years have built successfully many other coins both dash based and pivx based build successfully, only this particular distro has a problem.

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

    configuration log from this build config.log

  2. achow101 commented at 11:54 PM on January 11, 2022: member

    This is an issue with your build environment. SignatureHashSchnorr is a function within this project itself and others do not experience this issue.

    Are you building with a clean repo every time or are build artifacts from earlier builds still present?

    Try doing make clean before make -j3.

  3. MarcoFalke added the label Build system on Jan 12, 2022
  4. MarcoFalke commented at 9:07 AM on January 12, 2022: member

    I can reproduce on a fresh install of Ubuntu Bionic:

    ( cd depends && make -j $(nproc) ) && ./autogen.sh && ./configure --enable-glibc-back-compat --prefix=$(pwd)/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++" --enable-cxx --enable-static --disable-shared --disable-debug --disable-tests --disable-bench --with-pic CPPFLAGS="-fPIC -O3 --param ggc-min-expand=1 --param ggc-min-heapsize=32768" CXXFLAGS="-fPIC -O3 --param ggc-min-expand=1 --param ggc-min-heapsize=32768" && make -j $(nproc)

      CXX      crc32c/src/crc32c_libcrc32c_a-crc32c.o
      CXX      crc32c/src/crc32c_libcrc32c_a-crc32c_portable.o
      AR       crc32c/libcrc32c_sse42.a
      CXX      leveldb/helpers/memenv/leveldb_libmemenv_a-memenv.o
      AR       libbitcoin_cli.a
      GEN      qt/bitcoinamountfield.moc
      AR       libbitcoin_wallet_tool.a
      GEN      qt/intro.moc
      GEN      qt/overviewpage.moc
      GEN      qt/rpcconsole.moc
      GEN      qt/qrc_bitcoin_locale.cpp
      CXXLD    libbitcoinconsensus.la
      AR       libbitcoin_server.a
      AR       libbitcoin_util.a
      AR       libbitcoin_zmq.a
      AR       crc32c/libcrc32c.a
    ar: `u' modifier ignored since `D' is the default (see `U')
      CXXLD    bitcoin-cli
      CXXLD    bitcoin-tx
      CXXLD    bitcoin-util
      CXX      qt/qt_bitcoin_qt-main.o
    libbitcoin_common.a(libbitcoin_common_a-sign.o): In function `MutableTransactionSignatureCreator::CreateSchnorrSig(SigningProvider const&, std::vector<unsigned char, std::allocator<unsigned char> >&, XOnlyPubKey const&, uint256 const*, uint256 const*, SigVersion) const':
    sign.cpp:(.text+0x220d): undefined reference to `bool SignatureHashSchnorr<CMutableTransaction>(uint256&, ScriptExecutionData const&, CMutableTransaction const&, unsigned int, unsigned char, SigVersion, PrecomputedTransactionData const&, MissingDataBehavior)'
    collect2: error: ld returned 1 exit status
    Makefile:5270: recipe for target 'bitcoin-tx' failed
    make[2]: *** [bitcoin-tx] Error 1
    make[2]: *** Waiting for unfinished jobs....
      CXX      qt/qt_libbitcoinqt_a-bantablemodel.o
    make[2]: Leaving directory '/bitcoin-core/src'
    Makefile:15532: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/bitcoin-core/src'
    Makefile:821: recipe for target 'all-recursive' failed
    make: *** [all-recursive] Error 1
    
  5. MarcoFalke commented at 9:08 AM on January 12, 2022: member
    git log -1 --oneline
    56156a1f0 (HEAD -> 22.x, origin/22.x) Merge bitcoin/bitcoin#23315: [22.x] build: explicitly disable libsecp256k1 openssl based tests
    
  6. MarcoFalke commented at 11:16 AM on January 12, 2022: member

    Likely a compiler bug

  7. MarcoFalke commented at 11:26 AM on January 12, 2022: member

    You can fix this by replacing O3 with O2

  8. MarcoFalke closed this on Jan 12, 2022

  9. MarcoFalke added the label Upstream on Jan 12, 2022
  10. MarcoFalke commented at 12:20 PM on January 12, 2022: member

    Alternatively you can use a compiler (version) that doesn't have this bug

  11. techy2 commented at 5:56 PM on January 13, 2022: none

    Changed optimization to O2 and got exactly the same error

  12. techy2 commented at 5:57 PM on January 13, 2022: none

    g++ version 7.50 from ubuntu 18.04 distro repository

  13. hebasto commented at 6:05 PM on January 13, 2022: member

    @techy2

    Does this patch

    --- a/src/script/sign.cpp
    +++ b/src/script/sign.cpp
    @@ -9,6 +9,7 @@
     #include <key.h>
     #include <policy/policy.h>
     #include <primitives/transaction.h>
    +#include <script/interpreter.h>
     #include <script/keyorigin.h>
     #include <script/signingprovider.h>
     #include <script/standard.h>
    

    help?

  14. MarcoFalke commented at 6:11 PM on January 13, 2022: member

    Changed optimization to O2 and got exactly the same error

    That's odd. It was working for me yesterday. Did you run make clean in between?

  15. techy2 commented at 9:33 PM on January 13, 2022: none

    don't remember, will repeat

  16. techy2 commented at 12:54 AM on January 14, 2022: none

    don't remember if I did a make clean so removed the local repository and did a fresh pull from github build depends coinfigure with O2 get this error right away, CXX primitives/libbitcoinconsensus_la-transaction.lo In file included from primitives/transaction.cpp:11:0: ./util/strencodings.h:16:10: fatal error: charconv: No such file or directory #include <charconv> ^~~~~~~~~~

  17. techy2 commented at 12:57 AM on January 14, 2022: none

    configuration command line is same as above except O2 in 2 places instead of O3

  18. fanquake commented at 1:03 AM on January 14, 2022: member

    g++ version 7.50 from ubuntu 18.04 distro repository did a fresh pull from github ./util/strencodings.h:16:10: fatal error: charconv: No such file or directory

    Did you forget to checkout the 22.x branch? Looks like you're now building master, and you need to use GCC 8.1 or newer to do that. See https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md.

  19. techy2 commented at 1:09 AM on January 14, 2022: none

    oops, yeah, I'll try the 22.x branch

  20. techy2 commented at 6:34 AM on January 14, 2022: none

    build complete without errors on 22.x branch with -O2 g++ 7.50 Thanks for the help fellas

  21. DrahtBot locked this on Jan 14, 2023

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: 2026-04-15 15:13 UTC

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