[PATCH] D69003: cmake/modules/AddLLVM.cmake: pass '-latomic' to the linker if necessary

Gokturk Yuksek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 15:08:17 PDT 2019


gokturk added a comment.

In D69003#1711697 <https://reviews.llvm.org/D69003#1711697>, @beanz wrote:

> I'm not sure this is the correct fix.
>
> Probably a more correct fix would be to change line 29 of llvm/lib/Support/CMakeLists.txt to:
>
>   if( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64))
>


Would that propagate the flag to `tools/dsymutil` ? The line you suggested already checks for `HAVE_LIBATOMIC`, but dsymutil still fails to link against libatomic.

Also, why `HAVE_LIBATOMIC`? There's another test right after it that checks whether the compiler works with `-latomic`, and sets `HAVE_CXX_ATOMICS_WITH_LIB`. Isn't that a better variable to check for?

My main issue with my patch is that it adds `-latomic` to every tool compilation, whereas only dsymutil seems to need it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69003





More information about the llvm-commits mailing list