This is an archive of the discontinued LLVM Phabricator instance.

[Aarch64] Fix linker emulation for Aarch64 big endian
ClosedPublic

Authored by Bharathi on Feb 5 2018, 1:14 PM.

Details

Summary

This patch fixes target linker emulation for aarch64 big endian.
aarch64_be_linux is not recognized by gnu ld. The equivalent emulation mode supported by gnu ld is aarch64linuxb.

Diff Detail

Repository
rL LLVM

Event Timeline

Bharathi created this revision.Feb 5 2018, 1:14 PM

I can confirm that binutils use aarch64linuxb as their target linux emulation and not aarch64_be_linux. I checked the original commit http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20140310/101365.html , this has references to ld-linux-aarch64_be.so which does seem to be mentioned in binutils and the directory "/lib/aarch64_be-linux-gnu" that I couldn't find any reference to, or any close equivalent of that directory mentioned in binutils. It may be worth checking that as well.

So this looks like it is the right thing to do for me, there is a chance that we may be breaking something set up by the original commit so I'll add the original committer as a reviewer as they seemed to be quite active with AArch64 BE changes.

cpirker, as the original author do you have any concerns about changing the big-endian emulation name to match binutils?

peter.smith accepted this revision.Aug 30 2018, 2:40 AM

I've been referred back to this by a colleague trying to build with big-endian clang with binutils and is seeing an error message out of binutils. I've checked that binutils from the initial commit always used aarch64linuxb and I've verified that I cannot build a aarch64_be-linux-gnu executable with binutils without this change, and I can with this change.

I've set LGTM.

This revision is now accepted and ready to land.Aug 30 2018, 2:40 AM

Committed on behalf of Bharathi r341312.

This revision was automatically updated to reflect the committed changes.