[PATCH] D69003: [dsymutil] Add ${system_libs} to target link libraries
Gokturk Yuksek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 25 12:38:29 PDT 2019
gokturk updated this revision to Diff 226481.
gokturk retitled this revision from "cmake/modules/AddLLVM.cmake: pass '-latomic' to the linker if necessary" to "[dsymutil] Add ${system_libs} to target link libraries".
gokturk edited the summary of this revision.
gokturk added a comment.
Herald added a reviewer: JDevlieghere.
In D69003#1720595 <https://reviews.llvm.org/D69003#1720595>, @compnerd wrote:
> I think that @beanz is right about that. The reason for the `HAVE_LIBATOMIC` is because it is managing the current configuration checks. It may be possible to simplify it further in the future, but that area of the code has a `HAVE_LIBATOMIC`. That will setup `system_libs` properly and `dsymutil` can use `system_libs` as a parameter to `LINK_LIBS` option.
dsymutil is created using `add_llvm_tool()`, which doesn't take a `LINK_LIBS` option. I see that `llvm_add_library()` supports this but I wasn't sure how to take advantage of that, so I went with `target_link_libraries()`.
I also have another patch to establish:
- if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
+ if( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64) )
but I'll submit that as another revision if that's alright.
I'm in the process of testing if this patch works, which takes about 20 hours on a VM. I'll post here the result when it's done.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69003/new/
https://reviews.llvm.org/D69003
Files:
llvm/tools/dsymutil/CMakeLists.txt
Index: llvm/tools/dsymutil/CMakeLists.txt
===================================================================
--- llvm/tools/dsymutil/CMakeLists.txt
+++ llvm/tools/dsymutil/CMakeLists.txt
@@ -38,3 +38,5 @@
if(APPLE)
target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation")
endif(APPLE)
+
+target_link_libraries(dsymutil PRIVATE ${system_libs})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69003.226481.patch
Type: text/x-patch
Size: 360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191025/1f1b5bbc/attachment.bin>
More information about the llvm-commits
mailing list