Clang MD MF emitting absolute paths

Hi there,

I’m trying to integrate a local build of GitHub - ARM-software/LLVM-embedded-toolchain-for-Arm: A project dedicated to build LLVM toolchain for 32-bit Arm embedded targets. with Bazel to build an embedded project.

I’m running into a problem where clang dependency file generation with MD/MF emits absolute paths for some system header files. Example:

hx/kern/ hx/kern/alloc.h


This is a problem because Bazel configures the toolchain with external paths to achieve hermetic builds inside a sandbox and thus doesn’t know about the absolute path file.

Does anyone know why the file is emitted with an absolute path? Is there any way I can stop that from happening?