[PATCH] D95755: [ELF] Support a few elf32lriscv_* & elf64lriscv_* emulations

Jim Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 31 21:07:11 PST 2021


jimw added a comment.

When you configure GNU ld, you specify a default emulation, which in turn specifies the default built-in paths.  So if an OS is ilp32f by default, then just calling ld will work.  But we still need a way to handle cross compilers to other ABIs, and we do that via emulations.

On an x86 system, we have 3 emulations, because we have 3 ABIs.  One for 32-bit code, one for 64-bit code, and one for the x32 ABI.  On an MIPS system we have 3 emulations because we have 3 ABIs.  One for 32-bit code, one for 64-bit code, and one for N32 ABI.  On RISC-V, we have 6 ABIs, so we have 6 emulations.

An OS distro has many thousands of packages, and not all of them use ld the way that you might expect.  If you don't want to fix an entire OS distro to use ld correctly, then I would argue that you need the emulations, because this is how binutils has traditionally solved this problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95755/new/

https://reviews.llvm.org/D95755



More information about the llvm-commits mailing list