[PATCH] D129116: ManagedStatic: remove from DebugCounter

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 10:14:57 PDT 2022


mehdi_amini added a comment.

I didn't try before, it is reproducing on my machine. The link command (that I get by doing after a first build: ` rm bin/mlir-pdll-lsp-server && ninja bin/mlir-pdll-lsp-server -v`):

  /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/usr/local/google/home/aminim/projects/llvm-project/build-dylib/./lib  -Wl,--gc-sections tools/mlir/tools/mlir-pdll-lsp-server/CMakeFiles/mlir-pdll-lsp-server.dir/mlir-pdll-lsp-server.cpp.o -o bin/mlir-pdll-lsp-server  -Wl,-rpath,"\$ORIGIN/../lib"  lib/libMLIRPdllLspServerLib.a  lib/libMLIRPDLLCodeGen.a  lib/libMLIRParser.a  lib/libMLIRBytecodeReader.a  lib/libMLIRAsmParser.a  lib/libMLIRPDLDialect.a  lib/libMLIRInferTypeOpInterface.a  lib/libMLIRSideEffectInterfaces.a  lib/libMLIRIR.a  lib/libMLIRPDLLParser.a  lib/libMLIRPDLLAST.a  lib/libMLIRPDLLODS.a  lib/libMLIRTableGen.a  lib/libLLVMTableGen.a  lib/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libtinfo.so  lib/libLLVMDemangle.a  lib/libMLIRLspServerSupportLib.a  lib/libMLIRSupport.a  lib/libLLVM-16git.so

If I remove the `lib/libLLVM-16git.so` from the command line I get:

  /usr/bin/ld: lib/libMLIRLspServerSupportLib.a(CompilationDatabase.cpp.o): in function `std::enable_if<llvm::yaml::has_ScalarTraits<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type llvm::yaml::yamlize<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(llvm::yaml::IO&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool, llvm::yaml::EmptyContext&) [clone .isra.0]':
  CompilationDatabase.cpp:(.text._ZN4llvm4yaml7yamlizeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsrNS0_16has_ScalarTraitsIT_EE5valueEvE4typeERNS0_2IOERSA_bRNS0_12EmptyContextE.isra.0+0x99): undefined reference to `llvm::yaml::IO::getContext() const'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4llvm4yaml7yamlizeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsrNS0_16has_ScalarTraitsIT_EE5valueEvE4typeERNS0_2IOERSA_bRNS0_12EmptyContextE.isra.0+0xa7): undefined reference to `llvm::yaml::ScalarTraits<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>::output(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void*, llvm::raw_ostream&)'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4llvm4yaml7yamlizeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsrNS0_16has_ScalarTraitsIT_EE5valueEvE4typeERNS0_2IOERSA_bRNS0_12EmptyContextE.isra.0+0x14e): undefined reference to `llvm::yaml::IO::getContext() const'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4llvm4yaml7yamlizeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsrNS0_16has_ScalarTraitsIT_EE5valueEvE4typeERNS0_2IOERSA_bRNS0_12EmptyContextE.isra.0+0x163): undefined reference to `llvm::yaml::ScalarTraits<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>::input(llvm::StringRef, void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
  /usr/bin/ld: lib/libMLIRLspServerSupportLib.a(CompilationDatabase.cpp.o): in function `mlir::lsp::CompilationDatabase::loadDatabase(llvm::StringRef) [clone .localalias]':
  CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x95): undefined reference to `llvm::yaml::Input::Input(llvm::StringRef, void*, void (*)(llvm::SMDiagnostic const&, void*), void*)'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0xe0): undefined reference to `llvm::yaml::Input::setCurrentDocument()'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x146): undefined reference to `llvm::yaml::Input::beginMapping()'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x162): undefined reference to `llvm::yaml::Input::preflightKey(char const*, bool, bool, bool&, void*&)'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x329): undefined reference to `llvm::yaml::Input::preflightKey(char const*, bool, bool, bool&, void*&)'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x80c): undefined reference to `llvm::yaml::Input::endMapping()'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x814): undefined reference to `llvm::yaml::Input::error()'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x82c): undefined reference to `llvm::yaml::Input::nextDocument()'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x834): undefined reference to `llvm::yaml::Input::setCurrentDocument()'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0xcd7): undefined reference to `llvm::yaml::Input::postflightKey(void*)'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0xcf7): undefined reference to `llvm::yaml::Input::postflightKey(void*)'
  /usr/bin/ld: CompilationDatabase.cpp:(.text._ZN4mlir3lsp19CompilationDatabase12loadDatabaseEN4llvm9StringRefE+0x1129): undefined reference to `llvm::yaml::Input::~Input()'
  /usr/bin/ld: lib/libMLIRLspServerSupportLib.a(Logging.cpp.o): in function `llvm::detail::provider_format_adapter<std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >&>::format(llvm::raw_ostream&, llvm::StringRef)':
  Logging.cpp:(.text._ZN4llvm6detail23provider_format_adapterIRNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEEE6formatERNS_11raw_ostreamENS_9StringRefE[_ZN4llvm6detail23provider_format_adapterIRNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEEE6formatERNS_11raw_ostreamENS_9StringRefE]+0x5): undefined reference to `llvm::format_provider<std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, void>::format(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, llvm::raw_ostream&, llvm::StringRef)'
  collect2: error: ld returned 1 exit status

I'm not sure how you got these symbols or how you got a binary that don't link to the .so? Are you having a specific default toolchain on your machine (I am using plain gcc/bfd here).

Assuming we're talking about this patch: https://github.com/llvm/llvm-project/issues/58015#issuecomment-1279343628 ; then I just tried and it does not help. But looking at the thread, I'm not sure why it should actually. Seems like a different problem to me really.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129116/new/

https://reviews.llvm.org/D129116



More information about the llvm-commits mailing list