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

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 07:34:13 PDT 2023


ro added a comment.

I don't think omitting `-lm` when building shared objects was intentional.  Unfortunately, the original authors of the Solaris driver code apparently didn't believe in comments, so it's hard to say why the deviate from other targets.  Add to that the multiyear neglect of that code and you get the current situation.  I've recently (while working on [[  https://github.com/llvm/llvm-project/pull/65487| [Driver] Wrap -lgcc_s in -z ignore/-z record on Solaris ]]) noticed that unconditional linking executables with `-lm`, but didn't make the connection.

As it turns out, when one follows the lead of `Gnu.cpp` and links with `-lm` for C++ code, the `libm` parts of the current patch become unnecessary, only leaving the (hopefully uncontroversial) `libkstat` part in `TargetParser`.

I'll post the Solaris driver patch shortly.


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