[cfe-dev] Cross-compiling with Clang and LLD fails trying to call GCC

waddlesplash via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 16 10:56:12 PDT 2018


On Thu, Aug 16, 2018 at 5:39 AM Peter Smith <peter.smith at linaro.org> wrote:
> I have a suspicion that this may be down to how the Haiku toolchain is
> implemented in clang for -target x86_64-unknown-haiku . Taking a brief
> look in llvm/tools/clang/lib/Driver/Toolchains/Haiku.cpp and tracing
> the inherited classes back through to Generic_ELF and Generic_GCC it
> looks like the buildLinker is using tools::gcc::Linker() which looks
> like it will always call gcc as the linker driver. The Linux toolchain
> uses tools::gnutools::Linker() which does call ld directly. It may be
> possible that -fuse-ld=lld isn't supported with the way the Haiku
> driver is implemented.
>
> I haven't checked this out beyond a few minutes of searching, but it
> may be worth taking a look at that part of the clang code yourself to
> confirm. I've often found when cross-compiling it is often best to go
> back to the ToolChain class for my target when it isn't behaving like
> I'd expect.
>
> Good luck.

Ah, indeed, that is the issue. Thanks for the tip!

-waddlesplash



More information about the cfe-dev mailing list