[PATCH] D74704: Support -fuse-ld=lld for riscv
James Clarke via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 17 06:43:25 PST 2020
jrtc27 added a comment.
In D74704#1878921 <https://reviews.llvm.org/D74704#1878921>, @lenary wrote:
> I am worried about the interaction between `-fuse-ld=lld` and linker relaxation (which is not supported by LLD, as I understand it)
>
> 1. clang could ignore `-fuse-ld=lld` when linker relaxation is enabled
> 2. clang could ignore (disable) linker relaxation if `-fuse-ld=lld` is used
>
> At the very least, a warning of some kind should be emitted if linker relaxation is combined with `-fuse-ld=lld`.
This isn't a new problem. The Linux and FreeBSD toolchains already support -fuse-ld=lld properly, it's just the bare metal one that didn't. People also generally don't include -fuse-ld=lld in CFLAGS, only LDFLAGS, and there's no need to include -mno-relax in LDFLAGS, so I suspect you wouldn't catch many issues. These days (https://reviews.llvm.org/D71820), LLD will give you an informative error (rather than silently mis-linking) if you forget -mno-relax.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74704/new/
https://reviews.llvm.org/D74704
More information about the cfe-commits
mailing list