Blame SPECS/gcc-libraries.spec

bba05e
%global DATE 20170829
bba05e
%global SVNREV 251415
bba05e
%global gcc_version 7.2.1
9c2d31
%global gcc_major 7
1fb7ed
# Note, gcc_release must be integer, if you want to add suffixes to
1fb7ed
# %{release}, append them after %{gcc_release} on Release: line.
bba05e
%global gcc_release 1
1fb7ed
%global mpc_version 0.8.1
1fb7ed
%global _unpackaged_files_terminate_build 0
1fb7ed
%global multilib_64_archs sparc64 ppc64 s390x x86_64
1fb7ed
%ifarch s390x
1fb7ed
%global multilib_32_arch s390
1fb7ed
%endif
1fb7ed
%ifarch sparc64
1fb7ed
%global multilib_32_arch sparcv9
1fb7ed
%endif
1fb7ed
%ifarch ppc64
1fb7ed
%global multilib_32_arch ppc
1fb7ed
%endif
1fb7ed
%ifarch x86_64
1fb7ed
%global multilib_32_arch i686
1fb7ed
%endif
9c2d31
%ifarch %{ix86} x86_64 ia64
9c2d31
%global build_libquadmath 1
9c2d31
%else
9c2d31
%global build_libquadmath 0
9c2d31
%endif
9c2d31
%ifarch %{ix86} x86_64
9c2d31
%global build_libcilkrts 1
9c2d31
%else
9c2d31
%global build_libcilkrts 0
9c2d31
%endif
54e61e
%ifarch aarch64
54e61e
%if 0%{?rhel} >= 7
54e61e
%global build_libatomic 1
54e61e
%else
54e61e
%global build_libatomic 0
54e61e
%endif
54e61e
%endif
54e61e
%ifnarch aarch64
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
%global build_libatomic 0
1fb7ed
%else
1fb7ed
%global build_libatomic 1
1fb7ed
%endif
54e61e
%endif
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
%global build_libitm 0
1fb7ed
%else
1fb7ed
%global build_libitm 1
1fb7ed
%endif
9c2d31
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %{mips}
1fb7ed
%global attr_ifunc 1
1fb7ed
%else
1fb7ed
%global attr_ifunc 0
1fb7ed
%endif
1fb7ed
Summary: GCC runtime libraries
1fb7ed
Name: gcc-libraries
9c2d31
Provides: libatomic libitm libcilkrts libgfortran4
1fb7ed
Obsoletes: libitm
1fb7ed
1fb7ed
Version: %{gcc_version}
bba05e
Release: %{gcc_release}.1.1%{?dist}
1fb7ed
# libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
1fb7ed
# GCC Runtime Exception.
1fb7ed
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
1fb7ed
Group: System Environment/Libraries
1fb7ed
# The source for this package was pulled from upstream's vcs.  Use the
1fb7ed
# following commands to generate the tarball:
bba05e
# svn export svn://gcc.gnu.org/svn/gcc/branches/redhat/gcc-7-branch@%{SVNREV} gcc-%{version}-%{DATE}
1fb7ed
# tar cf - gcc-%{version}-%{DATE} | bzip2 -9 > gcc-%{version}-%{DATE}.tar.bz2
1fb7ed
Source0: gcc-%{version}-%{DATE}.tar.bz2
1fb7ed
Source1: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
1fb7ed
URL: http://gcc.gnu.org
1fb7ed
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1fb7ed
# Need binutils with -pie support >= 2.14.90.0.4-4
1fb7ed
# Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4
1fb7ed
# Need binutils which handle -msecure-plt on ppc >= 2.16.91.0.2-2
1fb7ed
# Need binutils which support .weakref >= 2.16.91.0.3-1
1fb7ed
# Need binutils which support --hash-style=gnu >= 2.17.50.0.2-7
1fb7ed
# Need binutils which support mffgpr and mftgpr >= 2.17.50.0.2-8
1fb7ed
# Need binutils which support --build-id >= 2.17.50.0.17-3
1fb7ed
# Need binutils which support %gnu_unique_object >= 2.19.51.0.14
1fb7ed
# Need binutils which support .cfi_sections >= 2.19.51.0.14-33
9c2d31
# Need binutils which support --no-add-needed >= 2.20.51.0.2-12
9c2d31
# Need binutils which support -plugin
9c2d31
BuildRequires: binutils >= 2.24
1fb7ed
# While gcc doesn't include statically linked binaries, during testing
1fb7ed
# -static is used several times.
1fb7ed
BuildRequires: glibc-static
1fb7ed
BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, texinfo, sharutils
1fb7ed
BuildRequires: /usr/bin/pod2man
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
BuildRequires: texinfo-tex
1fb7ed
%endif
1fb7ed
# For VTA guality testing
1fb7ed
BuildRequires: gdb
1fb7ed
# Make sure pthread.h doesn't contain __thread tokens
1fb7ed
# Make sure glibc supports stack protector
1fb7ed
# Make sure glibc supports DT_GNU_HASH
1fb7ed
BuildRequires: glibc-devel >= 2.4.90-13
1fb7ed
BuildRequires: elfutils-devel >= 0.147
1fb7ed
BuildRequires: elfutils-libelf-devel >= 0.147
1fb7ed
%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha
1fb7ed
# Make sure glibc supports TFmode long double
1fb7ed
BuildRequires: glibc >= 2.3.90-35
1fb7ed
%endif
1fb7ed
%ifarch %{multilib_64_archs} sparcv9 ppc
1fb7ed
# Ensure glibc{,-devel} is installed for both multilib arches
1fb7ed
BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so
1fb7ed
%endif
1fb7ed
%ifarch ia64
1fb7ed
BuildRequires: libunwind >= 0.98
1fb7ed
%endif
1fb7ed
# Need .eh_frame ld optimizations
1fb7ed
# Need proper visibility support
1fb7ed
# Need -pie support
1fb7ed
# Need --as-needed/--no-as-needed support
1fb7ed
# On ppc64, need omit dot symbols support and --non-overlapping-opd
1fb7ed
# Need binutils that owns /usr/bin/c++filt
1fb7ed
# Need binutils that support .weakref
1fb7ed
# Need binutils that supports --hash-style=gnu
1fb7ed
# Need binutils that support mffgpr/mftgpr
9c2d31
# Need binutils that support --build-id
9c2d31
# Need binutils that support %gnu_unique_object
9c2d31
# Need binutils that support .cfi_sections
9c2d31
# Need binutils that support --no-add-needed
9c2d31
# Need binutils that support -plugin
9c2d31
Requires: binutils >= 2.24
1fb7ed
# Make sure gdb will understand DW_FORM_strp
1fb7ed
Conflicts: gdb < 5.1-2
1fb7ed
Requires: glibc-devel >= 2.2.90-12
1fb7ed
%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha
1fb7ed
# Make sure glibc supports TFmode long double
1fb7ed
Requires: glibc >= 2.3.90-35
1fb7ed
%endif
1fb7ed
Requires: libgcc >= 4.1.2-43
1fb7ed
Requires: libgomp >= 4.4.4-13
1fb7ed
BuildRequires: gmp-devel >= 4.1.2-8
1fb7ed
BuildRequires: mpfr-devel >= 2.2.1
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
BuildRequires: libmpc-devel >= 0.8.1
1fb7ed
%endif
1fb7ed
Requires(post): /sbin/install-info
1fb7ed
Requires(preun): /sbin/install-info
9c2d31
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390 s390x aarch64
1fb7ed
1fb7ed
%global oformat %{nil}
1fb7ed
%global oformat2 %{nil}
1fb7ed
%ifarch %{ix86}
1fb7ed
%global oformat OUTPUT_FORMAT(elf32-i386)
1fb7ed
%endif
1fb7ed
%ifarch x86_64
1fb7ed
%global oformat OUTPUT_FORMAT(elf64-x86-64)
1fb7ed
%global oformat2 OUTPUT_FORMAT(elf32-i386)
1fb7ed
%endif
1fb7ed
%ifarch ppc
1fb7ed
%global oformat OUTPUT_FORMAT(elf32-powerpc)
1fb7ed
%global oformat2 OUTPUT_FORMAT(elf64-powerpc)
1fb7ed
%endif
1fb7ed
%ifarch ppc64
1fb7ed
%global oformat OUTPUT_FORMAT(elf64-powerpc)
1fb7ed
%global oformat2 OUTPUT_FORMAT(elf32-powerpc)
1fb7ed
%endif
1fb7ed
%ifarch s390
1fb7ed
%global oformat OUTPUT_FORMAT(elf32-s390)
1fb7ed
%endif
1fb7ed
%ifarch s390x
1fb7ed
%global oformat OUTPUT_FORMAT(elf64-s390)
1fb7ed
%global oformat2 OUTPUT_FORMAT(elf32-s390)
1fb7ed
%endif
1fb7ed
%ifarch ia64
1fb7ed
%global oformat OUTPUT_FORMAT(elf64-ia64-little)
1fb7ed
%endif
54e61e
%ifarch ppc64le
54e61e
%global oformat OUTPUT_FORMAT(elf64-powerpcle)
54e61e
%endif
1fb7ed
9c2d31
Patch0: gcc7-hack.patch
9c2d31
Patch1: gcc7-ppc32-retaddr.patch
9c2d31
Patch2: gcc7-i386-libgomp.patch
9c2d31
Patch3: gcc7-sparc-config-detection.patch
9c2d31
Patch4: gcc7-libgomp-omp_h-multilib.patch
9c2d31
Patch5: gcc7-libtool-no-rpath.patch
9c2d31
Patch6: gcc7-isl-dl.patch
9c2d31
Patch7: gcc7-libstdc++-docs.patch
9c2d31
Patch8: gcc7-no-add-needed.patch
9c2d31
Patch9: gcc7-aarch64-async-unw-tables.patch
9c2d31
Patch10: gcc7-foffload-default.patch
9c2d31
Patch11: gcc7-Wno-format-security.patch
9c2d31
9c2d31
Patch1002: gcc7-alt-compat-test.patch
9c2d31
Patch1005: gcc7-rh1118870.patch
9c2d31
Patch1100: gcc7-htm-in-asm.patch
1fb7ed
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
%global nonsharedver 48
1fb7ed
%else
1fb7ed
%global nonsharedver 44
1fb7ed
%endif
1fb7ed
1fb7ed
%global _gnu %{nil}
1fb7ed
%ifarch sparcv9
1fb7ed
%global gcc_target_platform sparc64-%{_vendor}-%{_target_os}%{?_gnu}
1fb7ed
%endif
1fb7ed
%ifarch ppc
1fb7ed
%global gcc_target_platform ppc64-%{_vendor}-%{_target_os}%{?_gnu}
1fb7ed
%endif
1fb7ed
%ifnarch sparcv9 ppc
1fb7ed
%global gcc_target_platform %{_target_platform}
1fb7ed
%endif
1fb7ed
1fb7ed
%description
1fb7ed
This package contains various GCC runtime libraries, such as libatomic,
1fb7ed
or libitm.
1fb7ed
1fb7ed
%package -n libitm
1fb7ed
Summary: The GNU Transactional Memory library
1fb7ed
Group: System Environment/Libraries
1fb7ed
Requires(post): /sbin/install-info
1fb7ed
Requires(preun): /sbin/install-info
1fb7ed
1fb7ed
%description -n libitm
1fb7ed
This package contains the GNU Transactional Memory library
1fb7ed
which is a GCC transactional memory support runtime library.
1fb7ed
1fb7ed
%package -n libatomic
1fb7ed
Summary: The GNU Atomic library
1fb7ed
Group: System Environment/Libraries
1fb7ed
Requires(post): /sbin/install-info
1fb7ed
Requires(preun): /sbin/install-info
1fb7ed
1fb7ed
%description -n libatomic
1fb7ed
This package contains the GNU Atomic library
1fb7ed
which is a GCC support runtime library for atomic operations not supported
1fb7ed
by hardware.
1fb7ed
1fb7ed
%package -n libcilkrts
1fb7ed
Summary: The Cilk+ runtime library
1fb7ed
Group: System Environment/Libraries
1fb7ed
Requires(post): /sbin/install-info
1fb7ed
Requires(preun): /sbin/install-info
1fb7ed
1fb7ed
%description -n libcilkrts
1fb7ed
This package contains the Cilk+ runtime library.
1fb7ed
1fb7ed
%package -n libmpx
1fb7ed
Summary: The Memory Protection Extensions runtime libraries
1fb7ed
Group: System Environment/Libraries
1fb7ed
Requires(post): /sbin/install-info
1fb7ed
Requires(preun): /sbin/install-info
1fb7ed
1fb7ed
%description -n libmpx
1fb7ed
This package contains the Memory Protection Extensions runtime libraries
1fb7ed
which is used for -fcheck-pointer-bounds -mmpx instrumented programs.
1fb7ed
9c2d31
%package -n libgfortran4
9c2d31
Summary: Fortran runtime
9c2d31
Group: System Environment/Libraries
9c2d31
Autoreq: true
9c2d31
%if %{build_libquadmath}
9c2d31
Requires: libquadmath
9c2d31
%endif
9c2d31
%if "%{version}" != "%{gcc_version}"
9c2d31
Provides: libgfortran = %{gcc_provides}
9c2d31
%endif
9c2d31
9c2d31
%description -n libgfortran4
9c2d31
This package contains Fortran shared library which is needed to run
9c2d31
Fortran dynamically linked programs.
9c2d31
1fb7ed
%prep
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
%setup -q -n gcc-%{version}-%{DATE}
1fb7ed
%else
1fb7ed
%setup -q -n gcc-%{version}-%{DATE} -a 1
1fb7ed
%endif
1fb7ed
%patch0 -p0 -b .hack~
9c2d31
%patch1 -p0 -b .ppc32-retaddr~
9c2d31
%patch2 -p0 -b .i386-libgomp~
9c2d31
%patch3 -p0 -b .sparc-config-detection~
9c2d31
%patch4 -p0 -b .libgomp-omp_h-multilib~
9c2d31
%patch5 -p0 -b .libtool-no-rpath~
9c2d31
%patch8 -p0 -b .no-add-needed~
9c2d31
%patch9 -p0 -b .aarch64-async-unw-tables~
9c2d31
%patch10 -p0 -b .foffload-default~
9c2d31
%patch11 -p0 -b .Wno-format-security~
9c2d31
9c2d31
sed -i -e 's/ -Wl,-z,nodlopen//g' gcc/ada/gcc-interface/Makefile.in
9c2d31
1fb7ed
%ifarch %{ix86} x86_64
1fb7ed
%if 0%{?rhel} < 7
1fb7ed
# On i?86/x86_64 there are some incompatibilities in _Decimal* as well as
1fb7ed
# aggregates containing larger vector passing.
1fb7ed
%patch1002 -p0 -b .alt-compat-test~
1fb7ed
%endif
1fb7ed
%endif
1fb7ed
54e61e
%patch1005 -p0 -b .rh1118870~
9c2d31
%patch1100 -p0 -b .gcc6-htm-in-asm~
1fb7ed
1fb7ed
%if 0%{?rhel} == 6
1fb7ed
# Default to -gdwarf-3 rather than -gdwarf-4
1fb7ed
sed -i '/UInteger Var(dwarf_version)/s/Init(4)/Init(3)/' gcc/common.opt
1fb7ed
sed -i 's/\(may be either 2, 3 or 4; the default version is \)4\./\13./' gcc/doc/invoke.texi
1fb7ed
%endif
1fb7ed
1fb7ed
cp -a libstdc++-v3/config/cpu/i{4,3}86/atomicity.h
1fb7ed
cp -a libstdc++-v3/config/cpu/i{4,3}86/opt
1fb7ed
1fb7ed
./contrib/gcc_update --touch
1fb7ed
1fb7ed
LC_ALL=C sed -i -e 's/\xa0/ /' gcc/doc/options.texi
1fb7ed
54e61e
sed -i -e 's/Common Driver Var(flag_report_bug)/& Init(1)/' gcc/common.opt
54e61e
1fb7ed
%ifarch ppc
1fb7ed
if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
1fb7ed
  mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
