Blame SPECS/compat-sap-c++-9.spec

1b938e
%global scl 1
1b938e
%global scl_prefix compat-sap-
1b938e
%global _root_prefix /opt/rh/SAP
1b938e
%global _root_infodir %{_root_prefix}/%{_infodir}
1b938e
%global _root_mandir %{_root_prefix}/%{_mandir}
1b938e
%{?scl:%global __strip strip}
1b938e
%{?scl:%global __objdump objdump}
1b938e
%global DATE 20190605
1b938e
%global SVNREV 271961
1b938e
%global gcc_version 9.1.1
1b938e
%global gcc_major 9
1b938e
# Note, gcc_release must be integer, if you want to add suffixes to
1b938e
# %%{release}, append them after %%{gcc_release} on Release: line.
1b938e
%global gcc_release 2
1b938e
%global _unpackaged_files_terminate_build 0
1b938e
%undefine _annotated_build
1b938e
%global multilib_64_archs sparc64 ppc64 s390x x86_64
1b938e
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64
1b938e
%global attr_ifunc 1
1b938e
%else
1b938e
%global attr_ifunc 0
1b938e
%endif
1b938e
%ifarch x86_64
1b938e
%global multilib_32_arch i686
1b938e
%endif
1b938e
Summary: C++ compatibility runtime library for SAP applications
1b938e
Name: %{?scl_prefix}c++-9
1b938e
ExclusiveArch: x86_64 ppc64le
1b938e
Version: %{gcc_version}
1b938e
Release: %{gcc_release}.2%{?dist}
1b938e
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
1b938e
# GCC Runtime Exception.
1b938e
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
1b938e
Group: Development/Languages
1b938e
# The source for this package was pulled from upstream's vcs.  Use the
1b938e
# following commands to generate the tarball:
1b938e
# svn export svn://gcc.gnu.org/svn/gcc/branches/redhat/gcc-9-branch@%%{SVNREV} gcc-%%{version}-%%{DATE}
1b938e
# tar cf - gcc-%%{version}-%%{DATE} | xz -9e > gcc-%%{version}-%%{DATE}.tar.xz
1b938e
Source0: gcc-%{version}-%{DATE}.tar.xz
1b938e
URL: http://gcc.gnu.org
1b938e
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1b938e
# Need binutils with -pie support >= 2.14.90.0.4-4
1b938e
# Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4
1b938e
# Need binutils which handle -msecure-plt on ppc >= 2.16.91.0.2-2
1b938e
# Need binutils which support .weakref >= 2.16.91.0.3-1
1b938e
# Need binutils which support --hash-style=gnu >= 2.17.50.0.2-7
1b938e
# Need binutils which support mffgpr and mftgpr >= 2.17.50.0.2-8
1b938e
# Need binutils which support --build-id >= 2.17.50.0.17-3
1b938e
# Need binutils which support %gnu_unique_object >= 2.19.51.0.14
1b938e
# Need binutils which support .cfi_sections >= 2.19.51.0.14-33
1b938e
BuildRequires: binutils >= 2.19.51.0.14-33
1b938e
# While gcc doesn't include statically linked binaries, during testing
1b938e
# -static is used several times.
1b938e
BuildRequires: glibc-static
1b938e
BuildRequires: gcc, gcc-c++
1b938e
BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, texinfo, sharutils, gcc-gfortran
1b938e
BuildRequires: /usr/bin/pod2man
1b938e
# For VTA guality testing
1b938e
BuildRequires: gdb
1b938e
# Make sure pthread.h doesn't contain __thread tokens
1b938e
# Make sure glibc supports stack protector
1b938e
# Make sure glibc supports DT_GNU_HASH
1b938e
BuildRequires: glibc-devel >= 2.4.90-13
1b938e
BuildRequires: elfutils-devel >= 0.147
1b938e
BuildRequires: elfutils-libelf-devel >= 0.147
1b938e
%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha
1b938e
# Make sure glibc supports TFmode long double
1b938e
BuildRequires: glibc >= 2.3.90-35
1b938e
%endif
1b938e
%ifarch %{multilib_64_archs} sparcv9 ppc
1b938e
# Ensure glibc{,-devel} is installed for both multilib arches
1b938e
BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so
1b938e
%endif
1b938e
%ifarch ia64
1b938e
BuildRequires: libunwind >= 0.98
1b938e
%endif
1b938e
# Need .eh_frame ld optimizations
1b938e
# Need proper visibility support
1b938e
# Need -pie support
1b938e
# Need --as-needed/--no-as-needed support
1b938e
# On ppc64, need omit dot symbols support and --non-overlapping-opd
1b938e
# Need binutils that owns /usr/bin/c++filt
1b938e
# Need binutils that support .weakref
1b938e
# Need binutils that supports --hash-style=gnu
1b938e
# Need binutils that support mffgpr/mftgpr
1b938e
# Need binutils which support --build-id >= 2.17.50.0.17-3
1b938e
# Need binutils which support %%gnu_unique_object >= 2.19.51.0.14
1b938e
# Need binutils which support .cfi_sections >= 2.19.51.0.14-33
1b938e
# Don't require this for compat-sap-c++ (#1491573).
1b938e
#Requires: binutils >= 2.19.51.0.14-33
1b938e
# Make sure gdb will understand DW_FORM_strp
1b938e
Conflicts: gdb < 5.1-2
1b938e
# Don't require this for compat-sap-c++ (#1491573).
1b938e
#Requires: glibc-devel >= 2.2.90-12
1b938e
%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha
1b938e
# Make sure glibc supports TFmode long double
1b938e
Requires: glibc >= 2.3.90-35
1b938e
%endif
1b938e
Requires: libgcc >= 4.1.2-43
1b938e
# Keep this for now.
1b938e
Requires: libgomp >= 4.4.4-13
1b938e
BuildRequires: gmp-devel >= 4.1.2-8
1b938e
BuildRequires: mpfr-devel >= 2.2.1
1b938e
%if 0%{?rhel} >= 7
1b938e
BuildRequires: libmpc-devel >= 0.8.1
1b938e
%endif
1b938e
AutoReq: true
1b938e
AutoProv: false
1b938e
# Don't provide this for compat-sap-c++ (#1491573).
1b938e
#%ifarch sparc64 ppc64 ppc64le s390x x86_64 ia64
1b938e
#Provides: liblto_plugin.so.0()(64bit)
1b938e
#%else
1b938e
#Provides: liblto_plugin.so.0
1b938e
#%endif
1b938e
%global oformat %{nil}
1b938e
%global oformat2 %{nil}
1b938e
%ifarch %{ix86}
1b938e
%global oformat OUTPUT_FORMAT(elf32-i386)
1b938e
%endif
1b938e
%ifarch x86_64
1b938e
%global oformat OUTPUT_FORMAT(elf64-x86-64)
1b938e
%global oformat2 OUTPUT_FORMAT(elf32-i386)
1b938e
%endif
1b938e
%ifarch ppc
1b938e
%global oformat OUTPUT_FORMAT(elf32-powerpc)
1b938e
%global oformat2 OUTPUT_FORMAT(elf64-powerpc)
1b938e
%endif
1b938e
%ifarch ppc64
1b938e
%global oformat OUTPUT_FORMAT(elf64-powerpc)
1b938e
%global oformat2 OUTPUT_FORMAT(elf32-powerpc)
1b938e
%endif
1b938e
%ifarch s390
1b938e
%global oformat OUTPUT_FORMAT(elf32-s390)
1b938e
%endif
1b938e
%ifarch s390x
1b938e
%global oformat OUTPUT_FORMAT(elf64-s390)
1b938e
%global oformat2 OUTPUT_FORMAT(elf32-s390)
1b938e
%endif
1b938e
%ifarch ia64
1b938e
%global oformat OUTPUT_FORMAT(elf64-ia64-little)
1b938e
%endif
1b938e
%ifarch ppc64le
1b938e
%global oformat OUTPUT_FORMAT(elf64-powerpcle)
1b938e
%endif
1b938e
%ifarch aarch64
1b938e
%global oformat OUTPUT_FORMAT(elf64-littleaarch64)
1b938e
%endif
1b938e
1b938e
Patch0: gcc9-hack.patch
1b938e
Patch1: gcc9-i386-libgomp.patch
1b938e
Patch2: gcc9-sparc-config-detection.patch
1b938e
Patch3: gcc9-libgomp-omp_h-multilib.patch
1b938e
Patch4: gcc9-libtool-no-rpath.patch
1b938e
Patch7: gcc9-no-add-needed.patch
1b938e
Patch8: gcc9-foffload-default.patch
1b938e
Patch9: gcc9-Wno-format-security.patch
1b938e
Patch10: gcc9-rh1574936.patch
1b938e
Patch11: gcc9-d-shared-libphobos.patch
1b938e
1b938e
%if 0%{?rhel} >= 7
1b938e
%global nonsharedver 48
1b938e
%else
1b938e
%global nonsharedver 44
1b938e
%endif
1b938e
1b938e
%if 0%{?scl:1}
1b938e
%global _gnu %{nil}
1b938e
%else
1b938e
%global _gnu 7E
1b938e
%endif
1b938e
%ifarch sparcv9
1b938e
%global gcc_target_platform sparc64-%{_vendor}-%{_target_os}%{?_gnu}
1b938e
%endif
1b938e
%ifarch ppc
1b938e
%global gcc_target_platform ppc64-%{_vendor}-%{_target_os}%{?_gnu}
1b938e
%endif
1b938e
%ifnarch sparcv9 ppc
1b938e
%global gcc_target_platform %{_target_platform}
1b938e
%endif
1b938e
1b938e
%description
1b938e
This package provides runtime compatibility libraries for use by SAP
1b938e
application binaries only.
1b938e
1b938e
%prep
1b938e
%setup -q -n gcc-%{version}-%{DATE}
1b938e
%patch0 -p0 -b .hack~
1b938e
%patch1 -p0 -b .i386-libgomp~
1b938e
%patch2 -p0 -b .sparc-config-detection~
1b938e
%patch3 -p0 -b .libgomp-omp_h-multilib~
1b938e
%patch4 -p0 -b .libtool-no-rpath~
1b938e
%patch7 -p0 -b .no-add-needed~
1b938e
%patch8 -p0 -b .foffload-default~
1b938e
%patch9 -p0 -b .Wno-format-security~
1b938e
%if 0%{?fedora} >= 29 || 0%{?rhel} > 7
1b938e
%patch10 -p0 -b .rh1574936~
1b938e
%endif
1b938e
%patch11 -p0 -b .d-shared-libphobos~
1b938e
1b938e
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
1b938e
1b938e
%if 0%{?rhel} == 6
1b938e
# Default to -gdwarf-3 rather than -gdwarf-4
1b938e
sed -i '/UInteger Var(dwarf_version)/s/Init(4)/Init(3)/' gcc/common.opt
1b938e
sed -i 's/\(may be either 2, 3 or 4; the default version is \)4\./\13./' gcc/doc/invoke.texi
1b938e
%endif
1b938e
1b938e
cp -a libstdc++-v3/config/cpu/i{4,3}86/atomicity.h
1b938e
cp -a libstdc++-v3/config/cpu/i{4,3}86/opt
1b938e
1b938e
./contrib/gcc_update --touch
1b938e
1b938e
LC_ALL=C sed -i -e 's/\xa0/ /' gcc/doc/options.texi
1b938e
1b938e
sed -i -e 's/Common Driver Var(flag_report_bug)/& Init(1)/' gcc/common.opt
1b938e
1b938e
%ifarch ppc
1b938e
if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
1b938e
  mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
