Build with Thin LTO

Full LTO is too memory intensive for most architectures, so use Thin LTO
instead.
This commit is contained in:
Tom Stellard 2021-10-25 17:18:26 +00:00
parent 6b3a1ab316
commit dd5bd14efc
1 changed files with 10 additions and 9 deletions

View File

@ -67,7 +67,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 5%{?dist}
Release: 6%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@ -207,15 +207,13 @@ LLVM's modified googletest sources.
%build
# Disable LTO on s390x, this causes some test failures:
# LLVM-Unit :: Target/AArch64/./AArch64Tests/InstSizes.Authenticated
# LLVM-Unit :: Target/AArch64/./AArch64Tests/InstSizes.PATCHPOINT
# LLVM-Unit :: Target/AArch64/./AArch64Tests/InstSizes.STACKMAP
# LLVM-Unit :: Target/AArch64/./AArch64Tests/InstSizes.TLSDESC_CALLSEQ
# On X86_64, LTO builds of TableGen crash. This can be reproduced by:
# %%cmake_build --target include/llvm/IR/IntrinsicsAArch64.h
# Because of these failures, lto is disabled for now.
# Disable lto on s390x due to https://bugzilla.redhat.com/show_bug.cgi?id=2017193
# Disable lto on arm due to https://bugzilla.redhat.com/show_bug.cgi?id=1918924
%ifarch s390x %{arm}
%global _lto_cflags %{nil}
%else
%global _lto_cflags -flto=thin
%endif
%ifarch s390 s390x %{arm} %ix86
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
@ -549,6 +547,9 @@ fi
%endif
%changelog
* Mon Oct 25 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-6
- Build with Thin LTO
* Mon Oct 18 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-5
- Build with clang