From bbf69479e8a42014466e34ea019d8f8f4d805081 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Mon, 30 Oct 2023 20:17:19 +0200 Subject: [PATCH] Add support for riscv64 Signed-off-by: David Abdurachmanov --- llvm16.spec | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/llvm16.spec b/llvm16.spec index 76bce53..1a441af 100644 --- a/llvm16.spec +++ b/llvm16.spec @@ -15,7 +15,11 @@ %endif %bcond_without compat_build +%ifnarch riscv64 %bcond_without check +%else +%bcond_with check +%endif #global rc_ver 4 %global maj_ver 16 @@ -24,7 +28,12 @@ %global llvm_srcdir llvm-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src %global cmake_srcdir cmake-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src %global third_party_srcdir third-party-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src +%ifnarch riscv64 %global _lto_cflags -flto=thin +%else +# riscv64: gold is not supported on riscv64 +%global _lto_cflags %{nil} +%endif %if %{with compat_build} %global pkg_name llvm%{maj_ver} @@ -75,7 +84,7 @@ Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} -Release: 5%{?dist} +Release: 5.0.riscv64%{?dist} Summary: The Low Level Virtual Machine License: Apache-2.0 WITH LLVM-exception OR NCSA @@ -243,7 +252,7 @@ mv %{third_party_srcdir} third-party %build -%ifarch s390 s390x %{arm} %ix86 +%ifarch s390 s390x %{arm} %ix86 riscv64 # Decrease debuginfo verbosity to reduce memory consumption during final library linking %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif @@ -257,7 +266,7 @@ export ASMFLAGS=$CFLAGS -DLLVM_PARALLEL_LINK_JOBS=1 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -%ifarch s390 %{arm} %ix86 +%ifarch s390 %{arm} %ix86 riscv64 -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ %endif @@ -572,6 +581,11 @@ fi %endif %changelog +* Mon Oct 30 2023 David Abdurachmanov - 16.0.6-5.0.riscv64 +- Disable tests on riscv64 for now +- Lower memory consumption on riscv64 +- Disable LTO (ld.gold not supported on riscv64) + * Thu Jul 20 2023 Fedora Release Engineering - 16.0.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild