Blame SPECS/compat-libgfortran-48.spec

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