Blame SPECS/compat-libgfortran-48.spec

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