1fb7ed
  mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/{,64/}baseline_symbols.txt
1fb7ed
  mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/{32/,}baseline_symbols.txt
1fb7ed
  rm -rf libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32
1fb7ed
fi
1fb7ed
%endif
1fb7ed
%build
1fb7ed
1fb7ed
# Undo the broken autoconf change in recent Fedora versions
1fb7ed
export CONFIG_SITE=NONE
1fb7ed
1fb7ed
rm -fr obj-%{gcc_target_platform}
1fb7ed
mkdir obj-%{gcc_target_platform}
1fb7ed
cd obj-%{gcc_target_platform}
1fb7ed
1fb7ed
1fb7ed
%if 0%{?rhel} < 7
1fb7ed
mkdir mpc mpc-install
1fb7ed
cd mpc
1fb7ed
../../mpc-%{mpc_version}/configure --disable-shared \
54e61e
  CFLAGS="${CFLAGS:-%optflags} -fPIC" CXXFLAGS="${CXXFLAGS:-%optflags} -fPIC" \
1fb7ed
  --prefix=`cd ..; pwd`/mpc-install
1fb7ed
make %{?_smp_mflags}
1fb7ed
make install
1fb7ed
cd ..
1fb7ed
%endif
1fb7ed
1fb7ed
CC=gcc
1fb7ed
CXX=g++
1fb7ed
OPT_FLAGS=`echo %{optflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
1fb7ed
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
1fb7ed
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g'`
1fb7ed
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'`
1fb7ed
%ifarch sparc
1fb7ed
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mcpu=ultrasparc/-mtune=ultrasparc/g;s/-mcpu=v[78]//g'`
1fb7ed
%endif
1fb7ed
%ifarch %{ix86}
1fb7ed
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
1fb7ed
%endif
1fb7ed
%ifarch sparc64
1fb7ed
cat > gcc64 <<"EOF"
1fb7ed
#!/bin/sh
1fb7ed
exec /usr/bin/gcc -m64 "$@"
1fb7ed
EOF
1fb7ed
chmod +x gcc64
1fb7ed
CC=`pwd`/gcc64
1fb7ed
cat > g++64 <<"EOF"
1fb7ed
#!/bin/sh
1fb7ed
exec /usr/bin/g++ -m64 "$@"
1fb7ed
EOF
1fb7ed
chmod +x g++64
1fb7ed
CXX=`pwd`/g++64
1fb7ed
%endif
1fb7ed
%ifarch ppc64 ppc64le ppc64p7
1fb7ed
if gcc -m64 -xc -S /dev/null -o - > /dev/null 2>&1; then
1fb7ed
  cat > gcc64 <<"EOF"
