Blame SPECS/compat-libgfortran-48.spec

4dd737
%global DATE 20150702
4dd737
%global SVNREV 225304
4dd737
# Note, gcc_release must be integer, if you want to add suffixes to
4dd737
# %{release}, append them after %{gcc_release} on Release: line.
4dd737
%global gcc_release 36
4dd737
%global _unpackaged_files_terminate_build 0
4dd737
%global _performance_build 1
4dd737
%undefine _annotated_build
4dd737
# Hardening slows the compiler way too much.
4dd737
%undefine _hardened_build
4dd737
# libgcc crashes left and right with LTO.
4dd737
%global _lto_cflags %%{nil}
4dd737
Summary: Compatibility Fortran runtime library version 4.8.5
4dd737
Name: compat-libgfortran-48
4dd737
%global gcc_version 4.8.5
4dd737
Version: %{gcc_version}
4dd737
Release: %{gcc_release}.5%{?dist}
4dd737
# libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
4dd737
# GCC Runtime Exception.
4dd737
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
4dd737
Group: Development/Languages
4dd737
# The source for this package was pulled from upstream's vcs.  Use the
4dd737
# following commands to generate the tarball:
4dd737
# svn export svn://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_8-branch@%%{SVNREV} gcc-%%{version}-%%{DATE}
4dd737
# tar cf - gcc-%%{version}-%%{DATE} | bzip2 -9 > gcc-%%{version}-%%{DATE}.tar.bz2
4dd737
Source0: gcc-%{version}-%{DATE}.tar.bz2
4dd737
URL: http://gcc.gnu.org
4dd737
# Need binutils with -pie support >= 2.14.90.0.4-4
4dd737
# Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4
4dd737
# Need binutils which handle -msecure-plt on ppc >= 2.16.91.0.2-2
4dd737
# Need binutils which support .weakref >= 2.16.91.0.3-1
4dd737
# Need binutils which support --hash-style=gnu >= 2.17.50.0.2-7
4dd737
# Need binutils which support mffgpr and mftgpr >= 2.17.50.0.2-8
4dd737
# Need binutils which support --build-id >= 2.17.50.0.17-3
4dd737
# Need binutils which support %gnu_unique_object >= 2.19.51.0.14
4dd737
# Need binutils which support .cfi_sections >= 2.19.51.0.14-33
4dd737
# Need binutils which support --no-add-needed >= 2.20.51.0.2-12
4dd737
BuildRequires: binutils >= 2.20.51.0.2-12
4dd737
# While gcc doesn't include statically linked binaries, during testing
4dd737
# -static is used several times.
4dd737
BuildRequires: glibc-static
4dd737
BuildRequires: gcc, gcc-c++, make
4dd737
BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, sharutils
4dd737
BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1, libmpc-devel >= 0.8.1
4dd737
# For VTA guality testing
4dd737
BuildRequires: gdb
4dd737
# Make sure pthread.h doesn't contain __thread tokens
4dd737
# Make sure glibc supports stack protector
4dd737
# Make sure glibc supports DT_GNU_HASH
4dd737
BuildRequires: glibc-devel >= 2.4.90-13
4dd737
BuildRequires: elfutils-devel >= 0.147
4dd737
BuildRequires: elfutils-libelf-devel >= 0.147
4dd737
%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha
4dd737
# Make sure glibc supports TFmode long double
4dd737
BuildRequires: glibc >= 2.3.90-35
4dd737
%endif
4dd737
# Need .eh_frame ld optimizations
4dd737
# Need proper visibility support
4dd737
# Need -pie support
4dd737
# Need --as-needed/--no-as-needed support
4dd737
# On ppc64, need omit dot symbols support and --non-overlapping-opd
4dd737
# Need binutils that owns /usr/bin/c++filt
4dd737
# Need binutils that support .weakref
4dd737
# Need binutils that supports --hash-style=gnu
4dd737
# Need binutils that support mffgpr/mftgpr
4dd737
# Need binutils that support --build-id
4dd737
# Need binutils that support %gnu_unique_object
4dd737
# Need binutils that support .cfi_sections
4dd737
# Need binutils that support --no-add-needed
4dd737
Requires: binutils >= 2.20.51.0.2-12
4dd737
# Make sure gdb will understand DW_FORM_strp
4dd737
Conflicts: gdb < 5.1-2
4dd737
Requires: glibc-devel >= 2.2.90-12
4dd737
%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha
4dd737
# Make sure glibc supports TFmode long double
4dd737
Requires: glibc >= 2.3.90-35
4dd737
%endif
4dd737
%ifarch %{ix86} x86_64
4dd737
%global build_libquadmath 1
4dd737
%else
4dd737
%global build_libquadmath 0
4dd737
%endif
4dd737
%if %{build_libquadmath}
4dd737
# Use the system libquadmath.		  
4dd737
BuildRequires: libquadmath >= 8.2.1
4dd737
%endif
4dd737
4dd737
Patch0: gcc48-hack.patch
4dd737
Patch1: gcc48-java-nomulti.patch
4dd737
Patch2: gcc48-ppc32-retaddr.patch
4dd737
Patch3: gcc48-rh330771.patch
4dd737
Patch4: gcc48-i386-libgomp.patch
4dd737
Patch5: gcc48-sparc-config-detection.patch
4dd737
Patch6: gcc48-libgomp-omp_h-multilib.patch
4dd737
Patch7: gcc48-libtool-no-rpath.patch
4dd737
Patch10: gcc48-pr38757.patch
4dd737
Patch12: gcc48-no-add-needed.patch
4dd737
Patch13: gcc48-pr56564.patch
4dd737
Patch14: gcc48-color-auto.patch
4dd737
Patch15: gcc48-pr28865.patch
4dd737
Patch16: gcc48-libgo-p224.patch
4dd737
Patch17: gcc48-pr60010.patch
4dd737
Patch18: gcc48-aarch64-ada.patch
4dd737
Patch19: gcc48-aarch64-async-unw-tables.patch
4dd737
Patch20: gcc48-aarch64-unwind-opt.patch
4dd737
Patch21: gcc48-rh1243366.patch
4dd737
Patch22: gcc48-rh1180633.patch
4dd737
Patch23: gcc48-rh1278872.patch
4dd737
Patch24: gcc48-pr67281.patch
4dd737
Patch25: gcc48-pr68680.patch
4dd737
Patch26: gcc48-rh1312436.patch
4dd737
Patch27: gcc48-pr53477.patch
4dd737
Patch28: gcc48-rh1296211.patch
4dd737
Patch29: gcc48-rh1304449.patch
4dd737
Patch30: gcc48-s390-z13.patch
4dd737
Patch31: gcc48-rh1312850.patch
4dd737
Patch32: gcc48-pr65142.patch
4dd737
Patch33: gcc48-pr52714.patch
4dd737
Patch34: gcc48-rh1344807.patch
4dd737
Patch35: gcc48-libgomp-20160715.patch
4dd737
Patch36: gcc48-pr63293.patch
4dd737
Patch37: gcc48-pr72863.patch
4dd737
Patch38: gcc48-pr78064.patch
4dd737
Patch39: gcc48-pr62258.patch
4dd737
Patch40: gcc48-rh1369183.patch
4dd737
Patch41: gcc48-pr68184.patch
4dd737
Patch42: gcc48-pr79439.patch
4dd737
Patch43: gcc48-pr66731.patch
4dd737
Patch44: gcc48-pr69116.patch
4dd737
Patch45: gcc48-pr72747.patch
4dd737
Patch46: gcc48-pr78796.patch
4dd737
Patch47: gcc48-pr79969.patch
4dd737
Patch48: gcc48-pr78875.patch
4dd737
Patch49: gcc48-rh1402585.patch
4dd737
Patch50: gcc48-pr70549.patch
4dd737
Patch51: gcc48-rh1457969.patch
4dd737
Patch52: gcc48-pr69644.patch
4dd737
Patch53: gcc48-rh1487434.patch
4dd737
Patch54: gcc48-rh1468546.patch
4dd737
Patch55: gcc48-rh1469384.patch
4dd737
Patch56: gcc48-rh1491395.patch
4dd737
Patch57: gcc48-rh1482762.patch
4dd737
Patch58: gcc48-pr77375.patch
4dd737
Patch59: gcc48-pr77767.patch
4dd737
Patch60: gcc48-pr78378.patch
4dd737
Patch61: gcc48-pr80129.patch
4dd737
Patch62: gcc48-pr80362.patch
4dd737
Patch63: gcc48-pr80692.patch
4dd737
Patch64: gcc48-pr82274.patch
4dd737
Patch65: gcc48-pr78416.patch
4dd737
Patch66: gcc48-rh1546728.patch
4dd737
Patch67: gcc48-rh1555397.patch
4dd737
Patch68: gcc48-pr81395.patch
4dd737
Patch69: gcc48-pr72717.patch
4dd737
Patch70: gcc48-pr66840.patch
4dd737
Patch71: gcc48-rh1546372.patch
4dd737
Patch72: gcc48-libc-name.patch
4dd737
Patch73: gcc48-ucontext.patch
4dd737
Patch74: gcc48-tweaks.patch
4dd737
4dd737
Patch1301: gcc48-rh1469697-1.patch
4dd737
Patch1302: gcc48-rh1469697-2.patch
4dd737
Patch1303: gcc48-rh1469697-3.patch
4dd737
Patch1304: gcc48-rh1469697-4.patch
4dd737
Patch1305: gcc48-rh1469697-5.patch
4dd737
Patch1306: gcc48-rh1469697-6.patch
4dd737
Patch1307: gcc48-rh1469697-7.patch
4dd737
Patch1308: gcc48-rh1469697-8.patch
4dd737
Patch1309: gcc48-rh1469697-9.patch
4dd737
Patch1310: gcc48-rh1469697-10.patch
4dd737
Patch1311: gcc48-rh1469697-11.patch
4dd737
Patch1312: gcc48-rh1469697-12.patch
4dd737
Patch1313: gcc48-rh1469697-13.patch
4dd737
Patch1314: gcc48-rh1469697-14.patch
4dd737
Patch1315: gcc48-rh1469697-15.patch
4dd737
Patch1316: gcc48-rh1469697-16.patch
4dd737
Patch1317: gcc48-rh1469697-17.patch
4dd737
Patch1318: gcc48-rh1469697-18.patch
4dd737
Patch1319: gcc48-rh1469697-19.patch
4dd737
Patch1320: gcc48-rh1469697-20.patch
4dd737
Patch1321: gcc48-rh1469697-21.patch
4dd737
Patch1322: gcc48-rh1469697-22.patch
4dd737
Patch1323: gcc48-rh1469697-23.patch
4dd737
Patch1324: gcc48-rh1537828-1.patch
4dd737
Patch1325: gcc48-rh1537828-2.patch
4dd737
Patch1326: gcc48-rh1537828-3.patch
4dd737
Patch1327: gcc48-rh1537828-4.patch
4dd737
Patch1328: gcc48-rh1537828-5.patch
4dd737
Patch1329: gcc48-rh1537828-10.patch
4dd737
4dd737
Patch1401: gcc48-rh1535655-1.patch
4dd737
Patch1402: gcc48-rh1535655-2.patch
4dd737
Patch1403: gcc48-rh1535655-3.patch
4dd737
Patch1404: gcc48-rh1535655-4.patch
4dd737
Patch1405: gcc48-rh1535655-5.patch
4dd737
Patch1406: gcc48-rh1535655-6.patch
4dd737
Patch1407: gcc48-rh1552021.patch
4dd737
Patch1408: gcc48-rh1537828-6.patch
4dd737
Patch1409: gcc48-rh1537828-7.patch
4dd737
Patch1410: gcc48-rh1537828-8.patch
4dd737
Patch1411: gcc48-rh1537828-9.patch
4dd737
4dd737
# On ARM EABI systems, we do want -gnueabi to be part of the
4dd737
# target triple.
4dd737
%ifnarch %{arm}
4dd737
%global _gnu %{nil}
4dd737
%endif
4dd737
%ifarch sparcv9
4dd737
%global gcc_target_platform sparc64-%{_vendor}-%{_target_os}
4dd737
%endif
4dd737
%ifarch ppc ppc64p7
4dd737
%global gcc_target_platform ppc64-%{_vendor}-%{_target_os}
4dd737
%endif
4dd737
%ifnarch sparcv9 ppc ppc64p7
4dd737
%global gcc_target_platform %{_target_platform}
4dd737
%endif
4dd737
4dd737
%description
4dd737
This package includes a Fortran 95 runtime library for compatibility
4dd737
with GCC 4.8.x-RH compiled Fortran applications.
4dd737
4dd737
%prep
4dd737
%setup -q -n gcc-%{version}-%{DATE}
4dd737
%patch0 -p0 -b .hack~
4dd737
%patch1 -p0 -b .java-nomulti~
4dd737
%patch2 -p0 -b .ppc32-retaddr~
4dd737
%patch3 -p0 -b .rh330771~
4dd737
%patch4 -p0 -b .i386-libgomp~
4dd737
%patch5 -p0 -b .sparc-config-detection~
4dd737
%patch6 -p0 -b .libgomp-omp_h-multilib~
4dd737
%patch7 -p0 -b .libtool-no-rpath~
4dd737
%patch10 -p0 -b .pr38757~
4dd737
%patch12 -p0 -b .no-add-needed~
4dd737
%patch13 -p0 -b .pr56564~
4dd737
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
4dd737
%patch14 -p0 -b .color-auto~
4dd737
%endif
4dd737
%patch15 -p0 -b .pr28865~
4dd737
%patch16 -p0 -b .libgo-p224~
4dd737
rm -f libgo/go/crypto/elliptic/p224{,_test}.go
4dd737
%patch17 -p0 -b .pr60010~
4dd737
%ifarch aarch64
4dd737
%patch18 -p0 -b .aarch64-ada~
4dd737
%endif
4dd737
%patch19 -p0 -b .aarch64-async-unw-tables~
4dd737
%patch20 -p0 -b .aarch64-unwind-opt~
4dd737
%patch21 -p0 -b .rh1243366~
4dd737
%patch22 -p0 -b .rh1180633~
4dd737
%patch23 -p0 -b .rh1278872~
4dd737
%patch24 -p0 -b .pr67281~
4dd737
%patch25 -p0 -b .pr68680~
4dd737
%patch26 -p0 -b .rh1312436~
4dd737
%patch27 -p0 -b .pr53477~
4dd737
touch -r %{PATCH27} libstdc++-v3/python/libstdcxx/v6/printers.py
4dd737
%patch28 -p0 -b .rh1296211~
4dd737
%patch29 -p0 -b .rh1304449~
4dd737
%patch30 -p0 -b .s390-z13~
4dd737
%patch31 -p0 -b .rh1312850~
4dd737
%patch32 -p0 -b .pr65142~
4dd737
%patch33 -p0 -b .pr52714~
4dd737
%patch34 -p0 -b .rh1344807~
4dd737
%patch35 -p0 -b .libgomp-20160715~
4dd737
%patch36 -p0 -b .pr63293~
4dd737
%patch37 -p0 -b .pr72863~
4dd737
%patch38 -p0 -b .pr78064~
4dd737
%patch39 -p0 -b .pr62258~
4dd737
%patch40 -p0 -b .rh1369183~
4dd737
%patch41 -p0 -b .pr68184~
4dd737
%patch42 -p0 -b .pr79439~
4dd737
%patch43 -p0 -b .pr66731~
4dd737
%patch44 -p0 -b .pr69116~
4dd737
%patch45 -p0 -b .pr72747~
4dd737
%patch46 -p0 -b .pr78796~
4dd737
%patch47 -p0 -b .pr79969~
4dd737
%patch48 -p0 -b .pr78875~
4dd737
%patch49 -p0 -b .rh1402585~
4dd737
%patch50 -p0 -b .pr70549~
4dd737
%patch51 -p0 -b .rh1457969~
4dd737
%patch52 -p0 -b .pr69644~
4dd737
%patch53 -p0 -b .rh1487434~
4dd737
%patch54 -p0 -b .rh1468546~
4dd737
%patch55 -p0 -b .rh1469384~
4dd737
%patch56 -p0 -b .rh1491395~
4dd737
%patch57 -p0 -b .rh1482762~
4dd737
%patch58 -p0 -b .pr77375~
4dd737
%patch59 -p0 -b .pr77767~
4dd737
%patch60 -p0 -b .pr78378~
4dd737
%patch61 -p0 -b .pr80129~
4dd737
%patch62 -p0 -b .pr80362~
4dd737
%patch63 -p0 -b .pr80692~
4dd737
%patch64 -p0 -b .pr82274~
4dd737
%patch65 -p0 -b .pr78416~
4dd737
%patch66 -p0 -b .rh1546728~
4dd737
%patch67 -p0 -b .rh1555397~
4dd737
%patch68 -p0 -b .pr81395~
4dd737
%patch69 -p0 -b .pr72717~
4dd737
%patch70 -p0 -b .pr66840~
4dd737
%patch71 -p0 -b .rh1546372~
4dd737
%patch72 -p0 -b .libc-name~
4dd737
%patch73 -p0 -b .ucontext~
4dd737
%patch74 -p0 -b .tweaks~
4dd737
4dd737
%patch1301 -p1 -b .stack-clash-1~
4dd737
%patch1302 -p1 -b .stack-clash-2~
4dd737
%patch1303 -p1 -b .stack-clash-3~
4dd737
%patch1304 -p1 -b .stack-clash-4~
4dd737
%patch1305 -p1 -b .stack-clash-5~
4dd737
%patch1306 -p1 -b .stack-clash-6~
4dd737
%patch1307 -p1 -b .stack-clash-7~
4dd737
%patch1308 -p1 -b .stack-clash-8~
4dd737
%patch1309 -p1 -b .stack-clash-9~
4dd737
%patch1310 -p1 -b .stack-clash-10~
4dd737
%patch1311 -p1 -b .stack-clash-11~
4dd737
%patch1312 -p1 -b .stack-clash-12~
4dd737
%patch1313 -p1 -b .stack-clash-13~
4dd737
%patch1314 -p1 -b .stack-clash-14~
4dd737
%patch1315 -p1 -b .stack-clash-15~
4dd737
%patch1316 -p1 -b .stack-clash-16~
4dd737
%patch1317 -p1 -b .stack-clash-17~
4dd737
%patch1318 -p1 -b .stack-clash-18~
4dd737
%patch1319 -p1 -b .stack-clash-19~
4dd737
%patch1320 -p1 -b .stack-clash-20~
4dd737
%patch1321 -p1 -b .stack-clash-21~
4dd737
%patch1322 -p1 -b .stack-clash-22~
4dd737
%patch1323 -p1 -b .stack-clash-23~
4dd737
%patch1324 -p1 -b .stack-clash-24~
4dd737
%patch1325 -p1 -b .stack-clash-25~
4dd737
%patch1326 -p1 -b .stack-clash-26~
4dd737
%patch1327 -p1 -b .stack-clash-27~
4dd737
%patch1328 -p1 -b .stack-clash-28~
4dd737
%patch1329 -p1 -b .stack-clash-29~
4dd737
4dd737
%patch1401 -p1 -b .retpolines-1~
4dd737
%patch1402 -p1 -b .retpolines-2~
4dd737
%patch1403 -p1 -b .retpolines-3~
4dd737
%patch1404 -p1 -b .retpolines-4~
4dd737
%patch1405 -p1 -b .retpolines-5~
4dd737
%patch1406 -p1 -b .retpolines-6~
4dd737
%patch1407 -p0 -b .retpolines-7~
4dd737
%patch1408 -p0 -b .retpolines-8~
4dd737
%patch1409 -p1 -b .retpolines-9~
4dd737
%patch1410 -p1 -b .retpolines-10~
4dd737
%patch1411 -p1 -b .retpolines-11~
4dd737
4dd737
%build
4dd737
4dd737
# Undo the broken autoconf change in recent Fedora versions
4dd737
export CONFIG_SITE=NONE
4dd737
4dd737
rm -fr obj-%{gcc_target_platform}
4dd737
mkdir obj-%{gcc_target_platform}
4dd737
cd obj-%{gcc_target_platform}
4dd737
4dd737
CC=gcc
4dd737
CXX=g++
4dd737
OPT_FLAGS=`echo %{optflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g'`
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'`
4dd737
# GCC 4.8 doesn't know these options, but redhat-rpm-config supplies them.
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -fstack-clash-protection -fcf-protection/ /g'`
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Werror=format-security/-Wformat-security/g'`
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=x86-64-v2/-march=x86-64/g'`
4dd737
%ifarch %{ix86}
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
4dd737
%endif
4dd737
%ifarch aarch64
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mbranch-protection=standard//g'`
4dd737
%endif
4dd737
%ifarch s390x
4dd737
# Same here.
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=z14 -mtune=z15//g'`
4dd737
%endif
4dd737
%ifarch ppc64le
4dd737
# Same here.  GCC 4.8 doesn't grok power8.
4dd737
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mcpu=power9 -mtune=power9/-mcpu=power7 -mtune=power7/g'`
4dd737
%endif
4dd737
OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
4dd737
case "$OPT_FLAGS" in
4dd737
  *-fasynchronous-unwind-tables*)
