diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2020-08-13 22:42:58 +0200 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2020-08-13 22:42:58 +0200 |
commit | f59bec7acb8228fc215fca3ee1e524c38083c50b (patch) | |
tree | 4da3f9daa8c9cf6b7ca7d41f5885620e55a12dfb /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 18910c4cb5d4e59ef25f4b8b48fcbd3146833645 (diff) | |
download | llvm-f59bec7acb8228fc215fca3ee1e524c38083c50b.zip llvm-f59bec7acb8228fc215fca3ee1e524c38083c50b.tar.gz llvm-f59bec7acb8228fc215fca3ee1e524c38083c50b.tar.bz2 |
[clang][Driver] Default to /usr/bin/ld on Solaris
`clang` currently requires the native linker on Solaris:
- It passes `-C` to `ld` which GNU `ld` doesn't understand.
- To use `gld`, one needs to pass the correct `-m EMU` option to select
the right emulation. Solaris `ld` cannot handle that option.
So far I've worked around this by passing `-DCLANG_DEFAULT_LINKER=/usr/bin/ld`
to `cmake`. However, if someone forgets this, it depends on the user's
`PATH` whether or not `clang` finds the correct linker, which doesn't make
for a good user experience.
While it would be nice to detect the linker flavor at runtime, this is more
involved. Instead, this patch defaults to `/usr/bin/ld` on Solaris. This
doesn't work on its own, however: a link fails with
clang-12: error: unable to execute command: Executable "x86_64-pc-solaris2.11-/usr/bin/ld" doesn't exist!
I avoid this by leaving absolute paths alone in `ToolChain::GetLinkerPath`.
Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D84029
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions