[all-commits] [llvm/llvm-project] 079d13: [RISCV] Fix the include search path order between ...

Kito Cheng via All-commits all-commits at lists.llvm.org
Sun Feb 20 22:07:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 079d13668bf1b7f929f1897af90f64caae41c81d
      https://github.com/llvm/llvm-project/commit/079d13668bf1b7f929f1897af90f64caae41c81d
  Author: Kito Cheng <kito.cheng at sifive.com>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/RISCVToolchain.cpp
    A clang/test/Driver/Inputs/resource_dir/include/.keep
    M clang/test/Driver/riscv32-toolchain.c
    M clang/test/Driver/riscv64-toolchain.c

  Log Message:
  -----------
  [RISCV] Fix the include search path order between sysroot and resource folder

Resource folder[1] should include before sysroot[2] in general (Linux clang
toolchain, BareMetal clang toolchain, and GCC using that order), and that
prevent sysroot's header file override resource folder's one, this change is
reference from BareMetal::AddClangSystemIncludeArgs at BareMetal.cpp[3].

And also fix the behavior of `-nobuiltininc`.

[1] Include path from resource folder is something like this: `<toolchain-path>/lib/clang/13.0.0/include/`
[2] Include path from sysroot is something like this: `<toolchain-path>/riscv32-unknown-elf/include`
[3] https://github.com/llvm/llvm-project/blob/llvmorg-13.0.1/clang/lib/Driver/ToolChains/BareMetal.cpp#L193

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D119837




More information about the All-commits mailing list