1fb7ed
#!/bin/sh
1fb7ed
exec /usr/bin/gcc -m64 "$@"
1fb7ed
EOF
1fb7ed
  chmod +x gcc64
1fb7ed
  CC=`pwd`/gcc64
1fb7ed
  cat > g++64 <<"EOF"
1fb7ed
#!/bin/sh
1fb7ed
exec /usr/bin/g++ -m64 "$@"
1fb7ed
EOF
1fb7ed
  chmod +x g++64
1fb7ed
  CXX=`pwd`/g++64
1fb7ed
fi
1fb7ed
%endif
1fb7ed
OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
1fb7ed
CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \
1fb7ed
	CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g'`" \
1fb7ed
	XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
1fb7ed
	GCJFLAGS="$OPT_FLAGS" \
1fb7ed
	../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
9c2d31
	--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap \
1fb7ed
	--enable-shared --enable-threads=posix --enable-checking=release \
9c2d31
	--enable-multilib --disable-libsanitizer \
1fb7ed
	--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
1fb7ed
	--enable-gnu-unique-object \
1fb7ed
	--enable-linker-build-id \
9c2d31
	--enable-languages=c,c++,lto,fortran \
1fb7ed
	--enable-plugin --with-linker-hash-style=gnu \
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
	--enable-initfini-array \