1b938e
  mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/{,64/}baseline_symbols.txt
1b938e
  mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/{32/,}baseline_symbols.txt
1b938e
  rm -rf libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32
1b938e
fi
1b938e
%endif
1b938e
%ifarch sparc
1b938e
if [ -d libstdc++-v3/config/abi/post/sparc64-linux-gnu ]; then
1b938e
  mkdir -p libstdc++-v3/config/abi/post/sparc64-linux-gnu/64
1b938e
  mv libstdc++-v3/config/abi/post/sparc64-linux-gnu/{,64/}baseline_symbols.txt
1b938e
  mv libstdc++-v3/config/abi/post/sparc64-linux-gnu/{32/,}baseline_symbols.txt
1b938e
  rm -rf libstdc++-v3/config/abi/post/sparc64-linux-gnu/32
1b938e
fi
1b938e
%endif
1b938e
1b938e
%build
1b938e
1b938e
# Undo the broken autoconf change in recent Fedora versions
1b938e
export CONFIG_SITE=NONE
1b938e
1b938e
rm -fr obj-%{gcc_target_platform}
1b938e
mkdir obj-%{gcc_target_platform}
1b938e
cd obj-%{gcc_target_platform}
1b938e
1b938e
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
1b938e
1b938e
CC=gcc
1b938e
CXX=g++
1b938e
OPT_FLAGS=`echo %{optflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
1b938e
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
1b938e
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g'`
1b938e
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'`
1b938e
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Werror=format-security/-Wformat-security/g'`
1b938e
%ifarch sparc
1b938e
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mcpu=ultrasparc/-mtune=ultrasparc/g;s/-mcpu=v[78]//g'`
1b938e
%endif
1b938e
%ifarch %{ix86}
1b938e
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
1b938e
%endif
1b938e
OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
1b938e
CONFIGURE_OPTS="\
1b938e
	--prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
