Skip to content

Commit 43bd7e3

Browse files
[Runtimes][libc] Include kernel headers when using RUNTIMES_USE_LIBC
When setting RUNTIMES_USE_LIBC=libc we pass -nostdlibinc if the compiler supports it. This causes compilation failures when trying to build libc++ as libc will try and reference kernel headers in its own headers that it now cannot find. Explicitly reference the kernel headers so the compiler can find them. Reviewers: vonosmas, petrhosek, #reviewers-libcxx, michaelrj-google Reviewed By: michaelrj-google Pull Request: #165114
1 parent e7a23c4 commit 43bd7e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

runtimes/cmake/Modules/HandleLibC.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ elseif (RUNTIMES_USE_LIBC STREQUAL "llvm-libc")
3030
check_cxx_compiler_flag(-nostdlibinc CXX_SUPPORTS_NOSTDLIBINC_FLAG)
3131
if(CXX_SUPPORTS_NOSTDLIBINC_FLAG)
3232
target_compile_options(runtimes-libc-headers INTERFACE "-nostdlibinc")
33+
target_compile_options(runtimes-libc-headers INTERFACE "-idirafter${LIBC_KERNEL_HEADERS}")
3334
endif()
3435

3536
add_library(runtimes-libc-static INTERFACE)

0 commit comments

Comments
 (0)