[PATCH] D76452: Use LLD by default for Android.
Stephen Hines via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 26 15:14:53 PDT 2020
srhines added a comment.
In D76452#1945029 <https://reviews.llvm.org/D76452#1945029>, @MaskRay wrote:
> In D76452#1944786 <https://reviews.llvm.org/D76452#1944786>, @srhines wrote:
>
> > In D76452#1944733 <https://reviews.llvm.org/D76452#1944733>, @MaskRay wrote:
> >
> > > Another approach will be `-DCLANG_DEFAULT_LINKER=lld`. It provides a default value for `-fuse-ld=`.
> >
> >
> > How does that work for Darwin builds? Is lld fully supported for MachO at this point, or will Clang still choose to use the preferred Apple linker?
>
>
> I am not clear about your use case. lld can be used as ELF/Mach-O/COFF/WebAssembly linker. If you want to build ELF objects, -fuse-ld=lld (via clangDriver) or configure clang with -DCLANG_DEFAULT_LINKER=lld.
> If you want to build Mach-O objects, lld's current Mach-O port lacks features (and will be removed). The new Mach-O port is still under development.
Right, so this is a problem when we ship a multi-target toolchain that does support targeting regular Linux, Windows, and Darwin (for host tools) in addition to Android. If we switched `CLANG_DEFAULT_LINKER`, then we would need to pass explicit flags to any Darwin builds to go back to using the system linker.
> To cross build ELF object on macOS, another alternative is a wrapper named `ld` which invokes `lld -flavor gnu "$@"`
@danalbert Would this kind of idea work with your other reverted patch? I'm not sure exactly what broke on those builds.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76452/new/
https://reviews.llvm.org/D76452
More information about the cfe-commits
mailing list