1b938e
	--with-bugurl=http://bugzilla.redhat.com/bugzilla \
1b938e
	--enable-shared --enable-threads=posix --enable-checking=release \
1b938e
%ifarch ppc64le
1b938e
	--enable-targets=powerpcle-linux --disable-multilib \
1b938e
%else
1b938e
	--enable-multilib \
1b938e
%endif
1b938e
	--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
1b938e
	--enable-gnu-unique-object \
1b938e
	--enable-linker-build-id --with-gcc-major-version-only \
1b938e
	--enable-plugin --with-linker-hash-style=gnu \
1b938e
	--enable-initfini-array \
1b938e
	--disable-libquadmath \
1b938e
	--disable-libsanitizer \
1b938e
	--disable-libvtv \
1b938e
	--disable-libgomp \
1b938e
	--disable-libitm \
1b938e
	--disable-libssp \
1b938e
	--disable-libatomic \
1b938e
	--disable-libcilkrts \
1b938e
	--without-isl \
1b938e
	--disable-libmpx \
1b938e
%if 0%{?rhel} >= 7
1b938e
%if %{attr_ifunc}
1b938e
	--enable-gnu-indirect-function \
1b938e
%endif
1b938e
%endif
1b938e
%ifarch ppc ppc64 ppc64le ppc64p7
1b938e
	--enable-secureplt \
