LLD for ARM

I’m seeing that LLD has the initial framework for linking AArch64 (ARM 64-bit, right?). Is there a plan or timeframe to support 32-bit ARM?

Hi Daniel,

The quick answer is "sort of".

There is interest in having lld working well on both ARM Linux and
Darwin and some people are already gathering forces to do this, but
the interest is still not *that* great to make people jump on it right
now. Are you volunteering or needing this for any project? We could
certainly do with the help, or at least understand what are your
plans, so that we can align with them.

cheers,
--renato

Right now I am working a proof of concept at work that I can use Clang and associated tools to compile for a bare metal ARM processor (Beaglebone Black). The biggest issue seems to be that we develop on Windows and most cross linkers (ld, gold) seem to only want to work on POSIX, which is not Windows. So far I have spent a day fighting binutils to get ld to compile on Windows to target ARM.

For a complete novice, what would be the expected amount of effort (days, weeks, months, years) to add support for a new target?

I ported LLD to Windows. I added a new file format, new driver, new relocation types, new linking semantics and those kind of stuffs. I remember that it took me a month or two to link a small executable, starting from having no knowledge on Windows linker, and after about six months I succeeded to self-link it. After one year it’s now able to link real large programs such as Chromium. I wanted to make it work as a drop in replacement of link.exe, so I had to work on the driver – if I only focused on the core linking it would have been shorter.

From that experience I would say that you’d probably be able to get a preliminary support of what you want in a few weeks to a few months. Of course that depends on your knowledge of the target platform, availability of the documents, etc. It shouldn’t at least take years.

Right now I am working a proof of concept at work that I can use Clang and
associated tools to compile for a bare metal ARM processor (Beaglebone
Black). The biggest issue seems to be that we develop on Windows and most
cross linkers (ld, gold) seem to only want to work on POSIX, which is not
Windows. So far I have spent a day fighting binutils to get ld to compile
on Windows to target ARM.

Nice, that's yet another use case for LLD on ARM, which is good. The
FreeBSD folks are interested in supporting it on their platform for
both x86 and ARM, other folks or looking at LLD on Darwin and I'm
trying to get Linaro to work on the Linux+ARM side. I think having
someone looking at the Windows side of things will make it a lot more
robust if we can all test each others' patches as we go.

For a complete novice, what would be the expected amount of effort (days,
weeks, months, years) to add support for a new target?

Rui gave you a good estimate, one that is close to what we had
internally: Months to get it working, a year to get it production
quality.

It may be shorter, if we count the synergy that we'll have if we all
work on it at the same time. We should also make it available (via
CMake on all platforms), so that people can easily replace bfd/gold
with it on their platforms and test.

cheers,
--renato

In case I didn't quite express it correctly, I am looking to link on
Windows for baremetal ARM.

Yes, I got that. My meaning was that, since I'm not that much
interested in bare metal ARM, and I don't use Windows, having you
doing both would be filling a lot of the blanks left by others. :slight_smile:

cheers,
--renato