From 844c7f9f7e9ddd9d7d541b180bb0a57f5dd08ee7 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Fri, 5 Jul 2024 15:22:15 +0800 Subject: [PATCH] Add toolchain_clang build support Signed-off-by: liyunfei --- compiler-rt.spec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/compiler-rt.spec b/compiler-rt.spec index fd35923..6efb641 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -1,5 +1,10 @@ %bcond_without sys_llvm %bcond_without check +%bcond_without toolchain_clang + +%if %{with toolchain_clang} +%global toolchain clang +%endif %global maj_ver 17 %global min_ver 0 @@ -27,7 +32,7 @@ Name: %{pkg_name} Version: %{crt_version} -Release: 3 +Release: 4 Summary: LLVM "compiler-rt" runtime libraries License: NCSA or MIT @@ -44,6 +49,9 @@ BuildRequires: ninja-build BuildRequires: python3 # We need python3-devel for pathfix.py. BuildRequires: python3-devel +%if %{with toolchain_clang} +BuildRequires: clang +%endif %if %{with sys_llvm} BuildRequires: llvm-devel = %{version} @@ -83,6 +91,10 @@ cd _build -DLLVM_LIBDIR_SUFFIX=64 \ %else -DLLVM_LIBDIR_SUFFIX= \ +%endif +%if "%{toolchain}" == "clang" + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ %endif -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? @@ -109,6 +121,9 @@ cd _build %endif %changelog +* Fri Jul 5 2024 liyunfei - 17.0.6-4 +- Add toolchain_clang build support + * Wed Apr 03 2024 zhanglimin - 17.0.6-3 - Improve the support for compiler-rt on LoongArch -- Gitee