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

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


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

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