This is an archive of the discontinued LLVM Phabricator instance.

ELF: accept -m elf_amd64 as an alias for -m elf_x86_64
ClosedPublic

Authored by emaste on Sep 8 2016, 10:52 AM.

Details

Summary

In the FreeBSD world x86_64 still has its original name, amd64. Accept it as an alias.

Issue encountered while trying to link the FreeBSD kernel (modules) with lld, with D24060 and a build patch to always set -m (https://reviews.freebsd.org/D7837).

Diff Detail

Repository
rL LLVM

Event Timeline

emaste updated this revision to Diff 70726.Sep 8 2016, 10:52 AM
emaste retitled this revision from to ELF: accept -m elf_amd64 as an alias for -m elf_x86_64.
emaste updated this object.
emaste added reviewers: ruiu, rafael, davide.
emaste added a subscriber: lld.
davide accepted this revision.Sep 8 2016, 11:02 AM
davide edited edge metadata.

I think this is OK.

This revision is now accepted and ready to land.Sep 8 2016, 11:02 AM
ruiu added inline comments.Sep 8 2016, 11:03 AM
test/ELF/emulation.s
32–34 ↗(On Diff #70726)

Instead of adding "AMD64:" lines, can you reuse exiting "X86-64"? I think the output will be the same.

emaste added inline comments.Sep 8 2016, 12:28 PM
test/ELF/emulation.s
32–34 ↗(On Diff #70726)

It's not completely identical -- note the OS/ABI. Right now I could probably change the triple=x86_64-unknown-freebsd to -triple=x86_64-unknown-linux and switch to elf_amd64 from elf_amd64_fbsd, and then reuse the X86-64 lines.

However, as the amd64 case is somewhat FreeBSD-specific I'd prefer to leave the FreeBSDisms in this test case and leave it as elf_amd64_fbsd.

ruiu accepted this revision.Sep 8 2016, 12:30 PM
ruiu edited edge metadata.

Makes sense. LGTM.

This revision was automatically updated to reflect the committed changes.