[libc-commits] [libc] [libc] Include Linux kernel headers in the full build (PR #97486)

Roland McGrath via libc-commits libc-commits at lists.llvm.org
Tue Jul 2 14:54:55 PDT 2024


================
@@ -54,6 +54,9 @@ function(_get_common_compile_options output_var flags)
         list(APPEND compile_options "-isystem${COMPILER_RESOURCE_DIR}/include")
         list(APPEND compile_options "-nostdinc")
       endif()
+      if(LIBC_TARGET_OS_IS_LINUX)
+        list(APPEND compile_options "-idirafter${LIBC_KERNEL_HEADERS}")
----------------
frobtech wrote:

It merits a comment about why we want to use `-idirafter`, which is in case it's a directory like `/usr/include` that might contain other headers that we don't want to risk preempting libc's own headers.

https://github.com/llvm/llvm-project/pull/97486


More information about the libc-commits mailing list