diff --git a/README.md b/README.md index 9f23386..d902a81 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # clang17 +C language family frontend for LLVM. + diff --git a/clang-15.0.6-arm-add-latomic.patch b/clang-15.0.6-arm-add-latomic.patch new file mode 100644 index 0000000..2bac99f --- /dev/null +++ b/clang-15.0.6-arm-add-latomic.patch @@ -0,0 +1,8 @@ +--- clang-15.0.6.src/lib/Lex/CMakeLists.txt.orig 2022-12-04 10:07:15.091016947 +0100 ++++ clang-15.0.6.src/lib/Lex/CMakeLists.txt 2022-12-04 10:07:23.000931110 +0100 +@@ -29,4 +29,5 @@ + + LINK_LIBS + clangBasic ++ atomic + ) diff --git a/clang-16.0.4-arm-add-latomic.patch b/clang-16.0.4-arm-add-latomic.patch new file mode 100644 index 0000000..38fba9e --- /dev/null +++ b/clang-16.0.4-arm-add-latomic.patch @@ -0,0 +1,10 @@ +--- clang-16.0.4/clang-tools-extra/clangd/CMakeLists.txt.orig 2023-05-21 17:00:45.855038060 +0200 ++++ clang-16.0.4/clang-tools-extra/clangd/CMakeLists.txt 2023-05-21 17:00:52.854996865 +0200 +@@ -177,6 +177,7 @@ + target_link_libraries(clangDaemon + PRIVATE + ${LLVM_PTHREAD_LIB} ++ atomic + + clangIncludeCleaner + clangPseudo diff --git a/clang17.spec b/clang17.spec new file mode 100644 index 0000000..955a3a3 --- /dev/null +++ b/clang17.spec @@ -0,0 +1,372 @@ +%define gccver %(gcc -dumpversion) +%define MAJver %(echo %version | cut -d. -f1) +%define majver %(echo %version | cut -d. -f1-2) +Name: clang17 +Version: 17.0.6 +Release: 3mamba +Summary: C language family frontend for LLVM +Group: Development/Languages +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://llvm.org/ +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-tools-extra-%{version}.src.tar.xz +Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/cmake-%{version}.src.tar.xz +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/third-party-%{version}.src.tar.xz +Patch0: clang-16.0.4-arm-add-latomic.patch +Patch1: clang-15.0.6-arm-add-latomic.patch +License: NCSA +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libgcc +BuildRequires: libllvm17-devel +BuildRequires: libperl +BuildRequires: libstdc++6-devel +BuildRequires: libxml2-devel +BuildRequires: perl-devel +## AUTOBUILDREQ-END +BuildRequires: llvm17 = %{version} +BuildRequires: python-recommonmark-py3 +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description +C language family frontend for LLVM. + +%package -n lib%{name} +Group: System/Libraries +Summary: Shared libraries for %{name} +%ifarch x86_64 aarch64 +Provides: libclang.so.%{MAJver}()(64bit) +Provides: libclang.so.%{MAJver}(LLVM_%{MAJver})(64bit) +%else +Provides: libclang.so.%{MAJver} +Provides: libclang.so.%{MAJver}(LLVM_%{MAJver}) +%endif + +%description -n lib%{name} +This package contains shared libraries for %{name}. + +%package -n lib%{name}-devel +Summary: Libraries and header files for LLVM +Group: Development/Languages +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-devel +C language family frontend for LLVM. +This package contains library and header files needed to develop new native programs that use the LLVM infrastructure. + +%package -n lib%{name}-apidocs +Group: Documentation +Summary: lib%{name} API documentation +Requires: lib%{name}-devel = %{?epoch:%epoch:}%{version}-%{release} +Requires: gtk-doc + +%description -n lib%{name}-apidocs +This package includes the lib%{name} API documentation. + +%debug_package + +%prep +%setup -q -c -a0 -a1 -a2 -a3 +#% setup -q -D -T +#:<< _EOF +mv clang-%{version}.src clang +mv clang-tools-extra-%{version}.src clang-tools-extra +mv cmake-%{version}.src cmake +mv third-party-%{version}.src third-party + +%ifarch arm +%patch 0 -p1 +cd clang +%patch 1 -p1 +cd .. +%endif + +%build +#:<< __EOF +mkdir -p build +cd build + +cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=%{_libdir}/llvm17 \ + -DLLVM_CMAKE_DIR=%{_libdir}/llvm17/lib/cmake \ + -DLLVM_CONFIG=%{_libdir}/llvm17/bin/llvm-config \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DCLANG_LINK_CLANG_DYLIB=ON \ + -DCLANG_DEFAULT_CXX_STDLIB=libstdc++ \ +%ifnarch arm + -DLLVM_ENABLE_RTTI=ON \ +%endif + -DLLVM_INCLUDE_DOCS=ON \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_BUILD_DOCS=ON \ + -DLLVM_ENABLE_SPHINX=ON \ + -DSPHINX_WARNINGS_AS_ERRORS=OFF \ + ../clang + +ninja %{_smp_mflags} + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +cd build +export DESTDIR=%{buildroot} +ninja install + +rm -f %{buildroot}%{_datadir}/doc/clang/html/.buildinfo + +mv %{buildroot}%{_libdir}/{llvm17/lib/,}libclang-cpp.so.17 +ln -s ../../libclang-cpp.so.17 %{buildroot}%{_libdir}/llvm17/lib/libclang-cpp.so.17 +ln -s llvm17/lib/libclang.so.17 %{buildroot}%{_libdir}/libclang.so.17 + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_libdir}/llvm17/bin/* +%{_libdir}/llvm17/libexec/* +%dir %{_libdir}/llvm17/share/clang/ +%{_libdir}/llvm17/share/clang/* +%dir %{_libdir}/llvm17/share/scan-build +%{_libdir}/llvm17/share/scan-build/* +%dir %{_libdir}/llvm17/share/scan-view +%{_libdir}/llvm17/share/scan-view/* +%dir %{_libdir}/llvm17/share/man +%{_libdir}/llvm17/share/man/* + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libclang-cpp.so.* +%{_libdir}/libclang.so.* +%{_libdir}/llvm17/lib/libclang*.so.* +%dir %{_libdir}/llvm17/lib/libear +%{_libdir}/llvm17/lib/libear/* +%dir %{_libdir}/llvm17/lib/libscanbuild +%{_libdir}/llvm17/lib/libscanbuild/* +%doc clang/LICENSE.TXT + +%files -n lib%{name}-devel +%defattr(-,root,root) +%dir %{_libdir}/llvm17/include/clang-c +%{_libdir}/llvm17/include/clang-c/*.h +%dir %{_libdir}/llvm17/include/clang +%{_libdir}/llvm17/include/clang/* +%{_libdir}/llvm17/lib/libclang*.a +%{_libdir}/llvm17/lib/libclang*.so +%dir %{_libdir}/llvm17/lib/clang +%dir %{_libdir}/llvm17/lib/clang/* +%dir %{_libdir}/llvm17/lib/clang/*/include +%{_libdir}/llvm17/lib/clang/*/include/* +%dir %{_libdir}/llvm17/lib/cmake/clang +%{_libdir}/llvm17/lib/cmake/clang/*.cmake +%doc clang/NOTES.txt clang/README.txt + +%files -n lib%{name}-apidocs +%defattr(-,root,root) +%dir %{_libdir}/llvm17/share/doc/Clang +%dir %{_libdir}/llvm17/share/doc/Clang/clang +%dir %{_libdir}/llvm17/share/doc/Clang/clang/html +%{_libdir}/llvm17/share/doc/Clang/clang/html/* +%{_libdir}/llvm17/share/doc/Clang/clang/html/.buildinfo + +%changelog +* Mon Mar 18 2024 Silvan Calarco 17.0.6-3mamba +- legacy package + +* Thu Jan 18 2024 Silvan Calarco 17.0.6-2mamba +- removed BUILD_SHARED_LIBS=ON see https://github.com/llvm/llvm-project/issues/46461 +- added -DLLVM_LINK_LLVM_DYLIB=ON + +* Sat Dec 02 2023 Automatic Build System 17.0.6-1mamba +- automatic version update by autodist + +* Wed Nov 15 2023 Automatic Build System 17.0.5-1mamba +- automatic version update by autodist + +* Fri Nov 03 2023 Automatic Build System 17.0.4-1mamba +- automatic version update by autodist + +* Fri Oct 20 2023 Automatic Build System 17.0.3-1mamba +- automatic version update by autodist + +* Thu Jun 15 2023 Automatic Build System 16.0.6-1mamba +- automatic version update by autodist + +* Sat Jun 03 2023 Automatic Build System 16.0.5-1mamba +- automatic version update by autodist + +* Fri May 19 2023 Automatic Build System 16.0.4-1mamba +- automatic version update by autodist + +* Sat May 13 2023 Automatic Build System 16.0.3-1mamba +- automatic version update by autodist + +* Fri Jan 13 2023 Automatic Build System 15.0.7-1mamba +- automatic version update by autodist + +* Sat Dec 03 2022 Silvan Calarco 15.0.6-1mamba +- update to 15.0.6 + +* Sat Nov 19 2022 Automatic Build System 15.0.5-1mamba +- automatic version update by autodist + +* Sun Jun 26 2022 Automatic Build System 14.0.6-1mamba +- automatic version update by autodist + +* Sun Jun 12 2022 Automatic Build System 14.0.5-1mamba +- automatic version update by autodist + +* Fri May 27 2022 Automatic Build System 14.0.4-1mamba +- automatic version update by autodist + +* Thu May 19 2022 Silvan Calarco 14.0.3-2mamba +- rebuilt with llvm 14.0.3-3mamba + +* Sat Apr 30 2022 Automatic Build System 14.0.3-1mamba +- automatic version update by autodist + +* Thu Apr 28 2022 Automatic Build System 14.0.2-1mamba +- automatic version update by autodist + +* Fri Feb 04 2022 Automatic Build System 13.0.1-1mamba +- automatic version update by autodist + +* Fri Oct 22 2021 Silvan Calarco 13.0.0-1mamba +- update to 13.0.0 + +* Mon May 17 2021 Silvan Calarco 11.1.0-3mamba +- rebuilt with -DCLANG_LINK_CLANG_DYLIB=ON + +* Thu Mar 25 2021 Silvan Calarco 11.1.0-2mamba +- add legacy provide for libclang.so.11 + +* Tue Mar 16 2021 Automatic Build System 11.1.0-1mamba +- automatic version update by autodist + +* Mon Jan 11 2021 Automatic Build System 11.0.1-1mamba +- automatic version update by autodist + +* Tue Oct 13 2020 Automatic Build System 11.0.0-1mamba +- automatic version update by autodist + +* Sun Jul 26 2020 Automatic Build System 10.0.1-1mamba +- automatic version update by autodist + +* Mon Mar 30 2020 Automatic Build System 10.0.0-1mamba +- automatic version update by autodist + +* Sun Feb 09 2020 Silvan Calarco 9.0.1-3mamba +- rebuilt apart from llvm + +* Tue Jan 07 2020 Silvan Calarco 9.0.1-2mamba +- rebuild with -DLLVM_ENABLE_LTO=Thin + +* Mon Dec 30 2019 Silvan Calarco 9.0.1-1mamba +- update to 9.0.1 + +* Thu Mar 28 2019 Automatic Build System 8.0.0-1mamba +- automatic version update by autodist + +* Sat Jan 26 2019 Silvan Calarco 7.0.1-4mamba +- bump release + +* Sat Jan 26 2019 Silvan Calarco 7.0.1-3mamba +- move *.so from libllvm-devel to libllvm + +* Mon Jan 21 2019 Silvan Calarco 7.0.1-2mamba +- rebuilt with binutils plugin LLVMgold.so + +* Sat Dec 22 2018 Automatic Build System 7.0.1-1mamba +- automatic version update by autodist + +* Sun Oct 14 2018 Automatic Build System 7.0.0-1mamba +- automatic version update by autodist + +* Sun Sep 02 2018 Silvan Calarco 6.0.1-4mamba +- remove building with libc++ to fix e.g. Mesa build + +* Sat Jul 14 2018 Silvan Calarco 6.0.1-3mamba +- rebuilt wth LLVM_ENABLE_LIBCXX=ON + +* Sat Jul 14 2018 Silvan Calarco 6.0.1-2mamba +- rebuilt with libc++ + +* Sat Jul 07 2018 Automatic Build System 6.0.1-1mamba +- automatic version update by autodist + +* Mon Jun 25 2018 Silvan Calarco 6.0.0-4mamba +- rebuilt with gcc 8.1.0 + +* Sun Jun 24 2018 Silvan Calarco 6.0.0-3mamba +- apply patches from Arch to possibly fix lld segfault + +* Sat Jun 23 2018 Silvan Calarco 6.0.0-2mamba +- rebuilt with standard target libdir and other changes to try fixing lld crash with at least chromium build + +* Tue Jun 19 2018 Automatic Build System 6.0.0-1mamba +- automatic version update by autodist + +* Mon Dec 25 2017 Automatic Build System 5.0.1-1mamba +- automatic version update by autodist + +* Tue Nov 28 2017 Silvan Calarco 5.0.0-2mamba +- fix link against libllvm by changing and extending build arguments and external llvm subpackages + +* Tue Nov 28 2017 Silvan Calarco 5.0.0-1mamba +- update to 5.0.0 + +* Wed Jul 13 2016 Automatic Build System 3.8.1-1mamba +- automatic version update by autodist + +* Sat Jun 11 2016 Silvan Calarco 3.8.0-3mamba +- rebuilt using cmake + +* Sat May 28 2016 Silvan Calarco 3.8.0-2mamba +- rebuilt + +* Thu May 26 2016 Automatic Build System 3.8.0-1mamba +- automatic version update by autodist + +* Sun Jan 18 2015 Automatic Build System 3.5.1-1mamba +- automatic version update by autodist + +* Fri Sep 19 2014 Silvan Calarco 3.5.0-2mamba +- patch llvm-config for x86_64 support and %{_libdir}/llvm + +* Wed Sep 10 2014 Silvan Calarco 3.5.0-1mamba +- update to 3.5.0 + +* Thu Jul 10 2014 Silvan Calarco 3.4.2-1mamba +- update to 3.4.2 + +* Sun Feb 16 2014 Silvan Calarco 3.4-2mamba +- fix configure settings and add --with-extra-ld-options to correctly link and + pass --with-arch=%{_target_cpu} to fix penmamba bug #000163 + +* Sun Jan 12 2014 Silvan Calarco 3.4-1mamba +- update to 3.4 + +* Thu Jun 20 2013 Automatic Build System 3.3-1mamba +- update to 3.3 + +* Sat Dec 22 2012 Automatic Build System 3.2-1mamba +- automatic version update by autodist + +* Fri Jul 20 2012 Silvan Calarco 3.1-1mamba +- update to 3.1 + +* Thu Feb 23 2012 Ercole 'ercolinux' Carpanetto 3.0.-1mamba +- update to 3.0 + +* Sun Jul 10 2011 Silvan Calarco 2.9-1mamba +- update to 2.9 + +* Sat Jan 01 2011 Davide Madrisan 2.8-1mamba +- package created by autospec