diff --git a/baselibs.conf b/baselibs.conf index 7aee1bc..b33738a 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,12 +1,8 @@ libLLVM13 -libclang13 -libLTO13 +libclang-cpp13 llvm13-devel provides "llvm-devel- = " conflicts "otherproviders(llvm-devel-)" clang13-devel provides "clang-devel- = " conflicts "otherproviders(clang-devel-)" -llvm13-LTO-devel - provides "llvm-LTO-devel- = " - conflicts "otherproviders(llvm-LTO-devel-)" diff --git a/llvm13.changes b/llvm13.changes index 45a987e..dbb2970 100644 --- a/llvm13.changes +++ b/llvm13.changes @@ -1,3 +1,31 @@ +------------------------------------------------------------------- +Sun Apr 3 13:42:27 UTC 2022 - Aaron Puchert + +- Split up Clang libraries: libclang.so is no longer so-versioned + alongside LLVM but will stay at libclang.so.13 for now. So we + put it into a separate package from libclang-cpp.so. Since we + 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. +- 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. +- Make sure we properly clean up the clang scripts if we're not + packaging them. +- Let python3-clang use libclang.so.XX, which means we can always + build it and makes it depend on libclang instead of clang-devel. +- Fix some rpmlint issues: we don't need explicit library + dependencies that are detected automatically, and we add proper + library dependencies to the *-devel packages. +- Merge llvm-LTO-devel into llvm-devel. That's where the header + files already are, and they are hard to separate. +- Let libomp-devel no longer depend on libLLVM, and let llvm-devel + no longer depend on libomp-devel. They are independent. +- Let llvm-devel no longer depend on llvm-polly-devel but let + llvm-polly-devel depend on llvm-devel. We got that wrong. +- Remove libLTO from baselibs, it doesn't seem to be needed. +- Only suggest documentation packages. + ------------------------------------------------------------------- Sat Feb 19 15:23:13 UTC 2022 - Aaron Puchert diff --git a/llvm13.spec b/llvm13.spec index dc426a2..e4fe70d 100644 --- a/llvm13.spec +++ b/llvm13.spec @@ -21,8 +21,10 @@ %define _tagver %_relver%{?_rc:-rc%_rc} %define _minor 13.0 %define _sonum 13 +%define _itsme13 1 # Integer version used by update-alternatives %define _uaver 1301 +%define _soclang 13 %define _socxx 1 %ifarch x86_64 aarch64 %arm @@ -62,10 +64,14 @@ %bcond_with ffi %bcond_with oprofile %bcond_with valgrind -%bcond_without clang_scripts %bcond_without polly %bcond_without lld +%define _plv %{!?product_libs_llvm_ver:%{_sonum}}%{?product_libs_llvm_ver} + +# Expands to -n if we're providing the distribution default for the given package. +%define multisource() %{expand:%%{?_itsme%{expand:%%{!?product_libs_llvm_ver_%{1}:%%{_plv}}%%{?product_libs_llvm_ver_%{1}}}:-n}} + # set_jobs type memory # Set max__jobs so that every job of the given type has at least the # given amount of memory. @@ -150,11 +156,8 @@ BuildRequires: python-rpm-macros BuildRequires: python3-base BuildRequires: pkgconfig(libedit) BuildRequires: pkgconfig(zlib) -# Avoid multiple provider errors -Requires: libLLVM%{_sonum} Requires(post): update-alternatives Requires(postun):update-alternatives -Recommends: %{name}-doc # llvm does not work on s390 ExcludeArch: s390 %if %{with gold} @@ -169,6 +172,7 @@ BuildRequires: pkgconfig(valgrind) %if %{with oprofile} BuildRequires: oprofile-devel %endif +Suggests: %{name}-doc %description LLVM is a compiler infrastructure designed for compile-time, @@ -189,16 +193,11 @@ This package contains the shared libraries needed for LLVM. Summary: Header Files for LLVM Group: Development/Libraries/C and C++ Requires: %{name} = %{version} -%if %{with openmp} -Requires: libomp%{_sonum}-devel -%endif +Requires: libLLVM%{_sonum} = %{version} +Requires: libLTO%{_sonum} = %{version} Requires: libstdc++-devel Requires: libtool -Requires: llvm%{_sonum}-LTO-devel Requires: llvm%{_sonum}-gold -%if %{with polly} -Requires: llvm%{_sonum}-polly-devel -%endif Requires: pkgconfig Conflicts: llvm-devel-provider < %{version} %if %{suse_version} <= 1500 @@ -207,6 +206,8 @@ Conflicts: llvm5 Conflicts: llvm7 %endif Conflicts: cmake(LLVM) +Obsoletes: llvm%{_sonum}-LTO-devel <= %{version} +Provides: llvm%{_sonum}-LTO-devel = %{version} Provides: llvm-devel-provider = %{version} %if %{with ffi} Requires: pkgconfig(libffi) @@ -239,16 +240,13 @@ This package contains documentation for the LLVM infrastructure. Summary: CLANG frontend for LLVM Group: Development/Languages/C and C++ URL: https://clang.llvm.org/ -# Avoid multiple provider errors -Requires: libLTO%{_sonum} -Requires: libclang%{_sonum} Requires(post): update-alternatives Requires(postun):update-alternatives -Recommends: clang%{_sonum}-doc Recommends: clang-tools Recommends: gcc Recommends: glibc-devel Recommends: libstdc++-devel +Suggests: clang%{_sonum}-doc Suggests: libc++-devel %description -n clang%{_sonum} @@ -289,14 +287,28 @@ This package contains tools and scripts for using Clang, including: * scripts for using the Clang static analyzer: scan-build and scan-view, * a script for using find-all-symbols: run-find-all-symbols. -%package -n libclang%{_sonum} -Summary: Library files needed for clang -# Avoid multiple provider errors +%package %{multisource libclang%{_soclang}} libclang%{_soclang} +Summary: Clang stable C API for indexing and code completion Group: System/Libraries -Requires: libLLVM%{_sonum} +Provides: libclang%{_soclang} = %{version} +Conflicts: libclang%{_soclang} < %{version} -%description -n libclang%{_sonum} -This package contains the shared libraries needed for clang. +%description %{multisource libclang%{_soclang}} libclang%{_soclang} +This library exposes a limited C API for indexing and code completion for +code written in languages of the C family. +It is designed to be stable across major versions of LLVM. + +It corresponds to the header files in %{_includedir}/clang-c. + +%package -n libclang-cpp%{_sonum} +Summary: Clang full C++ API +Group: System/Libraries + +%description -n libclang-cpp%{_sonum} +This library exposes the full C++ API to Clang that is used to implement +all Clang tools. It is not stable across major LLVM versions. + +It corresponds to the header files in %{_includedir}/clang. %package -n clang%{_sonum}-devel Summary: CLANG frontend for LLVM (devel package) @@ -304,6 +316,8 @@ Group: Development/Libraries/C and C++ Requires: %{name}-devel = %{version} Requires: clang%{_sonum} = %{version} Requires: clang-tools >= %{version} +Requires: libclang%{_soclang} >= %{version} +Requires: libclang-cpp%{_sonum} = %{version} Conflicts: cmake(Clang) %description -n clang%{_sonum}-devel @@ -327,31 +341,14 @@ This package contains documentation for the Clang compiler. %package -n libLTO%{_sonum} Summary: Link-time optimizer for LLVM -# Avoid multiple provider errors Group: System/Libraries -Requires: libLLVM%{_sonum} %description -n libLTO%{_sonum} This package contains the link-time optimizer for LLVM. -%package LTO-devel -Summary: Link-time optimizer for LLVM (devel package) -# Avoid multiple provider errors -Group: Development/Libraries/C and C++ -Requires: %{name}-devel = %{version} -Requires: libLTO%{_sonum} -Conflicts: libLTO.so < %{version} -Provides: libLTO.so = %{version} - -%description LTO-devel -This package contains the link-time optimizer for LLVM. -(development files) - %package gold Summary: Gold linker plugin for LLVM -# Avoid multiple provider errors Group: Development/Tools/Building -Requires: libLLVM%{_sonum} Conflicts: llvm-gold-provider < %{version} Provides: llvm-gold-provider = %{version} Supplements: packageand(clang%{_sonum}:binutils-gold) @@ -361,61 +358,57 @@ This package contains the Gold linker plugin for LLVM. %package -n libomp%{_sonum}-devel Summary: MPI plugin for LLVM -# Avoid multiple provider errors Group: Development/Libraries/C and C++ -Requires: libLLVM%{_sonum} Conflicts: libomp-devel < %{version} Provides: libomp-devel = %{version} %description -n libomp%{_sonum}-devel This package contains the OpenMP MPI plugin for LLVM. -%if %{with libcxx} -%package -n libc++%{_socxx} +%package %{multisource libcxx%{_socxx}} libc++%{_socxx} Summary: C++ standard library implementation Group: System/Libraries URL: https://libcxx.llvm.org/ Requires: libc++abi%{_socxx} = %{version} +Provides: libc++%{_socxx} = %{version} -%description -n libc++%{_socxx} +%description %{multisource libcxx%{_socxx}} libc++%{_socxx} This package contains libc++, a new implementation of the C++ standard library, targeting C++11. -%package -n libc++-devel +%package %{multisource libcxx_devel} libc++-devel Summary: C++ standard library implementation (devel package) -# Avoid multiple provider errors Group: Development/Libraries/C and C++ -Requires: libc++%{_socxx} = %{version} +Requires: libc++%{_socxx} >= %{version} Requires: libc++abi-devel = %{version} Conflicts: libc++.so < %{version} Provides: libc++.so = %{version} -%description -n libc++-devel +%description %{multisource libcxx_devel} libc++-devel This package contains libc++, a new implementation of the C++ standard library, targeting C++11. (development files) -%package -n libc++abi%{_socxx} +%package %{multisource libcxxabi%{_socxx}} libc++abi%{_socxx} Summary: C++ standard library ABI Group: System/Libraries URL: https://libcxxabi.llvm.org/ +Provides: libc++abi%{_socxx} = %{version} -%description -n libc++abi%{_socxx} +%description %{multisource libcxxabi%{_socxx}} libc++abi%{_socxx} This package contains the ABI for libc++, a new implementation of the C++ standard library, targeting C++11. -%package -n libc++abi-devel +%package %{multisource libcxx_devel} libc++abi-devel Summary: C++ standard library ABI (devel package) Group: Development/Libraries/C and C++ -Requires: libc++-devel -Requires: libc++abi%{_socxx} = %{version} +Requires: libc++abi%{_socxx} >= %{version} Conflicts: libc++abi.so < %{version} Provides: libc++abi.so = %{version} -%description -n libc++abi-devel +%description %{multisource libcxx_devel} libc++abi-devel This package contains the ABI for libc++, a new implementation of the C++ standard library, targeting C++11. (development files) -%endif %package vim-plugins Summary: Vim plugins for LLVM @@ -428,16 +421,16 @@ BuildArch: noarch %description vim-plugins This package contains vim plugins for LLVM like syntax highlighting. -%package -n python3-clang +%package -n python3-clang%{_sonum} Summary: Python bindings for libclang Group: Development/Libraries/Python -Requires: clang%{_sonum}-devel = %{version} +Requires: libclang%{_soclang} >= %{version} Requires: python3-base Conflicts: %{python3_sitearch}/clang/ Provides: %{python3_sitearch}/clang/ BuildArch: noarch -%description -n python3-clang +%description -n python3-clang%{_sonum} This package contains the Python bindings to clang (C language) frontend for LLVM. @@ -477,8 +470,6 @@ BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(panel) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(zlib) -# Avoid multiple provider errors -Requires: liblldb%{_sonum} = %{version} Requires(post): update-alternatives Requires(postun):update-alternatives Recommends: python3-lldb%{_sonum} @@ -492,17 +483,13 @@ disassembler. %package -n liblldb%{_sonum} Summary: LLDB software debugger runtime library -# Avoid multiple provider errors Group: System/Libraries -Requires: libLLVM%{_sonum} -Requires: libclang%{_sonum} %description -n liblldb%{_sonum} This subpackage contains the main LLDB component. %package -n lldb%{_sonum}-devel Summary: Development files for LLDB -# Avoid multiple provider errors Group: Development/Libraries/C and C++ Requires: clang%{_sonum}-devel = %{version} Requires: liblldb%{_sonum} = %{version} @@ -520,7 +507,6 @@ This package contains the development files for LLDB. Summary: Python bindings for liblldb Group: Development/Libraries/Python BuildRequires: swig >= 3.0.11 -# Avoid multiple provider errors Requires: liblldb%{_sonum} = %{version} Requires: python3-base Requires: python3-six @@ -553,6 +539,7 @@ level parallelism and expose SIMDization opportunities. %package polly-devel Summary: Development files for Polly Group: Development/Libraries/C and C++ +Requires: llvm%{_sonum}-devel = %{version} Requires: llvm%{_sonum}-polly = %{version} Conflicts: llvm-polly-devel-provider < %{version} Provides: llvm-polly-devel-provider = %{version} @@ -919,17 +906,47 @@ rm -r %{buildroot}%{_docdir}/llvm-clang/_sources popd # install python bindings -# The python bindings use the unversioned libclang.so, -# so it doesn't make sense to have multiple versions of it -%if %{with clang_scripts} install -d %{buildroot}%{python3_sitelib}/clang pushd tools/clang/bindings/python cp clang/*.py %{buildroot}%{python3_sitelib}/clang +# Make the bindings use the current so number, so that we don't need an unversioned libclang.so. +sed -i "s/file = 'libclang\.so'/file = 'libclang.so.%{_soclang}'/" %{buildroot}%{python3_sitelib}/clang/cindex.py install -d %{buildroot}%{_docdir}/python-clang/examples/cindex cp -r examples %{buildroot}%{_docdir}/python-clang install -d %{buildroot}%{_docdir}/python-clang/tests/cindex/INPUTS cp -r tests %{buildroot}%{_docdir}/python-clang popd + +# Scripts for clang use unversioned executables, so it doesn't make sense to +# have multiple versions of them. We package them only for the default version. +%if %{_plv} == %{_sonum} +%if "%{_libexecdir}" != "%{_prefix}/libexec" +mv %{buildroot}%{_prefix}/libexec/{c++,ccc}-analyzer %{buildroot}%{_bindir} +mv %{buildroot}%{_prefix}/libexec/{analyze,intercept}-{cc,c++} %{buildroot}%{_bindir} +%endif + +mv %{buildroot}%{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff +mv %{buildroot}%{_datadir}/clang/clang-tidy-diff.py %{buildroot}%{_bindir}/clang-tidy-diff +mv %{buildroot}%{_datadir}/clang/run-find-all-symbols.py %{buildroot}%{_bindir}/run-find-all-symbols + +mkdir -p %{buildroot}%{_datadir}/bash-completion/completions +mv %{buildroot}%{_datadir}/clang/bash-autocomplete.sh %{buildroot}%{_datadir}/bash-completion/completions/clang + +# We don't care about applescript or sublime text +rm %{buildroot}%{_datadir}/clang/*.applescript +rm %{buildroot}%{_datadir}/clang/clang-format-sublime.py +%else +rm %{buildroot}%{_bindir}/{analyze,intercept}-build +rm %{buildroot}%{_bindir}/clang-doc +rm %{buildroot}%{_bindir}/git-clang-format +rm %{buildroot}%{_bindir}/hmaptool +rm %{buildroot}%{_bindir}/run-clang-tidy +rm %{buildroot}%{_bindir}/scan-{build,build-py,view} +rm -r %{buildroot}%{_prefix}/lib/lib{ear,scanbuild} +rm %{buildroot}%{_prefix}/libexec/{c++,ccc}-analyzer +rm %{buildroot}%{_prefix}/libexec/{analyze,intercept}-{cc,c++} +rm -r %{buildroot}%{_datadir}/{clang,scan-build,scan-view}/ +rm %{buildroot}%{_mandir}/man1/scan-build.1 %endif # Note that bfd-plugins is in /usr/lib/bfd-plugins before binutils 2.33.1 @@ -942,14 +959,6 @@ for i in ftdetect ftplugin indent syntax; do done mv utils/vim/README utils/vim/README.vim -%if "%{_libexecdir}" != "%{_prefix}/libexec" -mv %{buildroot}%{_prefix}/libexec/{c++,ccc}-analyzer %{buildroot}%{_bindir} -mv %{buildroot}%{_prefix}/libexec/{analyze,intercept}-{cc,c++} %{buildroot}%{_bindir} -%endif -mv %{buildroot}%{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff -mv %{buildroot}%{_datadir}/clang/clang-tidy-diff.py %{buildroot}%{_bindir}/clang-tidy-diff -mv %{buildroot}%{_datadir}/clang/run-find-all-symbols.py %{buildroot}%{_bindir}/run-find-all-symbols - install -d %{buildroot}%{python3_sitelib} mv %{buildroot}%{_datadir}/opt-viewer/opt-diff.py %{buildroot}%{_bindir}/opt-diff mv %{buildroot}%{_datadir}/opt-viewer/opt-stats.py %{buildroot}%{_bindir}/opt-stats @@ -957,12 +966,8 @@ mv %{buildroot}%{_datadir}/opt-viewer/opt-viewer.py %{buildroot}%{_bindir}/opt-v mv %{buildroot}%{_datadir}/opt-viewer/optpmap.py %{buildroot}%{python3_sitelib}/optpmap.py mv %{buildroot}%{_datadir}/opt-viewer/optrecord.py %{buildroot}%{python3_sitelib}/optrecord.py -mkdir -p %{buildroot}%{_datadir}/bash-completion/completions -mv %{buildroot}%{_datadir}/clang/bash-autocomplete.sh %{buildroot}%{_datadir}/bash-completion/completions/clang - rm %{buildroot}%{_mandir}/man1/{,clang-,lldb-,mlir-}tblgen.1 rm %{buildroot}%{_mandir}/man1/llvm-locstats.1 -chmod -x %{buildroot}%{_mandir}/man1/scan-build.1 %if %{with lldb_python} # Python: fix binary libraries location. @@ -988,10 +993,6 @@ rm %{buildroot}%{_libdir}/libiomp*.so rm %{buildroot}%{_libdir}/libarcher_static.a %endif -# We don't care about applescript or sublime text -rm %{buildroot}%{_datadir}/clang/*.applescript -rm %{buildroot}%{_datadir}/clang/clang-format-sublime.py - # Prepare for update-alternatives usage mkdir -p %{buildroot}%{_sysconfdir}/alternatives binfiles=( bugpoint dsymutil llc lli \ @@ -1078,14 +1079,15 @@ cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.llvm <