4dd737
    sed -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
4dd737
      ../gcc/Makefile.in
4dd737
    ;;
4dd737
esac
4dd737
CC="$CC" CFLAGS="$OPT_FLAGS" \
4dd737
	CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \
4dd737
		  | sed 's/ -Werror=format-security / -Wformat -Werror=format-security /'`" \
4dd737
	XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
4dd737
	../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
4dd737
	--with-bugurl=http://bugzilla.redhat.com/bugzilla \
4dd737
	--disable-bootstrap \
4dd737
	--enable-shared --enable-threads=posix --enable-checking=release \
4dd737
	--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
4dd737
	--enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu \
4dd737
	--enable-languages=c,c++,fortran,lto \
4dd737
	--disable-plugin --enable-initfini-array \
4dd737
	--without-isl --without-cloog \
4dd737
	--enable-gnu-indirect-function \
4dd737
	--disable-libitm --disable-libsanitizer --disable-libgomp \
4dd737
	--disable-libatomic --disable-libstdcxx-pch --disable-libssp \
4dd737
	--disable-libmpx --disable-libcc1 \
4dd737
	--disable-multilib \
4dd737
%ifarch %{arm}
4dd737
	--disable-sjlj-exceptions \
4dd737
%endif
4dd737
%ifarch ppc ppc64 ppc64le ppc64p7
4dd737
	--enable-secureplt \
4dd737
%endif
4dd737
%ifarch sparc sparcv9 sparc64 ppc ppc64 ppc64le ppc64p7 s390 s390x alpha
4dd737
	--with-long-double-128 \
4dd737
%endif
4dd737
%ifarch ppc64le
4dd737
	--enable-targets=powerpcle-linux \
4dd737
%endif
4dd737
%ifarch ppc64le
4dd737
       --with-cpu-64=power8 --with-tune-64=power8 \
4dd737
%endif
4dd737
%ifarch ppc ppc64 ppc64p7
4dd737
%if 0%{?rhel} >= 7
4dd737
	--with-cpu-32=power7 --with-tune-32=power7 --with-cpu-64=power7 --with-tune-64=power7 \
4dd737
%endif
4dd737
%if 0%{?rhel} == 6
4dd737
	--with-cpu-32=power4 --with-tune-32=power6 --with-cpu-64=power4 --with-tune-64=power6 \
4dd737
%endif
4dd737
%endif
4dd737
%ifarch ppc
4dd737
	--build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=default32
4dd737
%endif
4dd737
%ifarch %{ix86} x86_64
4dd737
	--with-tune=generic \
4dd737
%endif
4dd737
%if 0%{?rhel} >= 7
4dd737
%ifarch %{ix86}
4dd737
	--with-arch=x86-64 \
4dd737
%endif
4dd737
%ifarch x86_64
4dd737
	--with-arch_32=x86-64 \
4dd737
%endif
4dd737
%else
4dd737
%ifarch %{ix86}
4dd737
	--with-arch=i686 \
4dd737
%endif
4dd737
%ifarch x86_64
4dd737
	--with-arch_32=i686 \
4dd737
%endif
4dd737
%endif
4dd737
%ifarch s390 s390x
4dd737
%if 0%{?rhel} >= 7
4dd737
	--with-arch=z196 --with-tune=zEC12 --enable-decimal-float \
4dd737
%else
4dd737
	--with-arch=z9-109 --with-tune=z10 --enable-decimal-float \
4dd737
%endif
4dd737
%endif
4dd737
%ifarch armv7hl
4dd737
	--with-cpu=cortex-a8 --with-tune=cortex-a8 --with-arch=armv7-a \
4dd737
	--with-float=hard --with-fpu=vfpv3-d16 --with-abi=aapcs-linux \
4dd737
%endif
4dd737
%ifnarch sparc sparcv9 ppc
4dd737
	--build=%{gcc_target_platform}
4dd737
%endif
4dd737
4dd737
make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z,now MAKEINFO=missing
4dd737
4dd737
%install
4dd737
rm -fr %{buildroot}
4dd737
cd obj-%{gcc_target_platform}
4dd737
mkdir -p %{buildroot}/%{_libdir}
4dd737
4dd737
# Do this so that the resulting .so doesn't have a bogus RPATH.
4dd737
cd %{gcc_target_platform}/libgfortran/
4dd737
mkdir temp
4dd737
%if %{build_libquadmath}
4dd737
# Link against the system libquadmath.
4dd737
# ??? I don't know what I am doing.
4dd737
mkdir libquadmath
4dd737
echo '/* GNU ld script
4dd737
   Use the system libquadmath.so.  */
4dd737
INPUT ( %{_libdir}/libquadmath.so.0.0.0 )' > libquadmath/libquadmath.so
4dd737
export LIBRARY_PATH=`pwd`/libquadmath
4dd737
%endif
4dd737
make install DESTDIR=`pwd`/temp
4dd737
cp -a temp/usr/%{_lib}/libgfortran.so.3* %{buildroot}/%{_libdir}
4dd737
cd ../..
4dd737
4dd737
%check
4dd737
cd obj-%{gcc_target_platform}
4dd737
4dd737
# Run the Fortran tests.
4dd737
make %{?_smp_mflags} -k -C gcc check-gfortran ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ || :
4dd737
echo ====================TESTING=========================
4dd737
( LC_ALL=C ../contrib/test_summary || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}'
4dd737
echo ====================TESTING END=====================
4dd737
mkdir testlogs-%{_target_platform}-%{version}-%{release}
4dd737
for i in `find . -name \*.log | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do
4dd737
  ln $i testlogs-%{_target_platform}-%{version}-%{release}/ || :
