[all-commits] [llvm/llvm-project] 1e6b0d: [Driver] Fix linking with -lm on Solaris (#65632)
Rainer Orth via All-commits
all-commits at lists.llvm.org
Thu Sep 7 10:15:10 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1e6b0df3503567488e7df2d574c90f8f31a001a2
https://github.com/llvm/llvm-project/commit/1e6b0df3503567488e7df2d574c90f8f31a001a2
Author: Rainer Orth <ro at gcc.gnu.org>
Date: 2023-09-07 (Thu, 07 Sep 2023)
Changed paths:
M clang/lib/Driver/ToolChains/Solaris.cpp
M clang/test/Driver/solaris-ld.c
Log Message:
-----------
[Driver] Fix linking with -lm on Solaris (#65632)
As noticed in D158846, the Solaris driver deviates from other targets in
that it links every executable with `-lm`, but doesn't for shared
objects. For C code, this is unnecessary, while for C++ `libm` is always
needed, even for shared objects.
This patch fixes this by following the `Gnu.cpp` precedent. It adjusts
the `solaris-ld.c` test accordingly, adding some more tests.
Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.
More information about the All-commits
mailing list