Add toolchain_clang build support

Signed-off-by: liyunfei <liyunfei33@huawei.com>
This commit is contained in:
liyunfei 2024-07-05 10:51:12 +08:00
parent b2f91bc412
commit 9a3bfb0bbb

View File

@ -1,6 +1,11 @@
%bcond_without sys_llvm %bcond_without sys_llvm
%bcond_without check %bcond_without check
%bcond_with classic_flang %bcond_with classic_flang
%bcond_without toolchain_clang
%if %{with toolchain_clang}
%global toolchain clang
%endif
%global maj_ver 17 %global maj_ver 17
%global min_ver 0 %global min_ver 0
@ -37,7 +42,7 @@
Name: %{pkg_name} Name: %{pkg_name}
Version: %{clang_version} Version: %{clang_version}
Release: 17 Release: 18
Summary: A C language family front-end for LLVM Summary: A C language family front-end for LLVM
License: NCSA License: NCSA
@ -108,6 +113,9 @@ BuildRequires: perl(lib)
BuildRequires: perl(Term::ANSIColor) BuildRequires: perl(Term::ANSIColor)
BuildRequires: perl(Text::ParseWords) BuildRequires: perl(Text::ParseWords)
BuildRequires: perl(Sys::Hostname) BuildRequires: perl(Sys::Hostname)
%if %{with toolchain_clang}
BuildRequires: clang
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -269,6 +277,10 @@ cd _build
-DLLVM_ENABLE_CLASSIC_FLANG=ON \ -DLLVM_ENABLE_CLASSIC_FLANG=ON \
%endif %endif
-DBUILD_FOR_OPENEULER=ON \ -DBUILD_FOR_OPENEULER=ON \
%if "%{toolchain}" == "clang"
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
%endif
-DCLANG_DEFAULT_UNWINDLIB=libgcc -DCLANG_DEFAULT_UNWINDLIB=libgcc
%ninja_build %ninja_build
@ -395,6 +407,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build
%{install_bindir}/git-clang-format %{install_bindir}/git-clang-format
%changelog %changelog
* Fri Jul 5 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-18
- Add toolchain_clang build support
* Tue Jun 04 2024 Zhao Mengmeng <zhaomengmeng@kylinos.cn> - 17.0.6-17 * Tue Jun 04 2024 Zhao Mengmeng <zhaomengmeng@kylinos.cn> - 17.0.6-17
- Fix the too-early instantiation of conditional "explict" by applying the patch - Fix the too-early instantiation of conditional "explict" by applying the patch
of https://github.com/llvm/llvm-project/commit/128b3b61fe6768c724975fd1df2be0abec848cf6 of https://github.com/llvm/llvm-project/commit/128b3b61fe6768c724975fd1df2be0abec848cf6