[PATCH] D158846: [CMake] Fix BUILD_SHARED_LIBS build on Solaris

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 23:20:49 PDT 2023


phosek added a comment.

C++ runtime depends on `libm` which is why the Clang driver links it on most platforms in the C++ mode, see for example https://github.com/llvm/llvm-project/blob/c998106a7fea2b11bee250dd1f92ed4418a08c5a/clang/lib/Driver/ToolChains/Gnu.cpp#L569, that's not the case on Solaris though where the driver always links `libm` unless building a shared library, see https://github.com/llvm/llvm-project/blob/c998106a7fea2b11bee250dd1f92ed4418a08c5a/clang/lib/Driver/ToolChains/Solaris.cpp#L253. That explains why this issue only manifests in the `BUILD_SHARED_LIBS` mode when targeting Solaris. Is this behavior intentional? Could we change the Solaris driver to behave like other platforms and always link `libm` in the C++ mode?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158846



More information about the llvm-commits mailing list