[PATCH] D147937: fix: Link `atomic` into LLVMOrcJIT on platforms without hardware support for atomics

Owen Shepherd via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 15:28:41 PDT 2023


414owen added a comment.

Hi @lhames,
No, I don't have commit access (I created an account just to post this diff really).
You can use "Owen Shepherd <owen at owen.cafe>" for the attribution.

I let the build run for a bit and got another similar error, but I'm not sure which cmake file to add the fix to in the next case:

  [ 70%] Linking CXX shared library ../../../lib/liblldCOFF.so
  /usr/bin/ld: CMakeFiles/lldCOFF.dir/DebugTypes.cpp.o: in function `void llvm::function_ref<void (unsigned int)>::callback_fn<lld::coff::TypeMerger::mergeTypesWithGHash()::{lambda(unsigned int)#3}>(int, unsigned int)':
  DebugTypes.cpp:(.text._ZN4llvm12function_refIFvjEE11callback_fnIZN3lld4coff10TypeMerger19mergeTypesWithGHashEvEUljE1_EEvij+0x11c): undefined reference to `__atomic_load_8'
  /usr/bin/ld: DebugTypes.cpp:(.text._ZN4llvm12function_refIFvjEE11callback_fnIZN3lld4coff10TypeMerger19mergeTypesWithGHashEvEUljE1_EEvij+0x1e4): undefined reference to `__atomic_compare_exchange_8'
  collect2: error: ld returned 1 exit status
  gmake[2]: *** [tools/lld/COFF/CMakeFiles/lldCOFF.dir/build.make:380: lib/liblldCOFF.so.14] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:17562: tools/lld/COFF/CMakeFiles/lldCOFF.dir/all] Error 2
  gmake: *** [Makefile:171: all] Error 2

Any pointers?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147937



More information about the llvm-commits mailing list