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

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 08:43:01 PST 2021


kparzysz created this revision.
kparzysz added reviewers: JonChesterfield, jdoerfert.
Herald added subscribers: guansong, yaxunl, mgorny.
kparzysz requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

Otherwise cmake may link it as a C library causing dozens of C++ symbols to be unresolved.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95371

Files:
  openmp/runtime/src/CMakeLists.txt


Index: openmp/runtime/src/CMakeLists.txt
===================================================================
--- openmp/runtime/src/CMakeLists.txt
+++ openmp/runtime/src/CMakeLists.txt
@@ -144,6 +144,7 @@
     LINK_LIBS ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS}
     LINK_COMPONENTS Support
     )
+  set(LIBOMP_LINKER_LANGUAGE CXX)
 endif()
 
 set_target_properties(omp PROPERTIES


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95371.319027.patch
Type: text/x-patch
Size: 387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210125/63428d08/attachment.bin>


More information about the llvm-commits mailing list