From 1f3c19e07c378a3ec01e91ffb4b98e9c8be21c66 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 25 Jan 2024 14:57:03 -0800 Subject: libcxx: Pass LLVM_RUNTIME_TARGETS LLVM_RUNTIME_TARGETS will define the location of triple for target correctly. This is an effort to fix the case where cross compiler will lurk into host libc++ header if libcxx-native is staged for a given recipe e.g. graphviz, it works ok if --sysroot is specified because thats how it tries to find if its a cross sysroot or not but without that it has mind of its own. e.g. try x86_64-yoe-linux-musl-clang++ -stdlib=libc++ ~/tests/iosfd.cpp -v -c ... clang -cc1 version 18.1.0 based upon LLVM 18.1.0 default target x86_64-unknown-linux-gnu ignoring nonexistent directory "/usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../x86_64-pc-linux-gnu/include" ignoring nonexistent directory "/include" /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/graphviz/8.1.0/recipe-sysroot-native/usr/bin/../include/c++/v1 /usr/local/include /usr/include /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/graphviz/8.1.0/recipe-sysroot-native/usr/lib/clang/18/include End of search list. ... See where it is looking for c++ headers. Its not an issue for OE right now, since we always specify --sysroot in CC but still would be good to handle it amicably if possible Signed-off-by: Khem Raj --- recipes-devtools/clang/libcxx_git.bb | 1 + 1 file changed, 1 insertion(+) (limited to 'recipes-devtools/clang/libcxx_git.bb') diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 3d5ce54..9d4f033 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -69,6 +69,7 @@ EXTRA_OECMAKE += "\ -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib${LLVM_LIBDIR_SUFFIX} \ -S ${S}/runtimes \ -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \ + -DLLVM_RUNTIME_TARGETS=${HOST_SYS} \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ " -- cgit v1.2.3-54-g00ecf