1b938e
%endif
1b938e
%ifarch ppc ppc64 ppc64p7
1b938e
%if 0%{?rhel} >= 7
1b938e
	--with-cpu-32=power7 --with-tune-32=power7 --with-cpu-64=power7 --with-tune-64=power7 \
1b938e
%else
1b938e
	--with-cpu-32=power4 --with-tune-32=power6 --with-cpu-64=power4 --with-tune-64=power6 \
1b938e
%endif
1b938e
%endif
1b938e
%ifarch ppc64le
1b938e
	--with-cpu-32=power8 --with-tune-32=power8 --with-cpu-64=power8 --with-tune-64=power8 \
1b938e
%endif
1b938e
%ifarch ppc
1b938e
	--build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=default32
1b938e
%endif
1b938e
%ifarch %{ix86} x86_64
1b938e
	--with-tune=generic \
1b938e
%endif
1b938e
%ifarch %{ix86}
1b938e
	--with-arch=i686 \
1b938e
%endif
1b938e
%ifarch x86_64
1b938e
	--with-arch_32=i686 \
1b938e
%endif
1b938e
	--build=%{gcc_target_platform} \
1b938e
	"
1b938e
1b938e
CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \
1b938e
	CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g'`" \
1b938e
	XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
1b938e
	../configure --enable-bootstrap \
