<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 28, 2016 at 2:56 PM, Richard Pennington via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With all the talk about using lld on the list, I thought it would be interesting to try using it in my clang based ELLCC cross compilation tool chain. <a href="http://ellcc.org" rel="noreferrer" target="_blank">http://ellcc.org</a><br>
<br>
The change was simple, since I use configuration files to tell clang how to compile, where to find libraries, etc. I described the config files here: <a href="http://ellcc.org/blog/?p=13246" rel="noreferrer" target="_blank">http://ellcc.org/blog/?p=13246</a><br>
<br>
All I had to do was change the linker executable definition for each target:<br>
<br>
linker:<br>
<br>
#exe: $E/ecc-ld$X<br>
<br>
exe: $E/ld.lld$x<br>
<br>
(where $E is the executable directory where the compiler was found and $X is the executable extension, "" under Linux)<br>
<br>
Here are the results of linking a program for Linux:<br>
<br>
ARM32 v6: Good<br>
<br>
ARM32 v7: Good<br>
<br>
ARM32 big endian: Not supported by lld, no armelfb_linux_eabi emulation mode.<br>
<br>
Aarch64: Good<br>
<br>
MIPS 32 little and big endian: Good<br>
<br>
MIPS64 big endian: Good<br>
<br>
PPC32: lld failed with a bad relocation type.<br>
<br>
PPC64 little endian: Not supported by lld, no elf64lppc emulation mode.<br>
<br>
X86 32 and 64: Good<br>
<br>
As a test I built clang to run native on ARMv6, ARMv7, Aarch64, MIPS32, MIPS64, and x86_84 Linux: Good<br>
<br>
Very cool!<br></blockquote><div><br></div><div>Awesome results!</div><div><br></div><div>I wonder if ARM32 BE is a real thing. I know that the processor is bi-endian, but is there any system that uses ARM32 in big-endian mode?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I use ld for mingw-w64 targets. Is there a mode for the COFF lld that makes it also act like ld?<br></blockquote><div><br></div><div>Unfortunately, no. You can use the GNU compatible driver on Windows, but it always produces ELF.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now I have to look into how lld supports Linker scripts for my non-Linux targets.<br>
<br>
-Rich<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div>