代码拉取完成,页面将自动刷新
同步操作将从 OpenCloudOS Stream/llvm 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
%global toolchain clang
Name: llvm
Version: 17.0.6
Release: 8%{?dist}
Summary: Low Level Virtual Machine, modular and reusable compiler and toolchain
License: Apache License v2.0 with LLVM Exceptions
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
# https://github.com/llvm/llvm-project/commit/c2515a8f2be5dd23354c9891f41ad104000f88c4
Patch0001: CVE-2023-46049.patch
# Backport patches to support `relax`, vector, some improvements and bugfixs on LoongArch
Patch0002: 0001-Backport-LoongArch-Add-relax-feature-and-keep-relocations.patch
Patch0003: 0002-Backport-LoongArch-Allow-delayed-decision-for-ADD-SUB-relocations.patch
Patch0004: 0003-Backport-LoongArch-Emit-R_LARCH_RELAX-when-expanding-some-LoadAddress.patch
Patch0005: 0004-Backport-MC-LoongArch-Add-AlignFragment-size-if-layout-is-available-and-not-need-insert-nops.patch
Patch0006: 0005-Backport-LoongArch-RISCV-Support-R_LARCH_-ADD-SUB-_ULEB128-R_RISCV_-SET-SUB-_ULEB128-for-uleb128-directives.patch
Patch0007: 0006-Backport-LoongArch-Add-relaxDwarfLineAddr-and-relaxDwarfCFA-to-handle-the-mutable-label-diff-in-dwarfinfo.patch
Patch0008: 0007-Backport-LoongArch-Insert-nops-and-emit-align-reloc-when-handle-alignment-directive.patch
Patch0009: 0008-Backport-test-Update-dwarf-loongarch-relocs.ll.patch
Patch0010: 0009-Backport-MC-test-Change-ELF-uleb-ehtable.s-Mach-O-to-use-private-symbols-in-.uleb128-for-label-differences.patch
Patch0011: 0010-Backport-Mips-MC-AttemptToFoldSymbolOffsetDifference-revert-isMicroMips-special-case.patch
Patch0012: 0011-Backport-LoongArch-Add-the-support-for-vector-in-llvm17.patch
Patch0013: 0012-Backport-LoongArch-improve-the-support-for-compiler-rt-and-bugfix.patch
Patch0014: 0013-Backport-LoongArch-Improve-the-support-for-atomic-and-clear_cache.patch
Patch0015: 0014-Backport-LoongArch-fix-and-add-some-new-support.patch
Patch3000: deprecated-recommonmark.patch
Patch3001: 0001-Clear-instructions-not-recorded-in-ErasedInstrs.patch
%define maj_ver %(echo %{version} | cut -d. -f1)
%define min_ver %(echo %{version} | cut -d. -f2)
%define patch_ver %(echo %{version} | cut -d. -f3)
BuildRequires: gcc gcc-c++ clang cmake ninja-build
BuildRequires: zlib-devel libffi-devel ncurses-devel binutils-devel libedit-devel
BuildRequires: python3-sphinx
# for valgrind support
BuildRequires: valgrind-devel
# fo patchfix.py
BuildRequires: python3-devel
Requires: %{name}-libs = %{version}-%{release}
Provides: llvm(major) = %{maj_ver}
%description
The LLVM Project is a collection of modular and reusable compiler
and toolchain technologies, including llvm, clang, lldb, compiler-rt,
and so on.The LLVM Core libraries provide a modern source- and
target-independent optimizer, along with code generation support for
many popular CPUs. These libraries are built around a well specified
code representation known as the LLVM intermediate representation ("LLVM IR").
Documentation is https://llvm.org/docs/.
%package devel
Summary: Libraries and header files for LLVM
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
# for -ledit to the linker flags
Requires: libedit-devel
Requires: %{name}-test = %{version}-%{release}
Provides: llvm-devel(major) = %{maj_ver}
Provides: llvm-static(major) = %{maj_ver}
Provides: llvm-static
%description devel
Library and header files to develop programs using the LLVM infrastructure.
%package libs
Summary: LLVM shared libraries
%description libs
Shared libraries for LLVM.
%package cmake-utils
Summary: CMake utilities shared across LLVM subprojects
%description cmake-utils
CMake utilities shared across LLVM subprojects.
This is for internal use by LLVM packages only.
%package test
Summary: LLVM regression tests
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Provides: llvm-test(major) = %{maj_ver}
Provides: llvm-googletest
%description test
LLVM regression tests adn 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} -p -n -k -as \
test/BugPoint/compile-custom.ll.py \
tools/opt-viewer/*.py \
utils/update_cc_test_checks.py
%build
%global _lto_cflags -flto=thin
%cmake -G Ninja \
-DCMAKE_C_FLAGS="-gdwarf-4" \
-DCMAKE_CXX_FLAGS="-gdwarf-4" \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DLLVM_LIBDIR_SUFFIX=64 \
-DLLVM_TARGETS_TO_BUILD="all" \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='' \
-DLLVM_ENABLE_LIBCXX:BOOL=OFF \
-DLLVM_ENABLE_ZLIB:BOOL=ON \
-DLLVM_ENABLE_FFI:BOOL=ON \
-DLLVM_ENABLE_RTTI:BOOL=ON \
-DLLVM_USE_PERF:BOOL=ON \
-DLLVM_BINUTILS_INCDIR=%{_includedir} \
-DLLVM_BUILD_RUNTIME:BOOL=ON \
-DLLVM_INCLUDE_TOOLS:BOOL=ON \
-DLLVM_BUILD_TOOLS:BOOL=ON \
-DLLVM_INCLUDE_TESTS:BOOL=ON \
-DLLVM_BUILD_TESTS:BOOL=ON \
-DLLVM_INSTALL_GTEST:BOOL=ON \
-DLLVM_LIT_ARGS=-v \
-DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
-DLLVM_INCLUDE_UTILS:BOOL=ON \
-DLLVM_INSTALL_UTILS:BOOL=ON \
-DLLVM_UTILS_INSTALL_DIR:PATH=%{_bindir} \
-DLLVM_TOOLS_INSTALL_DIR:PATH=bin \
-DLLVM_INCLUDE_DOCS:BOOL=ON \
-DLLVM_BUILD_DOCS:BOOL=ON \
-DLLVM_ENABLE_SPHINX:BOOL=ON \
-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
-DLLVM_VERSION_SUFFIX='' \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
-DLLVM_DEFAULT_TARGET_TRIPLE=%{_host} \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \
-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_UNITTEST_LINK_FLAGS="-Wl,-plugin-opt=O0"
# Build libLLVM.so first to help reduce OOM errors during concurrent building.
%cmake_build --target LLVM
%cmake_build
%install
%cmake_install
rm -rf %{buildroot}/%{_pkgdocdir}/html
# for lit tests
mkdir -p %{buildroot}/%{_bindir}
install -m 0755 %{_vpath_builddir}/bin/llvm-isel-fuzzer %{buildroot}%{_bindir}
install -m 0755 %{_vpath_builddir}/bin/llvm-opt-fuzzer %{buildroot}%{_bindir}
rm -rf test/tools/UpdateTestChecks
install %{_vpath_builddir}/lib64/libLLVMTestingSupport.a %{buildroot}%{_libdir}
install %{_vpath_builddir}/lib64/libLLVMTestingAnnotations.a %{buildroot}%{_libdir}
# Add symlink to lto plugin in the binutils plugin directory
mkdir -p %{buildroot}%{_libdir}/bfd-plugins/
ln -s -t %{buildroot}%{_libdir}/bfd-plugins/ ../LLVMgold.so
(cd %{buildroot}/%{_bindir} ; ln -s llvm-config llvm-config-%{maj_ver})
cp -Rv ../cmake/Modules/* %{buildroot}%{_libdir}/cmake/llvm
mkdir -p %{buildroot}%{_datadir}/llvm/cmake
cp -Rv ../cmake/* %{buildroot}%{_datadir}/llvm/cmake
%check
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{_vpath_builddir}
%files
%license LICENSE.TXT
%{_bindir}/*
%exclude %{_bindir}/llvm-config
%exclude %{_bindir}/llvm-config-%{maj_ver}
%exclude %{_bindir}/not
%exclude %{_bindir}/count
%exclude %{_bindir}/yaml-bench
%exclude %{_bindir}/lli-child-target
%exclude %{_bindir}/llvm-isel-fuzzer
%exclude %{_bindir}/llvm-opt-fuzzer
%{_datadir}/opt-viewer
%{_mandir}/man1/*
%exclude %{_mandir}/man1/llvm-config*
%files libs
%license LICENSE.TXT
%{_libdir}/libLLVM-%{maj_ver}.so
%{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so
%{_libdir}/LLVMgold.so
%{_libdir}/bfd-plugins/LLVMgold.so
%{_libdir}/libLTO.so*
%{_libdir}/libRemarks.so*
%files devel
%license LICENSE.TXT
%{_bindir}/llvm-config
%{_bindir}/llvm-config-%{maj_ver}
%{_libdir}/libLLVM.so
%{_libdir}/cmake/llvm
%{_libdir}/*.a
%exclude %{_libdir}/libLLVMTestingSupport.a
%{_includedir}/llvm
%{_includedir}/llvm-c
%{_mandir}/man1/llvm-config*
%files cmake-utils
%license LICENSE.TXT
%{_datadir}/llvm/cmake
%files test
%license LICENSE.TXT
%{_bindir}/not
%{_bindir}/count
%{_bindir}/yaml-bench
%{_bindir}/lli-child-target
%{_bindir}/llvm-isel-fuzzer
%{_bindir}/llvm-opt-fuzzer
%{_libdir}/libLLVMTestingSupport.a
%{_libdir}/libLLVMTestingAnnotations.a
%{_libdir}/libllvm_gtest.a
%{_libdir}/libllvm_gtest_main.a
%{_includedir}/llvm-gtest
%{_includedir}/llvm-gmock
%changelog
* Tue Sep 24 2024 zhanglimin <[email protected]> - 17.0.6-8
- [LoongArch] Backport some new support
* Thu Sep 12 2024 doupengda <[email protected]> - 17.0.6-7
- [Type] other
- [DESC] Clear instructions not recorded in ErasedInstrs
* Mon Sep 02 2024 Zhao Zhen <[email protected]> - 17.0.6-6
- Deprecated python3-recommonmark from builddep
* Fri Aug 16 2024 OpenCloudOS Release Engineering <[email protected]> - 17.0.6-5
- Rebuilt for loongarch release
* Tue May 28 2024 zhanglimin <[email protected]> - 17.0.6-4
- Fix the issue for patching files.
* Thu May 16 2024 zhanglimin <[email protected]> - 17.0.6-3
- Support `relax`, vector, some improvements and bugfixs on LoongArch.
* Mon Apr 01 2024 rockerzhu <[email protected]> - 17.0.6-2
- Fix CVE-2023-46049.
* Mon Dec 18 2023 luffyluo <[email protected]> - 17.0.6-1
- Upgrade to version 17.0.6
* Fri Sep 08 2023 OpenCloudOS Release Engineering <[email protected]> - 16.0.6-2
- Rebuilt for OpenCloudOS Stream 23.09
* Fri Jun 30 2023 kianli <[email protected]> - 16.0.6-1
- Upgrade to 16.0.6
* Fri Apr 28 2023 OpenCloudOS Release Engineering <[email protected]> - 14.0.5-4
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <[email protected]> - 14.0.5-3
- Rebuilt for OpenCloudOS Stream 23
* Thu Jan 05 2023 rockerzhu <[email protected]> - 14.0.5-2
- Disable INSTANTIATE_TEST_SUITE_P on aarch64 due to failing in compiling.
* Wed Jun 15 2022 metrechen <[email protected]> - 14.0.5-1
- Release tllvm, based on LLVM 14.0.5
* Thu Jun 02 2022 rockerzhu <[email protected]> - 14.0.0-1
- Initial build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。