4dd737
done
4dd737
tar cf - testlogs-%{_target_platform}-%{version}-%{release} | bzip2 -9c \
4dd737
  | uuencode testlogs-%{_target_platform}.tar.bz2 || :
4dd737
rm -rf testlogs-%{_target_platform}-%{version}-%{release}
4dd737
4dd737
%post -p /sbin/ldconfig
4dd737
4dd737
%postun -p /sbin/ldconfig
4dd737
4dd737
%files
4dd737
%{_libdir}/libgfortran.so.3*
4dd737
4dd737
%changelog
4dd737
* Wed Jan 26 2022 Marek Polacek <polacek@redhat.com> - 4.8.5-36.5
4dd737
- build with -Wl,-z,relro,-z,now (#2044834)
4dd737
4dd737
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 4.8.5-36.4.1
4dd737
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
4dd737
  Related: rhbz#1991688
4dd737
4dd737
* Mon Aug  9 2021 Marek Polacek <polacek@redhat.com> - 4.8.5-36.4
4dd737
- bump for rebuild
4dd737
4dd737
* Fri May 14 2021 Marek Polacek <polacek@redhat.com> - 4.8.5-36.3
4dd737
- invoke make with MAKEINFO=missing (#1951315)
4dd737
4dd737
* Mon Apr 19 2021 Marek Polacek <polacek@redhat.com> - 4.8.5-36.2
4dd737
- use power7 cpu/tuning and filter out -march=z14 -mtune=z15 (#1951315)
4dd737
4dd737
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 4.8.5-36.1.1
4dd737
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
4dd737
4dd737
* Wed Jan 20 2021 Marek Polacek <polacek@redhat.com> 4.8.5-36
4dd737
- new compat library