test: fix DWARF string_view linker error in blockfilter_tests #25120

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:fix-DWARF-string_view-linker-error changing 1 files +4 −2
  1. jonatack commented at 6:53 pm on May 12, 2022: member

    Fix the following build error that I am seeing with Debian testing clang 15:

    0/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
    1test/test_bitcoin-blockfilter_tests.o: in function `blockfilter_tests::blockfilters_json_test::test_method()':
    2blockfilter_tests.cpp:(.text+0x59d6): undefined reference to `ParseHex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    3/usr/bin/ld: blockfilter_tests.cpp:(.text+0x5e54): undefined reference to `ParseHex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    4clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
  2. Fix DWARF string_view linker error in blockfilter_tests 7d630dc1bd
  3. jonatack commented at 6:57 pm on May 12, 2022: member
    Unsure, possibly related to c1d165a8c2678c31ac or to changes in clang.
  4. laanwj commented at 7:32 pm on May 12, 2022: member

    I’m really confused by this. Why would an explicit stringview{} be needed. Looks like the compiler thinks that ParseHex(const std::string&) is still defined where it’s not. Normally this happens if the header and compilation is out of sync.

    Did you build from a clean tree? Could this be some kind of ABI conflict between different C++ versions?

  5. laanwj added the label Upstream on May 12, 2022
  6. laanwj added the label Tests on May 12, 2022
  7. jonatack commented at 7:37 pm on May 12, 2022: member
    Yes, I suspected it was something on my end or a clang update (I updated today). Saw it several times after make distclean && ./autogen.sh && ./configure --enable-debug --with-incompatible-bdb --enable-werror --enable-c++20 --enable-suppress-external-warnings --enable-experimental-util-chainstate CC=clang CXX=clang++ && make clean && make. Anything else I should be doing to ensure a clean tree? Am building with gcc right now to compare.
  8. sipa commented at 7:44 pm on May 12, 2022: member
    @jonatack To be absolutely sure, you could clear the ccache cache (ccache -C) if you’re using ccache.
  9. laanwj commented at 7:44 pm on May 12, 2022: member

    The surest way to get a clean tree would be git clean -f -x -d (this literally wipes everything in the tree that doesn’t belong to git, so be careful you don’t have anything else in there)

    But make clean should get rid of blockfilter_tests.o. Do you use ccache? maybe also ccache -C.

  10. jonatack commented at 7:51 pm on May 12, 2022: member
    Thanks! The gcc build finished cleanly. Ran ccache -C and rebuilding with clang now.
  11. fanquake commented at 8:15 pm on May 12, 2022: member

    Yes, I suspected it was something on my end or a clang update (I updated today).

    Going to close, as this is pretty clearly a local issue. Feel free to continue discussion in regards to cleaning your git tree.

  12. fanquake closed this on May 12, 2022

  13. jonatack commented at 8:27 pm on May 12, 2022: member
    Clearing ccache did it. Closing and sorry for the noise.
  14. jonatack deleted the branch on May 12, 2022
  15. fanquake locked this on May 18, 2022

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