Commit 9d20489
committed
[Driver] Use AddRunTimeLibs on Solaris
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`.1 parent 03c2862 commit 9d20489
File tree
2 files changed
+16
-10
lines changed- clang
- lib/Driver/ToolChains
- test/Driver
2 files changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 246 | + | |
| 247 | + | |
249 | 248 | | |
250 | | - | |
251 | | - | |
252 | | - | |
| 249 | + | |
253 | 250 | | |
254 | 251 | | |
255 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
| |||
0 commit comments