Update to LLVM 17.0.6

1. Split off llvm-cmake-utils package
2. Add llvm-gtest
This commit is contained in:
zhoujing 2023-12-08 11:25:48 +08:00
parent 8963f68e84
commit 86c99e1e49
4 changed files with 52 additions and 6 deletions

BIN
cmake-17.0.6.src.tar.xz Normal file

Binary file not shown.

View File

@ -1,16 +1,18 @@
%bcond_with sys_llvm %bcond_without sys_llvm
%bcond_with check %bcond_without check
%global maj_ver 12 %global maj_ver 17
%global min_ver 0 %global min_ver 0
%global patch_ver 1 %global patch_ver 6
%if %{with sys_llvm} %if %{with sys_llvm}
%global pkg_name llvm %global pkg_name llvm
%global install_prefix %{_prefix} %global install_prefix %{_prefix}
%global install_datadir %{_datadir}
%else %else
%global pkg_name llvm%{maj_ver} %global pkg_name llvm%{maj_ver}
%global install_prefix %{_libdir}/%{name} %global install_prefix %{_libdir}/%{name}
%global install_datadir %{install_prefix}/share
%endif %endif
%global install_bindir %{install_prefix}/bin %global install_bindir %{install_prefix}/bin
@ -35,12 +37,14 @@
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 7 Release: 1
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
URL: http://llvm.org URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz 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: binutils-devel
BuildRequires: cmake BuildRequires: cmake
@ -75,6 +79,11 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: libedit-devel Requires: libedit-devel
Requires: %{name}-static%{?_isa} = %{version}-%{release} 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(post): %{_sbindir}/alternatives
Requires(postun): %{_sbindir}/alternatives Requires(postun): %{_sbindir}/alternatives
@ -107,6 +116,13 @@ Provides: llvm-static(major) = %{maj_ver}
%description static %description static
Static libraries for the LLVM compiler infrastructure. 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 %package test
Summary: LLVM regression tests Summary: LLVM regression tests
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
@ -124,7 +140,14 @@ Summary: LLVM's modified googletest sources
LLVM's modified googletest sources. LLVM's modified googletest sources.
%prep %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 %setup -T -q -b 0 -n llvm-%{version}.src
%autopatch -p2
pathfix.py -i %{__python3} -pn \ pathfix.py -i %{__python3} -pn \
test/BugPoint/compile-custom.ll.py \ test/BugPoint/compile-custom.ll.py \
@ -153,6 +176,11 @@ cd _build
-DLLVM_BUILD_TOOLS:BOOL=ON \ -DLLVM_BUILD_TOOLS:BOOL=ON \
-DLLVM_INCLUDE_TESTS:BOOL=ON \ -DLLVM_INCLUDE_TESTS:BOOL=ON \
-DLLVM_BUILD_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_LIT_ARGS=-v \
-DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \ -DLLVM_BUILD_EXAMPLES:BOOL=OFF \
@ -194,14 +222,16 @@ done
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
install %{_builddir}/llvm-%{version}.src/_build/lib64/libLLVMTestingSupport.a %{buildroot}%{install_libdir} 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 %else
install %{_builddir}/llvm-%{version}.src/_build/lib/libLLVMTestingSupport.a %{buildroot}%{install_libdir} 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 %endif
# Install gtest sources so clang can use them for gtest # Install gtest sources so clang can use them for gtest
install -d %{buildroot}%{install_srcdir} install -d %{buildroot}%{install_srcdir}
install -d %{buildroot}%{install_srcdir}/utils/ 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. # Clang needs these for running lit tests.
cp %{_builddir}/llvm-%{version}.src/utils/update_cc_test_checks.py %{buildroot}%{install_srcdir}/utils/ 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. # Remove opt-viewer, since this is just a compatibility package.
rm -Rf %{build_install_prefix}/share/opt-viewer rm -Rf %{build_install_prefix}/share/opt-viewer
mkdir -p %{buildroot}%{install_datadir}/llvm/cmake
cp -Rv ../cmake/* %{buildroot}%{install_datadir}/llvm/cmake
%check %check
%if %{with check} %if %{with check}
LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build/ 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 %license LICENSE.TXT
%{install_libdir}/*.a %{install_libdir}/*.a
%exclude %{install_libdir}/libLLVMTestingSupport.a %exclude %{install_libdir}/libLLVMTestingSupport.a
%exclude %{install_libdir}/libLLVMTestingAnnotations.a
%files cmake-utils
%license LICENSE.TXT
%{install_datadir}/llvm/cmake
%files test %files test
%license LICENSE.TXT %license LICENSE.TXT
@ -282,8 +320,16 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build
%license LICENSE.TXT %license LICENSE.TXT
%{install_srcdir}/utils %{install_srcdir}/utils
%{install_libdir}/libLLVMTestingSupport.a %{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 %changelog
* Thu Nov 30 2023 zhoujing <zhoujing106@huawei.com> - 17.0.6-1
- Update to 17.0.6
* Tue Jul 13 2023 cf-zhao <zhaochuanfeng@huawei.com> -12.0.1-7 * Tue Jul 13 2023 cf-zhao <zhaochuanfeng@huawei.com> -12.0.1-7
- Disable check. - Disable check.

Binary file not shown.