1b938e
	--enable-languages=c,c++,lto \
1b938e
	$CONFIGURE_OPTS
1b938e
1b938e
1b938e
make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS"
1b938e
1b938e
%install
1b938e
rm -fr %{buildroot}
1b938e
1b938e
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
1b938e
mkdir -p %{buildroot}%{_root_prefix}/%{_lib}
1b938e
cd obj-%{gcc_target_platform}
1b938e
./gcc/xgcc -v 2> %{buildroot}%{_root_prefix}/%{_lib}/README9
1b938e
1b938e
cp %{gcc_target_platform}/libstdc++-v3/src/.libs/libstdc++.so.6.0.* %{buildroot}%{_root_prefix}/%{_lib}/compat-sap-c++-%{gcc_version}.so
1b938e
cd %{buildroot}%{_root_prefix}/%{_lib}/
1b938e
ln -sf compat-sap-c++-%{gcc_version}.so %{buildroot}%{_root_prefix}/%{_lib}/compat-sap-c++-9.so
1b938e
1b938e
%check
1b938e
cd obj-%{gcc_target_platform}
1b938e
1b938e
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
1b938e
1b938e
# run the tests.
1b938e
make %{?_smp_mflags} -k check RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector}'" || :
1b938e
( LC_ALL=C ../contrib/test_summary -t || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' > testresults
1b938e
rm -rf gcc/testsuite.prev
1b938e
mv gcc/testsuite{,.prev}
1b938e
rm -f gcc/site.exp
1b938e
make %{?_smp_mflags} -C gcc -k check-gcc check-g++ ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector}' compat.exp struct-layout-1.exp" || :
1b938e
mv gcc/testsuite/gcc/gcc.sum{,.sent}
1b938e
mv gcc/testsuite/g++/g++.sum{,.sent}
1b938e
( LC_ALL=C ../contrib/test_summary -o -t || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' > testresults2
1b938e
rm -rf gcc/testsuite.compat
1b938e
mv gcc/testsuite{,.compat}
1b938e
mv gcc/testsuite{.prev,}
1b938e
echo ====================TESTING=========================
1b938e
cat testresults
1b938e
echo ===`gcc --version | head -1` compatibility tests====
1b938e
cat testresults2
1b938e
echo ====================TESTING END=====================
1b938e
mkdir testlogs-%{_target_platform}-%{version}-%{release}
1b938e
for i in `find . -name \*.log | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do
1b938e
  ln $i testlogs-%{_target_platform}-%{version}-%{release}/ || :
1b938e
done
1b938e
for i in `find gcc/testsuite.compat -name \*.log | grep -v 'config.log\|acats.*/tests/'`; do
1b938e
  ln $i testlogs-%{_target_platform}-%{version}-%{release}/`basename $i`.compat || :
1b938e
done
1b938e
tar cf - testlogs-%{_target_platform}-%{version}-%{release} | bzip2 -9c \
1b938e
  | uuencode testlogs-%{_target_platform}.tar.bz2 || :
1b938e
rm -rf testlogs-%{_target_platform}-%{version}-%{release}
1b938e
1b938e
%clean
1b938e
rm -rf %{buildroot}
1b938e
1b938e
%files
1b938e
%defattr(-,root,root,-)
1b938e
%dir %{_root_prefix}
1b938e
%dir %{_root_prefix}/%{_lib}
1b938e
%{_root_prefix}/%{_lib}/compat-sap-c++-%{gcc_version}.so
1b938e
%{_root_prefix}/%{_lib}/compat-sap-c++-9.so
1b938e
%{_root_prefix}/%{_lib}/README9
1b938e
1b938e
%changelog
1b938e
* Fri Jun  7 2019 Marek Polacek <polacek@redhat.com> 9.1.2-1.2
1b938e
- bump for rebuild
1b938e
1b938e
* Thu Jun  6 2019 Marek Polacek <polacek@redhat.com> 9.1.2-1.1
1b938e
- update from Fedora
1b938e
1b938e
* Fri May  3 2019 Marek Polacek <polacek@redhat.com> 9.1.1-1.1
1b938e
- new package