diff --git a/cmake-17.0.6.src.tar.xz b/cmake-17.0.6.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..aeec995a7c0ddaa99a8549223bb1cb8ddab8ab32 Binary files /dev/null and b/cmake-17.0.6.src.tar.xz differ diff --git a/llvm-12.0.1.src.tar.xz b/llvm-17.0.6.src.tar.xz similarity index 65% rename from llvm-12.0.1.src.tar.xz rename to llvm-17.0.6.src.tar.xz index df971f7be1c5fe1b323a3692a92ba695a6ed326b..8489442f14da0ebe1f0aa90b6dfe69ca442110a6 100644 Binary files a/llvm-12.0.1.src.tar.xz and b/llvm-17.0.6.src.tar.xz differ diff --git a/llvm.spec b/llvm.spec index 9ef66d5df00e0696ec3c1f8d47c930771630b27b..7eb8cd17e485468748b2e057a1737565674a41ab 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,16 +1,18 @@ -%bcond_with sys_llvm -%bcond_with check +%bcond_without sys_llvm +%bcond_without check -%global maj_ver 12 +%global maj_ver 17 %global min_ver 0 -%global patch_ver 1 +%global patch_ver 6 %if %{with sys_llvm} %global pkg_name llvm %global install_prefix %{_prefix} +%global install_datadir %{_datadir} %else %global pkg_name llvm%{maj_ver} %global install_prefix %{_libdir}/%{name} +%global install_datadir %{install_prefix}/share %endif %global install_bindir %{install_prefix}/bin @@ -35,12 +37,14 @@ Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 7 +Release: 1 Summary: The Low Level Virtual Machine License: NCSA URL: http://llvm.org Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/cmake-%{version}.src.tar.xz +Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/third-party-%{version}.src.tar.xz BuildRequires: binutils-devel BuildRequires: cmake @@ -75,6 +79,11 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: libedit-devel Requires: %{name}-static%{?_isa} = %{version}-%{release} +%if %{with sys_llvm} +Requires: %{name}-test%{?_isa} = %{version}-%{release} +Requires: %{name}-googletest%{?_isa} = %{version}-%{release} +%endif + Requires(post): %{_sbindir}/alternatives Requires(postun): %{_sbindir}/alternatives @@ -107,6 +116,13 @@ Provides: llvm-static(major) = %{maj_ver} %description static Static libraries for the LLVM compiler infrastructure. +%package cmake-utils +Summary: CMake shared utilities + +%description cmake-utils +CMake moudules shared between LLVM projects at buid time. +This is for internal use by LLVM packages only. + %package test Summary: LLVM regression tests Requires: %{name}%{?_isa} = %{version}-%{release} @@ -124,7 +140,14 @@ Summary: LLVM's modified googletest sources LLVM's modified googletest sources. %prep +%setup -T -q -b 1 -n cmake-%{version}.src +cd .. +mv cmake-%{version}.src cmake +%setup -T -q -b 2 -n third-party-%{version}.src +cd .. +mv third-party-%{version}.src third-party %setup -T -q -b 0 -n llvm-%{version}.src +%autopatch -p2 pathfix.py -i %{__python3} -pn \ test/BugPoint/compile-custom.ll.py \ @@ -153,6 +176,11 @@ cd _build -DLLVM_BUILD_TOOLS:BOOL=ON \ -DLLVM_INCLUDE_TESTS:BOOL=ON \ -DLLVM_BUILD_TESTS:BOOL=ON \ +%if %{with sys_llvm} + -DLLVM_INSTALL_GTEST:BOOL=ON \ +%else + -DLLVM_INSTALL_GTEST:BOOL=OFF \ +%endif -DLLVM_LIT_ARGS=-v \ -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ -DLLVM_BUILD_EXAMPLES:BOOL=OFF \ @@ -194,14 +222,16 @@ done %if 0%{?__isa_bits} == 64 install %{_builddir}/llvm-%{version}.src/_build/lib64/libLLVMTestingSupport.a %{buildroot}%{install_libdir} +install %{_builddir}/llvm-%{version}.src/_build/lib64/libLLVMTestingAnnotations.a %{buildroot}%{install_libdir} %else install %{_builddir}/llvm-%{version}.src/_build/lib/libLLVMTestingSupport.a %{buildroot}%{install_libdir} +install %{_builddir}/llvm-%{version}.src/_build/lib/libLLVMTestingAnnotations.a %{buildroot}%{install_libdir} %endif # Install gtest sources so clang can use them for gtest install -d %{buildroot}%{install_srcdir} install -d %{buildroot}%{install_srcdir}/utils/ -cp -R %{_builddir}/llvm-%{version}.src/utils/unittest %{buildroot}%{install_srcdir}/utils/ +cp -R ../third-party/unittest %{buildroot}%{install_srcdir}/utils/ # Clang needs these for running lit tests. cp %{_builddir}/llvm-%{version}.src/utils/update_cc_test_checks.py %{buildroot}%{install_srcdir}/utils/ @@ -224,6 +254,9 @@ EOF # Remove opt-viewer, since this is just a compatibility package. rm -Rf %{build_install_prefix}/share/opt-viewer +mkdir -p %{buildroot}%{install_datadir}/llvm/cmake +cp -Rv ../cmake/* %{buildroot}%{install_datadir}/llvm/cmake + %check %if %{with check} LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build/ @@ -268,6 +301,11 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build %license LICENSE.TXT %{install_libdir}/*.a %exclude %{install_libdir}/libLLVMTestingSupport.a +%exclude %{install_libdir}/libLLVMTestingAnnotations.a + +%files cmake-utils +%license LICENSE.TXT +%{install_datadir}/llvm/cmake %files test %license LICENSE.TXT @@ -282,8 +320,16 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build %license LICENSE.TXT %{install_srcdir}/utils %{install_libdir}/libLLVMTestingSupport.a +%{install_libdir}/libLLVMTestingAnnotations.a +%{install_libdir}/libllvm_gtest.a +%{install_libdir}/libllvm_gtest_main.a +%{install_includedir}/llvm-gtest +%{install_includedir}/llvm-gmock %changelog +* Thu Nov 30 2023 zhoujing - 17.0.6-1 +- Update to 17.0.6 + * Tue Jul 13 2023 cf-zhao -12.0.1-7 - Disable check. diff --git a/third-party-17.0.6.src.tar.xz b/third-party-17.0.6.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..b38f5acb8fb098ae7e71e50d3f352f04beaf63aa Binary files /dev/null and b/third-party-17.0.6.src.tar.xz differ