This is an archive of the discontinued LLVM Phabricator instance.

[mips] Explicitly specify the linker emulation for MIPS on FreeBSD.
ClosedPublic

Authored by bsdjhb on Jun 22 2018, 2:57 PM.

Details

Summary

FreeBSD's mips64 builds O32 binaries for /usr/lib32 by default and
thus needs to be able to link O32 binaries which requires an explicit
linker emulation. Go ahead and list all the linker emulation variants
for MIPS so that any supported MIPS ABI binary can be linked by any
linker support MIPS.

Diff Detail

Repository
rL LLVM

Event Timeline

bsdjhb created this revision.Jun 22 2018, 2:57 PM
atanasyan added inline comments.Jun 26 2018, 4:27 AM
lib/Driver/ToolChains/FreeBSD.cpp
197 ↗(On Diff #152545)

Does it make a sense to handle N32 ABI case here?

bsdjhb added inline comments.Jun 26 2018, 9:12 AM
lib/Driver/ToolChains/FreeBSD.cpp
197 ↗(On Diff #152545)

For whatever reason, FreeBSD only supports N32 on big-endian. However, binutils does ship elf32ltsmipsn32_fbsd linker scripts after all, so I could handle little-endian N32 here.

atanasyan accepted this revision.Jun 26 2018, 9:14 AM
atanasyan added inline comments.
lib/Driver/ToolChains/FreeBSD.cpp
197 ↗(On Diff #152545)

LGTM with handling the elf32ltsmipsn32_fbsd case.

This revision is now accepted and ready to land.Jun 26 2018, 9:14 AM
bsdjhb updated this revision to Diff 152955.Jun 26 2018, 1:58 PM
  • Add N32EL.
This revision was automatically updated to reflect the committed changes.