From 71aa74debd07c6b2c1db6687133b33e9b12a83d5 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 4 Nov 2022 16:04:45 +0100 Subject: [PATCH] Build test deps separately to avoid LD_LIBRARY_PATH interference Otherwise invocations of host clang will use the newly built libraries, which will use a non-existent resource directory, and thus cause headers like stddef.h not to be found. --- clang.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang.spec b/clang.spec index 11164c7..5927730 100644 --- a/clang.spec +++ b/clang.spec @@ -469,6 +469,10 @@ ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format %check %if %{without compat_build} %if %{with check} +# Build test dependencies separately, to prevent invocations of host clang from being affected +# by LD_LIBRARY_PATH below. +%cmake_build --target clang-test-depends \ + ExtraToolsUnitTests ClangdUnitTests ClangIncludeCleanerUnitTests ClangPseudoUnitTests # requires lit.py from LLVM utilities # FIXME: Fix failing ARM tests LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \