[PATCH] D155294: [Driver][RISCV] Find baremetal multilibs using YAML for GNU toolchain

Michael Platings via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 14 14:15:21 PDT 2023


michaelplatings added a comment.

Hi Joe, it's nice to see multilib.yaml getting some adoption :)

> For the RISCVMultilibFlags, the mabi flag is used in combination with all the march extension features (e.g +m). Notably, this doesn't align with the current arm/aarch64 multilib flags, which all flags corresponding to the command line flag. E.G -march=. Does this violate a particular design decision, or can any target decide on whatever multilib flags they want?

Multilib flags must be valid command line options. So as `+a` is not a valid command line option, it should not be used as a multilib flag.

That said, I'm very aware that it would be desirable to specify attributes independently of command line options, so I think there's room for the design to grow.

> The location of multilib.yaml for a gnu toolchain is in the lib directory of the sysroot. E.G riscv64-unknown-elf/lib/multilib.yaml. This differs from the baremetal location of "lib/clang-runtimes".

The multilib.yaml design is agnostic to such decisions. If you can guarantee that all libraries will always use the exact same header files then it could make sense to have multilib apply only to libs. For the BareMetal toolchain I wanted to keep the flexibility of allowing different headers to be associated with each library.

> Does it make more sense to implement finding multilibs using yaml for riscv in the baremetal toolchain first? I was planning on doing it after.

No strong opinion from me on this one. Doing BareMetal first might lend itself to a more consistent end result.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155294



More information about the cfe-commits mailing list