[all-commits] [llvm/llvm-project] 4e81ee: [Driver] Use AddRunTimeLibs on Solaris (#137596)
Rainer Orth via All-commits
all-commits at lists.llvm.org
Sun May 4 01:26:23 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4e81ee4a158b7c8e4b468c9370abb042a59129b6
https://github.com/llvm/llvm-project/commit/4e81ee4a158b7c8e4b468c9370abb042a59129b6
Author: Rainer Orth <ro at gcc.gnu.org>
Date: 2025-05-04 (Sun, 04 May 2025)
Changed paths:
M clang/lib/Driver/ToolChains/Solaris.cpp
M clang/test/Driver/solaris-ld.c
Log Message:
-----------
[Driver] Use AddRunTimeLibs on Solaris (#137596)
When linking `libomp.so` on Solaris, I encountered
```
clang: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
```
This happens because `Solaris.cpp` (`solaris::Linker::ConstructJob`)
links `-lgcc_s` and `-lgcc` on its own instead of using the common
`CommonArgs.cpp` (`tools::AddRunTimeLibs`) which handles
`-static-libgcc` out of the box.
This patch switches to `AddRunTimeLibs` and adds a test for
`-static-libgcc` handling. In `solaris-ld.c`, a few tests had to be
adjusted because `-lgcc` is now linked before `-lgcc_s`.
Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list