Install libunwindo.so.1 in %{_libdir}

Keep the unversioned name in a private location, but make sure the versioned
one live in a default location. That way we're still compatible with clang -unwindlib=libunwind
This commit is contained in:
serge-sans-paille 2022-09-08 12:42:56 +02:00
parent 245675b2db
commit 048172c679

View File

@ -8,7 +8,7 @@
Name: llvm-libunwind
Version: %{libunwind_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: LLVM libunwind
License: ASL 2.0 or NCSA or MIT
@ -82,12 +82,22 @@ Documentation for LLVM libunwind
%cmake_install
# We can't install on default location because that would conflict with
# We can't install the unversionned path on default location because that would conflict with
# https://src.fedoraproject.org/rpms/libunwind
#
# The versionned path has a different soname (libunwind.so.1 compared to
# libunwind.so.8) so they can live together in %{_libdir}
#
# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't
# have the exact same ABI has gcc's libunwind (it actually provides a subset).
rm %{buildroot}%{_libdir}/libunwind.so
mkdir -p %{buildroot}/%{_libdir}/llvm-unwind/
mv %{buildroot}%{_libdir}/libunwind* %{buildroot}/%{_libdir}/llvm-unwind/
pushd %{buildroot}/%{_libdir}/llvm-unwind
ln -s ../libunwind.so.1.0 libunwind.so
popd
# Same applies to the documentation
mv %{buildroot}%{_docdir}/libunwind/libunwind %{buildroot}%{_docdir}/llvm-libunwind
@ -100,10 +110,11 @@ mv %{buildroot}%{_docdir}/libunwind/libunwind %{buildroot}%{_docdir}/llvm-libunw
%files
%license LICENSE.TXT
%dir %{_libdir}/llvm-unwind
%{_libdir}/llvm-unwind/libunwind.so.*
%{_libdir}/libunwind.so.1
%{_libdir}/libunwind.so.1.0
%files devel
%dir %{_libdir}/llvm-unwind
%{_libdir}/llvm-unwind/libunwind.so
%files doc
@ -112,6 +123,9 @@ mv %{buildroot}%{_docdir}/libunwind/libunwind %{buildroot}%{_docdir}/llvm-libunw
%doc %{_docdir}/llvm-libunwind/html
%changelog
* Thu Sep 8 2022 sguelton@redhat.com - 14.0.5-2
- Install versionned library in standard location
* Mon Aug 29 2022 sguelton@redhat.com - 14.0.5-1
- Update to LLVM 14.0.5