-
-
Notifications
You must be signed in to change notification settings - Fork 258
Open
Description
I'm trying to cross-compile from MacOS arm64 to Linux x86-64 while using libstdc++ instead of libc++. I've created a sysroot based on Debian Trixie with libstdc++. The C++ headers are located in: /usr/include/c++/14 The sysroot was created with sudo debootstrap --arch=amd64 --variant=minbase stable sysroot-deb-amd64-stable.
When I compile my project, clang is unable to find the C++ headers.
This is the search path it uses.
#include <...> search starts here:
external/toolchains_llvm++llvm+llvm_toolchain_llvm/lib/clang/20/include
external/+_repo_rules+org_chromium_sysroot_linux_amd64/usr/include/x86_64-linux-gnu
external/+_repo_rules+org_chromium_sysroot_linux_amd64/usr/include
End of search list.
However, when I use the Debian Stretch sysroot that is used in toolchains_llvm tests, I observe these search paths:
#include <...> search starts here:
external/+_repo_rules2+org_chromium_sysroot_linux_amd64/usr/lib/gcc/x86_64-linux-gnu/6/../../../../include/c++/6
external/+_repo_rules2+org_chromium_sysroot_linux_amd64/usr/lib/gcc/x86_64-linux-gnu/6/../../../../include/x86_64-linux-gnu/c++/6
external/+_repo_rules2+org_chromium_sysroot_linux_amd64/usr/lib/gcc/x86_64-linux-gnu/6/../../../../include/c++/6/backward
external/toolchains_llvm++llvm+llvm_toolchain_llvm/lib/clang/20/include
external/+_repo_rules2+org_chromium_sysroot_linux_amd64/usr/include/x86_64-linux-gnu
external/+_repo_rules2+org_chromium_sysroot_linux_amd64/usr/include
End of search list.
What am I missing from my sysroot that is causing Clang to not find the installed headers? What workaround can I use in Bazel to correctly configure the llvm toolchain?
clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: external/toolchains_llvm++llvm+llvm_toolchain_llvm/bin
Found candidate GCC installation: external/+_repo_rules+org_chromium_sysroot_linux_amd64/lib/gcc/x86_64-linux-gnu/14
Selected GCC installation: external/+_repo_rules+org_chromium_sysroot_linux_amd64/lib/gcc/x86_64-linux-gnu/14
Candidate multilib: .;@m64
Selected multilib: .;@m64
Metadata
Metadata
Assignees
Labels
No labels