[Openmp-commits] [PATCH] D95371: [OpenMP] Use C++ to link libomp.so when LLVM libraries are included

Krzysztof Parzyszek via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jan 25 10:28:08 PST 2021


kparzysz added a comment.

The problem is with linking the Support library from LLVM, which has a lot of C++ code.  If I'm reading the CMakeLists.txt correctly, there is still an option to build libomp.so as a "standalone" library (line 138), where the C linking should be sufficient.

In my build there are over 2800 lines of errors due to various C++ symbols.  Here's a sample:

  ../../../../lib/libLLVMSupport.a(TimeProfiler.cpp.o): In function `std::__1::vector<llvm::TimeTraceProfiler*, std::__1::allocator<llvm::TimeTraceProfiler*> >::~vector()':
  TimeProfiler.cpp:(.text._ZNSt3__16vectorIPN4llvm17TimeTraceProfilerENS_9allocatorIS3_EEED2Ev[_ZNSt3__16vectorIPN4llvm17TimeTraceProfilerENS_9allocatorIS3_EEED2Ev]+0x10): undefined reference to `operator delete(void*)'
  ../../../../lib/libLLVMSupport.a(TimeProfiler.cpp.o): In function `llvm::timeTraceProfilerInitialize(unsigned int, llvm::StringRef)':
  TimeProfiler.cpp:(.text._ZN4llvm27timeTraceProfilerInitializeEjNS_9StringRefE+0x30): undefined reference to `operator new(unsigned long)'
  ../../../../lib/libLLVMSupport.a(TimeProfiler.cpp.o): In function `llvm::TimeTraceProfiler::TimeTraceProfiler(unsigned int, llvm::StringRef)':
  TimeProfiler.cpp:(.text._ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE[_ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE]+0x67): undefined reference to `std::__1::chrono::system_clock::now()'
  TimeProfiler.cpp:(.text._ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE[_ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE]+0x73): undefined reference to `std::__1::chrono::steady_clock::now()'
  TimeProfiler.cpp:(.text._ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE[_ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE]+0xca): undefined reference to `operator new(unsigned long)'
  TimeProfiler.cpp:(.text._ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE[_ZN4llvm17TimeTraceProfilerC2EjNS_9StringRefE]+0x155): undefined reference to `std::__1::__basic_string_common<true>::__throw_length_error() const'
  ../../../../lib/libLLVMSupport.a(TimeProfiler.cpp.o): In function `llvm::timeTraceProfilerCleanup()':


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95371



More information about the Openmp-commits mailing list