1fb7ed
%else
1fb7ed
	--disable-initfini-array \
1fb7ed
%endif
1fb7ed
	--disable-libgcj \
1fb7ed
	--without-ppl --without-cloog \
1fb7ed
%if 0%{?rhel} < 7
1fb7ed
	--with-mpc=`pwd`/mpc-install \
1fb7ed
%endif
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
%if %{attr_ifunc}
1fb7ed
        --enable-gnu-indirect-function \
1fb7ed
%endif
1fb7ed
%endif
1fb7ed
%ifarch %{arm}
1fb7ed
	--disable-sjlj-exceptions \
1fb7ed
%endif
1fb7ed
%ifarch ppc ppc64 ppc64le ppc64p7
1fb7ed
	--enable-secureplt \
1fb7ed
%endif
1fb7ed
%ifarch sparc sparcv9 sparc64 ppc ppc64 ppc64le ppc64p7 s390 s390x alpha
1fb7ed
	--with-long-double-128 \
1fb7ed
%endif
1fb7ed
%ifarch sparc
1fb7ed
	--disable-linux-futex \
1fb7ed
%endif
1fb7ed
%ifarch sparc64
1fb7ed
	--with-cpu=ultrasparc \
1fb7ed
%endif
1fb7ed
%ifarch sparc sparcv9
1fb7ed
	--host=%{gcc_target_platform} --build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=v7
