Disable LTO, use -march=x86-64, apply tweaks.patch.

Resolves: #1916228
This commit is contained in:
Marek Polacek 2021-01-21 10:45:16 -05:00
parent 8fd4b7d558
commit bae06e86ab
2 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,8 @@
%undefine _annotated_build
# Hardening slows the compiler way too much.
%undefine _hardened_build
# libgcc crashes left and right with LTO.
%global _lto_cflags %%{nil}
Summary: Compatibility Fortran runtime library version 4.8.5
Name: compat-libgfortran-48
%global gcc_version 4.8.5
@ -154,6 +156,7 @@ Patch70: gcc48-pr66840.patch
Patch71: gcc48-rh1546372.patch
Patch72: gcc48-libc-name.patch
Patch73: gcc48-ucontext.patch
Patch74: gcc48-tweaks.patch
Patch1301: gcc48-rh1469697-1.patch
Patch1302: gcc48-rh1469697-2.patch
@ -295,6 +298,7 @@ touch -r %{PATCH27} libstdc++-v3/python/libstdcxx/v6/printers.py
%patch71 -p0 -b .rh1546372~
%patch72 -p0 -b .libc-name~
%patch73 -p0 -b .ucontext~
%patch74 -p0 -b .tweaks~
%patch1301 -p1 -b .stack-clash-1~
%patch1302 -p1 -b .stack-clash-2~
@ -356,6 +360,7 @@ OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'`
# GCC 4.8 doesn't know these options, but redhat-rpm-config supplies them.
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -fstack-clash-protection -fcf-protection/ /g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Werror=format-security/-Wformat-security/g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=x86-64-v2/-march=x86-64/g'`
%ifarch %{ix86}
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
%endif

11
gcc48-tweaks.patch Normal file
View File

@ -0,0 +1,11 @@
--- gcc/reload.h.mp 2021-01-20 20:20:33.565766631 -0500
+++ gcc/reload.h 2021-01-20 20:20:48.437724432 -0500
@@ -166,7 +166,7 @@ struct target_reload {
value indicates the level of indirect addressing supported, e.g., two
means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
a hard register. */
- bool x_spill_indirect_levels;
+ unsigned char x_spill_indirect_levels;
/* True if caller-save has been reinitialized. */
bool x_caller_save_initialized_p;