[PATCH] D128625: [RISCV][Driver] Fix baremetal `GCCInstallation` paths

Anton Afanasyev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 01:22:01 PDT 2022


anton-afanasyev created this revision.
anton-afanasyev added reviewers: MaskRay, kito-cheng, asb.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, abidh, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson.
Herald added a project: All.
anton-afanasyev requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD.
Herald added a project: clang.

  In general gcc toolchain folder contains several targets, for instance,
  baremetal and Linux ones. The precommitted tests address this case by
  adding `riscv64-unknown-linux-gnu/` to toolchain folder. This breaks driver's
  include and lib paths, since riscv baremetal triple is now normalized to
  "riscv{32|64}-unknown-unknown-elf" rather than just to "riscv{32|64}-unknown-elf",
  and `GCCInstallation` uses this search priority: "riscv{32|64}-unknown-linux-gnu",
  "riscv{32|64}-linux-gnu", "riscv{32|64}-unknown-elf", choosing Linux target.
  
  This patch fixes this issue by passing triple alias for baremetal target.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128625

Files:
  clang/lib/Driver/ToolChains/RISCVToolchain.cpp
  clang/test/Driver/riscv32-toolchain.c
  clang/test/Driver/riscv64-toolchain.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128625.440120.patch
Type: text/x-patch
Size: 20032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220627/b5cc4bdf/attachment-0001.bin>


More information about the cfe-commits mailing list