1fb7ed
%endif
9c2d31
%ifarch ppc ppc64 ppc64le ppc64p7
1fb7ed
%if 0%{?rhel} >= 7
1fb7ed
	--with-cpu-32=power7 --with-tune-32=power7 --with-cpu-64=power7 --with-tune-64=power7 \
1fb7ed
%else
1fb7ed
	--with-cpu-32=power4 --with-tune-32=power6 --with-cpu-64=power4 --with-tune-64=power6 \
1fb7ed
%endif
1fb7ed
%endif
1fb7ed
%ifarch ppc
1fb7ed
	--build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=default32
1fb7ed
%endif
1fb7ed
%ifarch %{ix86} x86_64
1fb7ed
	--with-tune=generic \
1fb7ed
%endif
1fb7ed
%ifarch %{ix86}
1fb7ed
	--with-arch=i686 \
1fb7ed
%endif
1fb7ed
%ifarch x86_64
1fb7ed
	--with-arch_32=i686 \
1fb7ed
%endif
1fb7ed
%ifarch s390 s390x
1fb7ed
	--with-arch=z9-109 --with-tune=z10 --enable-decimal-float \
1fb7ed
%endif
1fb7ed
%ifnarch sparc sparcv9 ppc
1fb7ed
	--build=%{gcc_target_platform}
1fb7ed
%endif
1fb7ed
1fb7ed
GCJFLAGS="$OPT_FLAGS" make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS"
1fb7ed
1fb7ed
# Copy various doc files here and there
1fb7ed
cd ..
9c2d31
mkdir -p rpm.doc/gfortran rpm.doc/libatomic rpm.doc/libitm rpm.doc/libcilkrts rpm.doc/libmpx
9c2d31
9c2d31
(cd libgfortran; for i in ChangeLog*; do
9c2d31
	cp -p $i ../rpm.doc/gfortran/$i.libgfortran
9c2d31
done)
1fb7ed
1fb7ed
%if %{build_libitm}
1fb7ed
(cd libitm; for i in ChangeLog*; do
1fb7ed
	cp -p $i ../rpm.doc/libitm/$i.libitm
1fb7ed
done)
1fb7ed
%endif
1fb7ed
1fb7ed
%if %{build_libatomic}
1fb7ed
(cd libatomic; for i in ChangeLog*; do
1fb7ed
	cp -p $i ../rpm.doc/libatomic/$i.libatomic
1fb7ed
done)
1fb7ed
%endif
1fb7ed
1fb7ed
%if %{build_libcilkrts}
1fb7ed
(cd libcilkrts; for i in ChangeLog*; do
1fb7ed
	cp -p $i ../rpm.doc/libcilkrts/$i.libcilkrts
1fb7ed
done)
1fb7ed
%endif
1fb7ed
1fb7ed
rm -f rpm.doc/changelogs/gcc/ChangeLog.[1-9]
1fb7ed
find rpm.doc -name \*ChangeLog\* | xargs bzip2 -9
1fb7ed
1fb7ed
%install
1fb7ed
rm -fr %{buildroot}
1fb7ed
1fb7ed
cd obj-%{gcc_target_platform}
1fb7ed
1fb7ed
# Make sure libcilkrts can use system libgcc_s.so.1.
1fb7ed
rm -f gcc/libgcc_s.so
1fb7ed
echo '/* GNU ld script
1fb7ed
   Use the shared library, but some functions are only in
