[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 20:29:07 PST 2021


jimw added a comment.

The binutils folks used to make a joke "The correct way to spell GNU ld is GCC".  Use of ld directly is discouraged.  However, we do have default paths in the linker, and those paths must be correct.  There are some situations where calling ld directly is not hard.  And there are people with 20 year old code that uses ld directly that still needs to work if it isn't wrong.  So I believe we need the emulations.

The emulations are only visible between gcc and ld.  If you don't plan to support using gcc with lld then you don't need the emulations.  Or we could have a configure option or command line option to tell gcc that it will be used with lld instead of ld,, and then change the emulation names depending on which linker is being used.  I see that we already have the -fuse-ld= option in gcc that we could use.  There are also --enable-ld=X and --enable-gold configure options, but they don't seem to do much, other than setting a configure variable to give the name of the ld to use.  It seems to be primarily useful if doing a combined tree build (binutils+gcc) in which case gcc needs to know which of the two linkers (l.d.bfd or gold) to use.  It is also used to simplify some feature tests, for features which are known to be supported in gold and/or bfd.  Anyways, it doesn't seem to be used to control how gcc emits linker options.  But we could extend it for that use.


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