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

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jan 25 10:39:41 PST 2021


AndreyChurbanov added a comment.

In D95371#2520436 <https://reviews.llvm.org/D95371#2520436>, @tianshilei1992 wrote:

> In D95371#2520241 <https://reviews.llvm.org/D95371#2520241>, @JonChesterfield wrote:
>
>> Tagging Shilei as this is cmake
>>
>> Google suggests 'LINKER_LANGUAGE' is how cmake decides whether to invoke 'gcc' or 'g++' to build a library, as an indirect way of asking to link in libstdc++ or similar.
>>
>> So my guess is that the llvm support library has link time dependencies on c++, so when linking support we also need to link a c++ runtime, and CMake chose 'LINKER_LANGUAGE' as the name to indicate that.
>>
>> Does that match your understanding of the problem? If so, agreed with the fix.
>
> I think your guess is right. `libomp.so` is probably intended to be a C library (need to add  @AndreyChurbanov here as he is the real expert). Not sure whether it's good to potentially break the rule.

That's right. Regardless that the code is written in C++ the intention is to not have any dependency on C++ runtime.  The libomp.so should work fine with C applications as well as with Fortran codes those often cannot link C++ runtime.
And all exported from libomp.so symbols supposed to be C symbols.


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