1fb7ed
   the static library, so try that secondarily.  */
1fb7ed
%{oformat}
1fb7ed
GROUP ( /%{_lib}/libgcc_s.so.1 libgcc.a )' > gcc/libgcc_s.so
1fb7ed
1fb7ed
mkdir -p %{buildroot}%{_prefix}/%{_lib}
1fb7ed
mkdir -p %{buildroot}%{_infodir}
1fb7ed
1fb7ed
# Use make install DESTDIR trick to avoid bogus RPATHs.
1fb7ed
%if %{build_libitm}
1fb7ed
cd %{gcc_target_platform}/libitm/
1fb7ed
mkdir temp
1fb7ed
make install DESTDIR=`pwd`/temp
1fb7ed
cp -a temp/usr/%{_lib}/libitm.so.1* %{buildroot}%{_prefix}/%{_lib}/
1fb7ed
cp -a libitm.info %{buildroot}%{_infodir}/
1fb7ed
cd ../..
1fb7ed
%endif
1fb7ed
1fb7ed
%if %{build_libatomic}
1fb7ed
cd %{gcc_target_platform}/libatomic/
1fb7ed
mkdir temp
1fb7ed
make install DESTDIR=`pwd`/temp
1fb7ed
cp -a temp/usr/%{_lib}/libatomic.so.1* %{buildroot}%{_prefix}/%{_lib}/
1fb7ed
cd ../..
1fb7ed
%endif
1fb7ed
1fb7ed
%if %{build_libcilkrts}
1fb7ed
cd %{gcc_target_platform}/libcilkrts/
1fb7ed
mkdir temp
1fb7ed
make install DESTDIR=`pwd`/temp
1fb7ed
cp -a temp/usr/%{_lib}/libcilkrts.so.5* %{buildroot}%{_prefix}/%{_lib}/
1fb7ed
cd ../..
1fb7ed
%endif
1fb7ed
9c2d31
%if %{build_libquadmath}
9c2d31
cd %{gcc_target_platform}/libquadmath/
1fb7ed
mkdir temp
1fb7ed
make install DESTDIR=`pwd`/temp
9c2d31
cp -a temp/usr/%{_lib}/libquadmath.so.0* %{buildroot}%{_prefix}/%{_lib}/
1fb7ed
cd ../..
1fb7ed
%endif
1fb7ed
9c2d31
cd %{gcc_target_platform}/libgfortran/
9c2d31
mkdir temp
9c2d31
%if %{build_libquadmath}
9c2d31
# It needs to find libquadmath.so.
9c2d31
export LIBRARY_PATH=`pwd`/../../%{gcc_target_platform}/libquadmath/temp/usr/%{_lib}
9c2d31
%endif
9c2d31
make install DESTDIR=`pwd`/temp
9c2d31
cp -a temp/usr/%{_lib}/libgfortran.so.4* %{buildroot}%{_prefix}/%{_lib}/
9c2d31
cd ../..
9c2d31
9c2d31
9c2d31
# Remove binaries we will not be including, so that they don't end up in
9c2d31
# gcc-libraries-debuginfo.
9c2d31
%if 0%{?rhel} >= 7
9c2d31
rm -f %{buildroot}%{_prefix}/%{_lib}/libquadmath.so*
9c2d31
%endif
9c2d31
1fb7ed
rm -f gcc/libgcc_s.so
1fb7ed
ln -sf libgcc_s.so.1 gcc/libgcc_s.so
1fb7ed
1fb7ed
%check
1fb7ed
cd obj-%{gcc_target_platform}
1fb7ed
1fb7ed
# run the tests.
9c2d31
%ifnarch ppc64le
54e61e
make %{?_smp_mflags} -k check RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector}'" || :
9c2d31
%else
9c2d31
make %{?_smp_mflags} -k check || :
9c2d31
%endif
1fb7ed
( LC_ALL=C ../contrib/test_summary -t || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' > testresults
1fb7ed
echo ====================TESTING=========================
1fb7ed
cat testresults
1fb7ed
echo ====================TESTING END=====================
1fb7ed
mkdir testlogs-%{_target_platform}-%{version}-%{release}
1fb7ed
for i in `find . -name \*.log | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do
1fb7ed
  ln $i testlogs-%{_target_platform}-%{version}-%{release}/ || :
1fb7ed
done
1fb7ed
tar cf - testlogs-%{_target_platform}-%{version}-%{release} | bzip2 -9c \
1fb7ed
  | uuencode testlogs-%{_target_platform}.tar.bz2 || :
1fb7ed
rm -rf testlogs-%{_target_platform}-%{version}-%{release}
1fb7ed
1fb7ed
%clean
1fb7ed
rm -rf %{buildroot}
1fb7ed
1fb7ed
%post -n libitm
1fb7ed
/sbin/ldconfig
1fb7ed
if [ -f %{_infodir}/libitm.info.gz ]; then
1fb7ed
  /sbin/install-info \
1fb7ed
    --info-dir=%{_infodir} %{_infodir}/libitm.info.gz || :
1fb7ed
fi
1fb7ed
1fb7ed
%post -n libatomic
1fb7ed
/sbin/ldconfig
1fb7ed
if [ -f %{_infodir}/libatomic.info.gz ]; then
1fb7ed
  /sbin/install-info \
1fb7ed
    --info-dir=%{_infodir} %{_infodir}/libatomic.info.gz || :
1fb7ed
fi
1fb7ed
1fb7ed
%post -n libcilkrts
1fb7ed
/sbin/ldconfig
1fb7ed
if [ -f %{_infodir}/libcilkrts.info.gz ]; then
1fb7ed
  /sbin/install-info \
1fb7ed
    --info-dir=%{_infodir} %{_infodir}/libcilkrts.info.gz || :
1fb7ed
fi
1fb7ed
9c2d31
%post -n libgfortran4
9c2d31
/sbin/ldconfig
9c2d31
if [ -f %{_infodir}/libgfortran.info.gz ]; then
9c2d31
  /sbin/install-info \
9c2d31
    --info-dir=%{_infodir} %{_infodir}/libgfortran.info.gz || :
9c2d31
fi
9c2d31
9c2d31
%post -n libmpx -p /sbin/ldconfig
9c2d31
1fb7ed
%preun -n libitm
1fb7ed
if [ $1 = 0 -a -f %{_infodir}/libitm.info.gz ]; then
1fb7ed
  /sbin/install-info --delete \
1fb7ed
    --info-dir=%{_infodir} %{_infodir}/libitm.info.gz || :
1fb7ed
fi
1fb7ed
1fb7ed
%preun -n libatomic
1fb7ed
if [ $1 = 0 -a -f %{_infodir}/libatomic.info.gz ]; then
1fb7ed
  /sbin/install-info --delete \
1fb7ed
    --info-dir=%{_infodir} %{_infodir}/libatomic.info.gz || :
1fb7ed
fi
1fb7ed
9c2d31
%preun -n libgfortran4
9c2d31
if [ $1 = 0 -a -f %{_infodir}/libgfortran.info.gz ]; then
9c2d31
  /sbin/install-info --delete \
9c2d31
    --info-dir=%{_infodir} %{_infodir}/libgfortran.info.gz || :
9c2d31
fi
9c2d31
1fb7ed
%preun -n libcilkrts
1fb7ed
if [ $1 = 0 -a -f %{_infodir}/libcilkrts.info.gz ]; then
1fb7ed
  /sbin/install-info --delete \
1fb7ed
    --info-dir=%{_infodir} %{_infodir}/libcilkrts.info.gz || :
1fb7ed
fi
1fb7ed
1fb7ed
%postun -n libitm -p /sbin/ldconfig
1fb7ed
1fb7ed
%postun -n libatomic -p /sbin/ldconfig
1fb7ed
1fb7ed
%postun -n libcilkrts -p /sbin/ldconfig
1fb7ed
9c2d31
%postun -n libgfortran4 -p /sbin/ldconfig
1fb7ed
1fb7ed
%postun -n libmpx -p /sbin/ldconfig
1fb7ed
1fb7ed
%if %{build_libitm}
1fb7ed
%files -n libitm
1fb7ed
%defattr(-,root,root,-)
1fb7ed
%{_prefix}/%{_lib}/libitm.so.1*
1fb7ed
%{_infodir}/libitm.info*
1fb7ed
1fb7ed
%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libitm/*
1fb7ed
%endif
1fb7ed
1fb7ed
%if %{build_libatomic}
1fb7ed
%files -n libatomic
1fb7ed
%defattr(-,root,root,-)
1fb7ed
%{_prefix}/%{_lib}/libatomic.so.1*
1fb7ed
1fb7ed
%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libatomic/*
1fb7ed
%endif
1fb7ed
1fb7ed
%if %{build_libcilkrts}
1fb7ed
%files -n libcilkrts
1fb7ed
%defattr(-,root,root,-)
1fb7ed
%{_prefix}/%{_lib}/libcilkrts.so.5*
1fb7ed
1fb7ed
%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libcilkrts/*
1fb7ed
%endif
1fb7ed
9c2d31
%files -n libgfortran4
1fb7ed
%defattr(-,root,root,-)
9c2d31
%{_prefix}/%{_lib}/libgfortran.so.4*
1fb7ed
9c2d31
%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/gfortran/*
1fb7ed
1fb7ed
%changelog
bba05e
* Thu Oct 19 2017 Marek Polacek <polacek@redhat.com> 7.2.1-1.1.1
bba05e
- update from gcc-7.2.1-1 (#1477224)
bba05e
9c2d31
* Tue Jun 20 2017 Marek Polacek <polacek@redhat.com> 7.1.1-2.2.1
9c2d31
- don't run make check with -fstack-protector on ppc64le
9c2d31
9c2d31
* Thu Jun 15 2017 Marek Polacek <polacek@redhat.com> 7.1.1-2.1.1
9c2d31
- bump gcc_release (DTS7 gcc-gfortran requires libgfortran4 >= 7.1.1-2)
9c2d31
9c2d31
* Mon Jun 12 2017 Marek Polacek <polacek@redhat.com> 7.1.1-1.2.1
9c2d31
- remove libquadmath.so.* so that it doesn't end up in debuginfo
9c2d31
9c2d31
* Mon Jun  5 2017 Marek Polacek <polacek@redhat.com> 7.1.1-1.1.1
9c2d31
- rename libgfortran2 to libgfortran4
9c2d31
- update from Fedora gcc-7.1.1-2.fc27
9c2d31
 
9c2d31
* Wed May 24 2017 Marek Polacek <polacek@redhat.com> 7.0.1-4.2.1
9c2d31
- also build on ppc64le
9c2d31
9c2d31
* Mon Mar 20 2017 Marek Polacek <polacek@redhat.com> 7.0.1-4.1.1
9c2d31
- also build on aarch64
9c2d31
- drop libitm
9c2d31
- only enable libatomic for aarch64
9c2d31
9c2d31
* Fri Mar 17 2017 Marek Polacek <polacek@redhat.com> 7.0.1-3.1.1
9c2d31
- drop libquadmath and rename libgfortran to libgfortran2
9c2d31
9c2d31
* Wed Mar 15 2017 Marek Polacek <polacek@redhat.com> 7.0.1-2.1.1
9c2d31
- also include the libquadmath subpackage
54e61e
9c2d31
* Tue Mar 14 2017 Marek Polacek <polacek@redhat.com> 7.0.1-1.1.1
9c2d31
- update from Fedora 7.0.1-0.12.fc26 (#1412815)
9c2d31
- add the libgfortran subpackage
54e61e
9c2d31
* Wed Oct 19 2016 Marek Polacek <polacek@redhat.com> 6.2.1-1.1.1
9c2d31
- update from DTS 6.2.1 (#1265255)
54e61e
9c2d31
* Tue Oct 18 2016 Marek Polacek <polacek@redhat.com> 5.3.1-1.1.1
9c2d31
- update from DTS 5.3.1 (#1265255)
9c2d31
- run the whole testsuite (because of Cilk+)
1fb7ed
9c2d31
* Tue Dec 15 2015 Marek Polacek <polacek@redhat.com> 5.2.1-2.1.1
9c2d31
- update from DTS 5.2.1-2 (#1265253)
9c2d31
- drop libmpx (#1275357)
1fb7ed
1fb7ed
* Fri Apr 10 2015 Marek Polacek <polacek@redhat.com> 5.0.0-1.1.1
1fb7ed
- update from Fedora gcc-5.0.0-0.21.fc22
1fb7ed
- add libmpx subpackage on x86
1fb7ed
1fb7ed
* Mon Jun 02 2014 Marek Polacek <polacek@redhat.com> 4.9.0-6.1.1
1fb7ed
- make sure libcilkrts can use system libgcc_s.so.1 (#1101277)
1fb7ed
- update from DTS gcc-4.9.0-6
1fb7ed
1fb7ed
* Fri May 23 2014 Marek Polacek <polacek@redhat.com> 4.9.0-5.2.1
1fb7ed
- prevent bogus RPATHs
1fb7ed
1fb7ed
* Wed May 14 2014 Marek Polacek <polacek@redhat.com> 4.9.0-5.1.1
1fb7ed
- update from DTS gcc-4.9.0-5
1fb7ed
- add libcilkrts
1fb7ed
1fb7ed
* Mon Apr 28 2014 Marek Polacek <polacek@redhat.com> 4.8.2-12.1.1
1fb7ed
- update from DTS gcc-4.8.2-12
1fb7ed
1fb7ed
* Wed Aug 14 2013 Marek Polacek <polacek@redhat.com> 4.8.1-4.2.1
1fb7ed
- always build HTM bits in libitm (#996683, #996682)
1fb7ed
1fb7ed
* Fri Jul 19 2013 Marek Polacek <polacek@redhat.com> 4.8.1-4.1.1
1fb7ed
- update from DTS gcc-4.8.1-4
1fb7ed
1fb7ed
* Wed May 29 2013 Marek Polacek <polacek@redhat.com> 4.8.0-5.1.1
1fb7ed
- update from DTS gcc-4.8.0-5
1fb7ed
- build libitm even for s390{,x}
1fb7ed
1fb7ed
* Thu May 02 2013 Marek Polacek <polacek@redhat.com> 4.8.0-3.1.1
1fb7ed
- new package