From 18e651877c7572941369ae43d09c0d62ffd7508f Mon Sep 17 00:00:00 2001 From: liyunfei Date: Fri, 5 Jul 2024 11:05:43 +0800 Subject: [PATCH] Add toolchain_clang build support Signed-off-by: liyunfei (cherry picked from commit a442bc3e3fe6b523e0ba57eafca37da44820592e) --- lld.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lld.spec b/lld.spec index f777bdc..877352a 100644 --- a/lld.spec +++ b/lld.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 @@ -32,7 +37,7 @@ Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 2 +Release: 3 Summary: The LLVM Linker License: NCSA @@ -104,6 +109,10 @@ cd _build -DLLVM_LIT_ARGS="-sv \ --path %{install_prefix}" \ -DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \ +%if "%{toolchain}" == "clang" + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ +%endif -DLLVM_MAIN_SRC_DIR=%{install_prefix}/src %ninja_build @@ -131,6 +140,9 @@ rm %{buildroot}%{install_includedir}/mach-o/compact_unwind_encoding.h %{install_libdir}/liblld*.so.* %changelog +* Fri Jul 5 2024 liyunfei - 17.0.6-3 +- Add toolchain_clang build support + * Mon Mar 25 2024 zhanglimin - 17.0.6-2 - Supoort `relax` feature on LoongArch -- Gitee