build-compiler-rt: Avoid finding an unrelated LLVMConfig.cmake

Since 23c665371a98c7a16765d12bf2db19b0626b7181 in llvm-project
(Nov 2, 2022), compiler-rt uses CMake's find_package() for
finding potentially installed LLVM files, instead of using
llvm-config.

If the surrounding distribution does have an unrelated install
of LLVM packages, compiler-rt's CMake files would find this, and
add include directories from it into the include paths used
when building compiler-rt.

The ORC runtimes include libc++ headers, and those error out
on these unexpected include topologies (when libc++'s cstddef
includes stddef.h and expects to get libc++'s stddef.h, but ends
up getting a different stddef.h included). (Without this,
it wouldn't have been noticed that the build ends up using a
mismatched sysroot's headers.)

This fixes building in msys2 in the clang64 environment, where
the base toolchain packages end up including LLVM packages,
including LLVMConfig.cmake.

This fixes the same issue as
3b96433cdf did, for the new form of
compiler-rt cmake files.
This commit is contained in:
Martin Storsjö committed 2022-11-03 11:49:05 +02:00
1 parent e934cba58e
commit 486dcf3227
1 file changed
+3
+3
View File
@@ -111,6 +111,9 @@ for arch in $ARCHS; do
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=TRUE \
-DCOMPILER_RT_BUILD_BUILTINS=$BUILD_BUILTINS \
-DLLVM_CONFIG_PATH="" \
-DCMAKE_FIND_ROOT_PATH=$PREFIX/$arch-w64-mingw32 \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \
-DSANITIZER_CXX_ABI=libc++ \
-DCMAKE_C_FLAGS_INIT="$CFGUARD_CFLAGS" \
-DCMAKE_CXX_FLAGS_INIT="$CFGUARD_CFLAGS" \