From ba657342529e4cb5448b9f839768ff0a1f92ed280833ae84f49fad7a32ba7885 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Fri, 23 Aug 2024 22:46:50 +0000 Subject: [PATCH] - Split off clang shared runtime libraries into libclang_rtX, so that they can be used by other packages without requiring the entire compiler tool chain. This is still not ergonomical: the libraries don't sit in %{_libdir}, so an RPATH or setting LD_LIBRARY_PATH is required, and they don't have an SO version, so zypper won't know which version to is needed. (boo#1225784) OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm18?expand=0&rev=24 --- llvm18.changes | 10 ++++++++++ llvm18.spec | 31 ++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/llvm18.changes b/llvm18.changes index ec25935..e7a4421 100644 --- a/llvm18.changes +++ b/llvm18.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Aug 23 21:41:32 UTC 2024 - Aaron Puchert + +- Split off clang shared runtime libraries into libclang_rtX, so + that they can be used by other packages without requiring the + entire compiler tool chain. This is still not ergonomical: the + libraries don't sit in %{_libdir}, so an RPATH or setting + LD_LIBRARY_PATH is required, and they don't have an SO version, + so zypper won't know which version to is needed. (boo#1225784) + ------------------------------------------------------------------- Tue Aug 20 21:20:37 UTC 2024 - Aaron Puchert diff --git a/llvm18.spec b/llvm18.spec index a04d2ef..eafabfd 100644 --- a/llvm18.spec +++ b/llvm18.spec @@ -531,6 +531,7 @@ This package contains documentation for the LLVM infrastructure. Summary: CLANG frontend for LLVM Group: Development/Languages/C and C++ URL: https://clang.llvm.org/ +Requires: libclang_rt%{_sonum} Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: clang-tools @@ -543,6 +544,15 @@ Suggests: libc++-devel %description -n clang%{_sonum} This package contains the clang (C language) frontend for LLVM. +%package -n libclang_rt%{_sonum} +Summary: Clang shared runtime libraries +Group: System/Libraries +URL: https://compiler-rt.llvm.org/ + +%description -n libclang_rt%{_sonum} +The runtime libraries needed to run programs compiled with the -shared-libsan +of Clang. Also known as compiler-rt. + %package -n clang-tools Summary: Tools for Clang Group: Development/Languages/C and C++ @@ -1626,12 +1636,27 @@ fi %{lapply -p man_sonum_path %clang_manfiles} %{lapply -p ghost_ua_man_link %clang_manfiles} -%dir %{_libdir}/clang/ -%dir %{_libdir}/clang/%{_sonum}/ +%dir %{_libdir}/clang +%dir %{_libdir}/clang/%{_sonum} +%dir %{_libdir}/clang/%{_sonum}/lib +%dir %{_libdir}/clang/%{_sonum}/lib/linux +%{_libdir}/clang/%{_sonum}/lib/linux/clang-rt.*.o +%{_libdir}/clang/%{_sonum}/lib/linux/libclang_rt.*.a +%{_libdir}/clang/%{_sonum}/lib/linux/libclang_rt.*.a.syms +%ifarch aarch64 %{arm} ppc64le x86_64 +%{_libdir}/clang/%{_sonum}/lib/linux/liborc_rt-*.a +%endif + +%files -n libclang_rt%{_sonum} +%license CREDITS.TXT LICENSE.TXT +%dir %{_libdir}/clang +%dir %{_libdir}/clang/%{_sonum} %ifarch aarch64 riscv64 x86_64 %{_libdir}/clang/%{_sonum}/bin %endif -%{_libdir}/clang/%{_sonum}/lib +%dir %{_libdir}/clang/%{_sonum}/lib +%dir %{_libdir}/clang/%{_sonum}/lib/linux +%{_libdir}/clang/%{_sonum}/lib/linux/libclang_rt.*.so # The sanitizer runtime is not available for ppc. %ifnarch ppc %{_libdir}/clang/%{_sonum}/share