1 %define building_testsuite 0
4 # spec file for package gcc49
6 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
8 # All modifications and additions to the file contributed by third parties
9 # remain the property of their copyright owners, unless otherwise agreed
10 # upon. The license for this file, and modifications and additions to the
11 # file, is the same license as for the pristine package itself (unless the
12 # license for the pristine package is not an Open Source License, in which
13 # case the license is the MIT License). An "Open Source License" is a
14 # license that conforms to the Open Source Definition (Version 1.9)
15 # published by the Open Source Initiative.
17 # Please submit bugfixes or comments via http://bugs.opensuse.org/
26 %define quadmath_arch %ix86 x86_64 ia64
27 %define tsan_arch x86_64
28 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm
29 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc
30 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
31 %define lsan_arch x86_64
32 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm
33 %if 0%{?build_libvtv:1}
34 %define vtv_arch x86_64 %ix86
36 %define cilkrts_arch x86_64 %ix86
38 # We don't want to build java
40 %define build_libjava 0
42 # Also go and objc aren't needed right now
48 %define build_fortran !0%{?building_libjava:1}%{?building_libffi:1}
59 # For optional compilers only build C, C++ and Fortran
60 %if 0%{?build_optional_compiler_languages:1}
63 %define build_libjava 0
69 # Shared library SONAME versions
79 %define libgcj_sover %{nil}
80 %define libgcj_bc_sover %{nil}
81 %define libffi_sover %{nil}
82 %define libgomp_sover %{nil}
83 %define libstdcxx_sover %{nil}
84 %define libobjc_sover %{nil}
85 %define libgfortran_sover %{nil}
86 %define libquadmath_sover %{nil}
87 %define libasan_sover %{nil}
88 %define libtsan_sover %{nil}
89 %define libatomic_sover %{nil}
90 %define libitm_sover %{nil}
91 %define libubsan_sover %{nil}
92 %define liblsan_sover %{nil}
93 %define libvtv_sover %{nil}
94 %define libcilkrts_sover %{nil}
95 %define libgo_sover %{nil}
97 # Shared library package suffix
98 # This is used for the "non-standard" set of libraries, the standard
99 # being defined by %product_libs_gcc_ver, the GCC version that should
100 # provide un-suffixed shared library packages following the shared-library
101 # policy. Even suffixed variants should provide the shared-library policy
102 # mandated names and ensure they conflict with each other.
103 # Note that on SONAME changes of any library the %product_libs_gcc_ver
104 # define needs to be either split or the newest GCC version still providing
105 # the old SONAME needs to unconditionally produce an un-suffixed library
106 # if %product_libs_gcc_ver is newer than it. Similar the _oldest_ GCC
107 # version first providing a new SONAME needs to unconditionally produce
108 # an un-suffixed library if %product_libs_gcc_ver is lower that it.
109 %if %{!?product_libs_gcc_ver:49}%{?product_libs_gcc_ver} != 49
112 %define libgcc_s_suffix %{?pne:-gcc49}
113 # libgcj SONAME changes with every GCC version
114 %define libgcj_suffix %nil
115 %define libgcj_bc_suffix %{?pne:-gcc49}
116 %define libffi_suffix %{?pne:-gcc49}
117 %define libgomp_suffix %{?pne:-gcc49}
118 %define libstdcxx_suffix %{?pne:-gcc49}
119 %define libobjc_suffix %{?pne:-gcc49}
120 %define libgfortran_suffix %{?pne:-gcc49}
121 %define libquadmath_suffix %{?pne:-gcc49}
122 %define libasan_suffix %{?pne:-gcc49}
123 %define libtsan_suffix %{?pne:-gcc49}
124 %define libatomic_suffix %{?pne:-gcc49}
125 %define libitm_suffix %{?pne:-gcc49}
128 %define libubsan_suffix %{?pne:-gcc49}
129 %define liblsan_suffix %{?pne:-gcc49}
130 %define libvtv_suffix %{?pne:-gcc49}
131 %define libcilkrts_suffix %{?pne:-gcc49}
132 %define libgo_suffix %{?pne:-gcc49}
134 %define selfconflict() %1
136 Name: gcc49-testresults
137 # With generated files in src we could drop the following
140 BuildRequires: gettext-devel
141 BuildRequires: makeinfo
142 # until here, but at least renaming and patching info files breaks this
143 BuildRequires: gcc-c++
144 BuildRequires: glibc-devel-32bit
145 BuildRequires: mpc-devel
146 BuildRequires: mpfr-devel
148 BuildRequires: zlib-devel
149 %ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm aarch64
150 BuildRequires: cloog-isl-devel
151 BuildRequires: isl-devel
154 %define hostsuffix -4.9
155 BuildRequires: gcc49-ada
157 %if 0%{?building_libjava:1}%{?building_testsuite:1}
158 BuildRequires: fastjar
160 %if 0%{?building_libffi:1}
161 BuildRequires: pkg-config
164 BuildRequires: libunwind-devel
167 BuildRequires: dejagnu
168 BuildRequires: expect
172 %define separate_bi32 0
173 %define separate_bi64 0
175 # Beware, this does _not_ separate libgcj, as for that one multilibing
176 # is inactive for the time being
177 %define separate_bi64 1
179 %ifarch x86_64 s390x ppc64 sparc64
180 %define separate_bi32 1
183 # Define two macros to trigger -32bit or -64bit package variants
184 %define separate_biarch 0
186 %define separate_biarch 1
187 %define separate_biarch_suffix -32bit
190 %define separate_biarch 1
191 %define separate_biarch_suffix -64bit
194 %ifarch x86_64 ia64 s390x alpha ppc64 sparc64 aarch64
195 # 64-bit is primary build target
196 %define build_primary_64bit 1
198 %define build_primary_64bit 0
201 %define biarch_libjava 0
203 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
205 URL: http://gcc.gnu.org/
208 %define gcc_dir_version 4.9
209 %define binsuffix -4.9
211 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
212 Requires: binutils glibc-devel
213 Requires: cpp49 = %{version}-%{release}
214 Requires: libgcc_s%{libgcc_s} >= %{version}-%{release}
215 Requires: libgomp%{libgomp_sover} >= %{version}-%{release}
217 Requires: libasan%{libasan_sover} >= %{version}-%{release}
220 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
223 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
226 Requires: libitm%{libitm_sover} >= %{version}-%{release}
228 %ifarch %cilkrts_arch
229 Requires: libcilkrts%{libcilkrts_sover} >= %{version}-%{release}
232 Requires: liblsan%{liblsan_sover} >= %{version}-%{release}
235 Requires: libubsan%{libubsan_sover} >= %{version}-%{release}
238 Requires: libvtv%{libvtv_sover} >= %{version}-%{release}
240 Requires: gcc49-info gcc49-locale
243 BuildRoot: %{_tmppath}/%{name}-%{version}-build
244 Source: gcc-%{version}.tar.bz2
246 Source2: libffi49-rpmlintrc
247 Source3: gcc49-rpmlintrc
249 Source5: baselibs.conf
250 Source6: libgcj49-rpmlintrc
252 Summary: Testsuite results
253 License: SUSE-Public-Domain
254 Group: Development/Languages
257 Results from running the gcc and target library testsuites.
262 # Define the canonical target and host architecture
263 # %gcc_target_arch is supposed to be the full target triple
264 # %TARGET_ARCH is the canonicalized CPU part
265 # %CONFIGURE_TARGET is the target triple used for --target=
266 %if 0%{?gcc_target_arch:1}
267 %define CONFIGURE_TARGET %{gcc_target_arch}
268 %define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
269 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
270 %define CONFIGURE_TARGET powerpc64-tizen-linux
272 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
273 %define CONFIGURE_TARGET powerpc64-tizen-linux
275 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
276 %define CONFIGURE_TARGET i586-tizen-linux
278 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "aarch64"
279 %define CONFIGURE_TARGET aarch64-tizen-linux
281 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
282 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
284 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
285 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
287 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
288 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
291 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
293 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
295 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
297 %define GCCDIST powerpc64-tizen-linux
300 %define GCCDIST sparc64-tizen-linux
303 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
305 %define GCCDIST %{HOST_ARCH}-tizen-linux
310 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
311 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
314 # Versionspecific directories
315 %define versmainlibdir %{libsubdir}
316 %define versmainlibdirbi32 %{libsubdir}/32
317 %define versmainlibdirbi64 %{libsubdir}/64
319 %define versmainlibdirbi32 %{libsubdir}
320 %define versmainlibdirbi64 %{libsubdir}/64
322 %if %{build_primary_64bit}
323 %define versmainlibdirbi %{versmainlibdirbi32}
325 %define versmainlibdirbi %{versmainlibdirbi64}
328 %define mainlibdir %{_libdir}
329 %define mainlibdirbi32 %{_prefix}/lib
330 %define mainlibdirbi64 %{_prefix}/lib64
331 %if %{build_primary_64bit}
332 %define mainlibdirbi %{mainlibdirbi32}
334 %define mainlibdirbi %{mainlibdirbi64}
338 # Now define a few macros that make it easy to package libs and
339 # related files just to the right package, without caring for the
340 # exact path the files are in.
341 # %mainlib package X from all dirs that belong to the main package
342 # %biarchlib package X from all dirs that belong to the -32/64bit package
343 %define mainlib() %{mainlibdir}/%1\
345 %define biarchlib() %{nil}
347 %if !%{separate_biarch}
348 %define mainlib() %{mainlibdir}/%1\
352 %define biarchlib() %{mainlibdirbi}/%1\
357 %define versmainlib() %{versmainlibdir}/%1\
359 %define versbiarchlib() %{nil}
361 %if !%{separate_biarch}
362 %define versmainlib() %{versmainlibdir}/%1\
363 %{versmainlibdirbi}/%1\
366 %define versbiarchlib() %{versmainlibdirbi}/%1\
374 %setup -q -n gcc-%{version}
376 # We are configuring ppc as ppc64 but with switched multilibs. Adjust
377 # the libstdc++ abi testsuite baseline files accordingly
379 if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
380 mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
381 mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt \
382 libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64/
383 mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt \
384 libstdc++-v3/config/abi/post/powerpc64-linux-gnu/
389 # Avoid rebuilding of generated files
390 contrib/gcc_update --touch
391 # Avoid fucking up testsuite results with Java and indirect dispatch
392 export LD_AS_NEEDED=0
393 # Split version file into version used for directories (X.Y) and
394 # version to report with --version (X.Y.Z).
395 # See also gcc-dir-version.patch.
396 # Also decrement the patchlevel version by one if possible and remove
397 # the 'prerelease' tagging in this case
398 if test `cat gcc/DEV-PHASE` == "prerelease"; then
399 if test `cat gcc/BASE-VER | cut -d '.' -f 3` != "0"; then
402 ( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
404 mv gcc/BASE-VER gcc/FULL-VER
406 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
408 rm -rf obj-%{GCCDIST}
411 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g'
412 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
414 # -mcpu is superceded by -mtune but -mtune is not supported by
415 # our bootstrap compiler. -mcpu gives a warning that stops
416 # the build process, so remove it for now. Also remove all other
417 # -march and -mtune flags. They are superseeded by proper
418 # default compiler settings now.
419 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'`
422 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
423 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
425 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
426 # Kill all -march/tune/cpu because that screws building the target libs
427 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
429 # Replace 2 spaces by one finally
430 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
434 languages=$languages,c++
437 languages=$languages,objc
440 languages=$languages,fortran
443 languages=$languages,obj-c++
446 languages=$languages,java
449 languages=$languages,ada
452 languages=$languages,go
456 if test -z "$J"; then
457 J=$(getconf _NPROCESSORS_CONF)
460 test 1 -gt "$J" && J=1
461 JL=$(($(getconf _NPROCESSORS_CONF)*2))
463 if test "$J" == "0"; then
466 if test "$JL" == "0"; then
469 PARALLEL="-j$J -l$JL"
471 # we don't want some miscompiles in the testsuite, or some fault in
472 # the compiler to kill the machine. Hence we limit the amount of memory
473 # by the physical RAM plus half of swap
474 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
475 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
476 #ulimit -v $(((MEM + SWAP/2)*1024))
478 # In general we want to ship release checking enabled compilers
479 # and run BETA with checking enabled.
480 #ENABLE_CHECKING="--enable-checking=yes"
481 ENABLE_CHECKING="--enable-checking=release"
483 # Work around tail/head -1 changes
484 export _POSIX2_VERSION=199209
487 # Using the host gnatmake like
488 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
489 # GNATMAKE="gnatmake%{hostsuffix}"
490 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
492 mkdir -p host-tools/bin
493 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
494 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
495 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
496 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
497 ln -sf /usr/%{_lib} host-tools/%{_lib}
498 export PATH="`pwd`/host-tools/bin:$PATH"
500 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
502 # --enable-threads=posix \
505 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
506 # temporary workaround for a miscompilation of hash functions in java code
507 GCJ_EXTRA_FLAGS="-marm"
510 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
511 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS $GCJ_EXTRA_FLAGS" \
513 --prefix=%{_prefix} \
514 --infodir=%{_infodir} \
515 --mandir=%{_mandir} \
516 --libdir=%{_libdir} \
517 --libexecdir=%{_libdir} \
518 --enable-languages=$languages \
520 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
523 --disable-bootstrap \
524 %if 0%{!?build_libvtv:1}
528 --with-bugurl="http://bugs.tizen.org/" \
529 --with-pkgversion="Tizen" \
530 %if !%{build_fortran}
531 --disable-libquadmath \
533 %if !%{build_libjava}
536 --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
537 --with-ecj-jar=%{libsubdir}/ecj.jar \
539 %if !%{biarch_libjava}
540 --disable-libjava-multilib \
543 --with-slibdir=/%{_lib} \
545 --enable-__cxa_atexit \
546 --enable-libstdcxx-allocator=new \
547 --disable-libstdcxx-pch \
548 --enable-version-specific-runtime-libs \
549 --enable-linker-build-id \
550 --enable-linux-futex \
551 --program-suffix=%{binsuffix} \
552 %if 0%{!?gcc_target_arch:1}
554 --with-system-libunwind \
556 --without-system-libunwind \
559 %if 0%{?gcc_target_arch:1}
560 --program-prefix=%{gcc_target_arch}- \
561 --target=%{gcc_target_arch} \
564 --with-sysroot=%sysroot \
566 --with-sysroot=%{_prefix}/%{gcc_target_arch} \
568 %if 0%{?build_sysroot:1}
569 --with-build-sysroot=%{build_sysroot} \
572 --with-build-sysroot=%{sysroot} \
574 --with-build-sysroot=%{_prefix}/%{gcc_target_arch} \
577 %if 0%{?canonical_target:1}
578 --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
580 %if "%{TARGET_ARCH}" == "spu"
581 --with-gxx-include-dir=%sysroot/include/c++/%{gcc_dir_version} \
585 %if "%{TARGET_ARCH}" == "armv5tel"
586 --with-arch=armv5te \
589 --with-abi=aapcs-linux \
590 --disable-sjlj-exceptions \
592 %if "%{TARGET_ARCH}" == "armv7l"
593 --with-arch=armv7-a \
594 --with-tune=cortex-a8 \
595 --with-float=softfp \
598 --disable-sjlj-exceptions \
600 %if "%{TARGET_ARCH}" == "armv7hl"
601 --with-arch=armv7-a \
602 --with-tune=cortex-a9 \
604 --with-abi=aapcs-linux \
605 --with-fpu=vfpv3-d16 \
606 --disable-sjlj-exceptions \
608 %if "%{TARGET_ARCH}" == "aarch64"
609 --with-arch=armv8-a \
610 --disable-sjlj-exceptions \
612 %if "%{TARGET_ARCH}" == "powerpc" || "%{TARGET_ARCH}" == "powerpc64"
613 %if "%{TARGET_ARCH}" == "powerpc"
614 --with-cpu=default32 \
616 %if "%{TARGET_ARCH}" == "powerpc64le"
619 --with-cpu-64=power4 \
622 --with-long-double-128 \
623 %if "%{TARGET_ARCH}" == "powerpc64le"
627 %if "%{TARGET_ARCH}" == "sparc64"
628 --with-cpu=ultrasparc \
629 --with-long-double-128 \
631 %if "%{TARGET_ARCH}" == "sparc"
633 --with-long-double-128 \
635 %if "%{TARGET_ARCH}" == "i586"
636 --with-arch-32=i586 \
637 --with-tune=generic \
639 %if "%{TARGET_ARCH}" == "x86_64"
640 --with-arch-32=i586 \
641 --with-tune=generic \
644 %if "%{TARGET_ARCH}" == "s390"
645 --with-tune=zEC12 --with-arch=z196 \
646 --with-long-double-128 \
647 --enable-decimal-float \
649 %if "%{TARGET_ARCH}" == "s390x"
650 --with-tune=zEC12 --with-arch=z196 \
651 --with-long-double-128 \
652 --enable-decimal-float \
654 %if "%{TARGET_ARCH}" == "m68k"
661 %if 0%{?building_libffi:1}
662 make stage1-bubble $PARALLEL
663 make all-target-libffi $PARALLEL
666 # Only run profiled bootstrap on archs where it works and matters
667 %ifarch ppc64le s390x
668 make profiledbootstrap STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
670 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
673 %if 0%{?building_libjava:1}
674 make -C %{GCCDIST}/libstdc++-v3/doc doc-html-doxygen
678 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
679 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
680 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
681 # asan needs a whole shadow address space
682 ulimit -v unlimited || true
683 make -k check $PARALLEL || true
685 ../contrib/test_summary | tee ../testresults/test_summary.txt
690 export NO_BRP_CHECK_BYTECODE_VERSION=true
693 cp `find . -name "*.sum"` ../testresults/
694 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
695 chmod 644 ../testresults/*
700 %defattr(-,root,root)
701 %doc testresults/test_summary.txt
702 %doc testresults/*.sum
703 %doc testresults/*.log