From 88f3e45ed8042c2014364ca9a3b47e264ee7a3ce Mon Sep 17 00:00:00 2001 From: liyunfei Date: Fri, 5 Jul 2024 10:08:58 +0800 Subject: [PATCH] Add toolchain_clang build support Signed-off-by: liyunfei (cherry picked from commit 02ab7ced7eea43a784dce393877e5c1d7210460d) --- llvm.spec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/llvm.spec b/llvm.spec index 73dfde2..5804b4d 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,6 +1,11 @@ %bcond_without sys_llvm %bcond_without check %bcond_with classic_flang +%bcond_without toolchain_clang + +%if %{with toolchain_clang} +%global toolchain clang +%endif %global maj_ver 17 %global min_ver 0 @@ -38,7 +43,7 @@ Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 10 +Release: 11 Summary: The Low Level Virtual Machine License: NCSA @@ -85,6 +90,9 @@ BuildRequires: python3-recommonmark BuildRequires: python3-sphinx BuildRequires: python3-setuptools BuildRequires: zlib-devel +%if %{with toolchain_clang} +BuildRequires: clang +%endif Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -230,6 +238,10 @@ cd _build %endif %if %{with classic_flang} -DLLVM_ENABLE_CLASSIC_FLANG=ON \ +%endif +%if "%{toolchain}" == "clang" + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ %endif -DLLVM_INCLUDE_BENCHMARKS=OFF %ninja_build LLVM @@ -353,6 +365,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build %{install_includedir}/llvm-gmock %changelog +* Fri Jul 5 2024 liyunfei - 17.0.6-11 +- Add toolchain_clang build support + * Mon Apr 29 2024 wangqiang - 17.0.6-10 - Update llvm-lit config to support macro `build_for_openeuler` -- Gitee