diff --git a/llvm14.changes b/llvm14.changes index 2fea5fe..d696c11 100644 --- a/llvm14.changes +++ b/llvm14.changes @@ -37,6 +37,9 @@ Sun Apr 3 13:42:27 UTC 2022 - Aaron Puchert can't have multiple LLVM versions generate the same package, we prefix it for the non-default LLVM with a mechanism inspired by the GCC packaging. +- Patch exported clang/ClangTargets-relwithdebinfo.cmake to refer + to libclang only by soname, because the installed library might + be newer than the one originally build with the package. - Use the same mechanism to for libc++ and package Clang scripts only for the default version. This means we'll no longer have to touch the package when a new major version comes out. diff --git a/llvm14.spec b/llvm14.spec index 2d093d6..91c0cae 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -1074,6 +1074,11 @@ sed -i "$( done )" %{buildroot}%{_libdir}/cmake/{llvm/LLVMExports,clang/ClangTargets}-relwithdebinfo.cmake +# For libclang, have the CMake export list refer to the library via soname. +# The original library might not be available. (We might have a newer version.) +sed -i "s|\"\${_IMPORT_PREFIX}/%{_lib}/libclang.so.%{_relver}\"|\"\${_IMPORT_PREFIX}/%{_lib}/libclang.so.%{_soclang}\"|g" \ + %{buildroot}%{_libdir}/cmake/clang/ClangTargets-relwithdebinfo.cmake + # rpm macro for version checking mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.llvm <