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

Kito Cheng via All-commits all-commits at lists.llvm.org
Sun Feb 20 23:25:53 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1f17b0a9ea0d467eaa9589cc28db2787efe3ebf
      https://github.com/llvm/llvm-project/commit/c1f17b0a9ea0d467eaa9589cc28db2787efe3ebf
  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 (Recommit again)

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

The recommit fixes the Windows build failure due to path issue.




More information about the All-commits mailing list