udefined reference to SignatureHashSchnorr #23856

issue techy2 openend this issue on December 24, 2021
  1. techy2 commented at 1:32 am on December 24, 2021: none

    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/ –>

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

    expected successful build

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

    happens exactly the same every time

    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”?

    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

    no GUI issues

    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.

    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)

     0  CXX      crc32c/src/crc32c_libcrc32c_a-crc32c.o
     1  CXX      crc32c/src/crc32c_libcrc32c_a-crc32c_portable.o
     2  AR       crc32c/libcrc32c_sse42.a
     3  CXX      leveldb/helpers/memenv/leveldb_libmemenv_a-memenv.o
     4  AR       libbitcoin_cli.a
     5  GEN      qt/bitcoinamountfield.moc
     6  AR       libbitcoin_wallet_tool.a
     7  GEN      qt/intro.moc
     8  GEN      qt/overviewpage.moc
     9  GEN      qt/rpcconsole.moc
    10  GEN      qt/qrc_bitcoin_locale.cpp
    11  CXXLD    libbitcoinconsensus.la
    12  AR       libbitcoin_server.a
    13  AR       libbitcoin_util.a
    14  AR       libbitcoin_zmq.a
    15  AR       crc32c/libcrc32c.a
    16ar: `u' modifier ignored since `D' is the default (see `U')
    17  CXXLD    bitcoin-cli
    18  CXXLD    bitcoin-tx
    19  CXXLD    bitcoin-util
    20  CXX      qt/qt_bitcoin_qt-main.o
    21libbitcoin_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':
    22sign.cpp:(.text+0x220d): undefined reference to `bool SignatureHashSchnorr<CMutableTransaction>(uint256&, ScriptExecutionData const&, CMutableTransaction const&, unsigned int, unsigned char, SigVersion, PrecomputedTransactionData const&, MissingDataBehavior)'
    23collect2: error: ld returned 1 exit status
    24Makefile:5270: recipe for target 'bitcoin-tx' failed
    25make[2]: *** [bitcoin-tx] Error 1
    26make[2]: *** Waiting for unfinished jobs....
    27  CXX      qt/qt_libbitcoinqt_a-bantablemodel.o
    28make[2]: Leaving directory '/bitcoin-core/src'
    29Makefile:15532: recipe for target 'all-recursive' failed
    30make[1]: *** [all-recursive] Error 1
    31make[1]: Leaving directory '/bitcoin-core/src'
    32Makefile:821: recipe for target 'all-recursive' failed
    33make: *** [all-recursive] Error 1
    
  5. MarcoFalke commented at 9:08 am on January 12, 2022: member
    0git log -1 --oneline
    156156a1f0 (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

    0--- a/src/script/sign.cpp
    1+++ b/src/script/sign.cpp
    2@@ -9,6 +9,7 @@
    3 #include <key.h>
    4 #include <policy/policy.h>
    5 #include <primitives/transaction.h>
    6+#include <script/interpreter.h>
    7 #include <script/keyorigin.h>
    8 #include <script/signingprovider.h>
    9 #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 0: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 ^~~~~~~~~~
  17. techy2 commented at 0: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: 2024-12-21 15:12 UTC

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