[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: https://github.com/llvm/llvm-project/pull/165114
This commit is contained in:
parent
e7a23c4020
commit
43bd7e3bb9
@ -30,6 +30,7 @@ elseif (RUNTIMES_USE_LIBC STREQUAL "llvm-libc")
|
||||
check_cxx_compiler_flag(-nostdlibinc CXX_SUPPORTS_NOSTDLIBINC_FLAG)
|
||||
if(CXX_SUPPORTS_NOSTDLIBINC_FLAG)
|
||||
target_compile_options(runtimes-libc-headers INTERFACE "-nostdlibinc")
|
||||
target_compile_options(runtimes-libc-headers INTERFACE "-idirafter${LIBC_KERNEL_HEADERS}")
|
||||
endif()
|
||||
|
||||
add_library(runtimes-libc-static INTERFACE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user