Blame SPECS/compat-libgfortran-48.spec

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