!15 Add toolchain_clang build support

From: @liyunfei33 
Reviewed-by: @cf-zhao 
Signed-off-by: @cf-zhao
This commit is contained in:
openeuler-ci-bot 2024-07-12 13:48:26 +00:00 committed by Gitee
commit 955b6790f5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,5 +1,10 @@
%bcond_without sys_llvm %bcond_without sys_llvm
%bcond_without check %bcond_without check
%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
@ -32,7 +37,7 @@
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 2 Release: 3
Summary: The LLVM Linker Summary: The LLVM Linker
License: NCSA License: NCSA
@ -104,6 +109,10 @@ cd _build
-DLLVM_LIT_ARGS="-sv \ -DLLVM_LIT_ARGS="-sv \
--path %{install_prefix}" \ --path %{install_prefix}" \
-DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \ -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 -DLLVM_MAIN_SRC_DIR=%{install_prefix}/src
%ninja_build %ninja_build
@ -131,6 +140,9 @@ rm %{buildroot}%{install_includedir}/mach-o/compact_unwind_encoding.h
%{install_libdir}/liblld*.so.* %{install_libdir}/liblld*.so.*
%changelog %changelog
* Fri Jul 5 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-3
- Add toolchain_clang build support
* Mon Mar 25 2024 zhanglimin <zhanglimin@loongson.cn> - 17.0.6-2 * Mon Mar 25 2024 zhanglimin <zhanglimin@loongson.cn> - 17.0.6-2
- Supoort `relax` feature on LoongArch - Supoort `relax` feature on LoongArch