1 %define building_testsuite 1
5 # Ada currently fails to build on a few platforms, enable it only
7 # Note that AdaCore only supports %ix86, x86_64 and ia64
9 %define build_ada !0%{?building_libjava:1}%{?building_libffi:1}
14 %define quadmath_arch %ix86 x86_64 ia64
16 # We don't want to build java
19 %define build_libjava 0
22 %define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
26 %define build_fortran 1
28 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
29 %define build_with_mudflap 0
40 # For optional compilers only build C, C++ and Fortran
41 ##%if 0%{?build_optional_compiler:1}%{?build_optional_compiler_languages:1}
42 %if 0%{!?building_libffi:1}
45 %define build_libjava 0
51 Name: gcc47-testresults
54 BuildRequires: gettext-tools
55 BuildRequires: makeinfo
56 BuildRequires: glibc-devel-32bit
57 BuildRequires: mpc-devel
58 BuildRequires: mpfr-devel
60 BuildRequires: texinfo
61 BuildRequires: zlib-devel
62 %ifarch %ix86 x86_64 %arm
63 BuildRequires: cloog-devel
64 BuildRequires: ppl-devel
67 %define hostsuffix -4.7
68 BuildRequires: gcc47-ada
70 %if 0%{?building_libjava:1}%{?building_testsuite:1}
71 BuildRequires: fastjar
74 %if 0%{?building_libffi:1}
75 BuildRequires: pkg-config
78 BuildRequires: libunwind-devel
81 BuildRequires: dejagnu
86 # Define version number of libgcc_s
93 # We support building the nof libraries, but don't want this in the
100 %define separate_bi32 0
101 %define separate_bi64 0
103 %define separate_bi32 1
106 # Define two macros to trigger -32bit or -64bit package variants
107 %define separate_biarch 0
109 %define separate_biarch 1
110 %define separate_biarch_suffix -32bit
113 %define separate_biarch 1
114 %define separate_biarch_suffix -64bit
118 # 64-bit is primary build target
119 %define build_primary_64bit 1
121 %define build_primary_64bit 0
124 %define biarch_libjava 0
127 %define biarch_targets x86_64
129 URL: http://gcc.gnu.org/
132 %define gcc_version %(echo %version | sed 's/_.*//')
133 %define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
134 %define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed 's/_/-/')
135 %define binsuffix -4.7
138 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
139 Requires: binutils glibc-devel
140 Requires: cpp47 = %{version}-%{release}
141 %if 0%{!?build_optional_compiler:1}
142 Requires: libgcc%{libgcc_s} >= %{version}-%{release}
143 Requires: libgomp1 >= %{version}-%{release}
144 %if %{build_with_mudflap}
145 Requires: libmudflap0 >= %{version}-%{release}
146 Requires: libmudflapth0 >= %{version}-%{release}
149 Requires: libgcc47 = %{version}-%{release}
150 Requires: libgomp47 = %{version}-%{release}
155 BuildRoot: %{_tmppath}/%{name}-%{version}-build
156 Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
158 Source2: libgcj47-rpmlintrc
159 Source3: gcc47-rpmlintrc
161 Source5: README.First-for.SuSE.packagers
162 Source6: baselibs.conf
164 Summary: Testsuite results
165 License: SUSE-Public-Domain
166 Group: Development/Languages/C and C++
169 Results from running the gcc and target library testsuites.
174 # Define the canonical target and host architecture
175 # %gcc_target_arch is supposed to be the full target triple
176 # %TARGET_ARCH is the canonicalized CPU part
177 # %CONFIGURE_TARGET is the target triple used for --target=
178 %if 0%{?gcc_target_arch:1}
179 %define CONFIGURE_TARGET %{gcc_target_arch}
180 %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/;")
181 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
182 %define CONFIGURE_TARGET i586-tizen-linux
184 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
185 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
187 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
188 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
190 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7el"
191 %define CONFIGURE_TARGET armv7el-tizen-linux-gnueabi
193 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5el"
194 %define CONFIGURE_TARGET armv5el-tizen-linux-gnueabi
197 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
199 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
201 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
204 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
206 %define GCCDIST %{HOST_ARCH}-tizen-linux
209 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
210 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
214 # Versionspecific directories
215 %define versmainlibdir %{libsubdir}
216 %define versmainlibdirbi32 %{libsubdir}/32
217 %define versmainlibdirbi64 %{libsubdir}/64
218 %if %{build_primary_64bit}
219 %define versmainlibdirbi %{versmainlibdirbi32}
221 %define versmainlibdirbi %{versmainlibdirbi64}
224 %if 0%{?build_optional_compiler:1}
225 %define mainlibdir %{versmainlibdir}
226 %define mainlibdirbi32 %{versmainlibdirbi32}
227 %define mainlibdirbi64 %{versmainlibdirbi64}
228 %define noflibdir %{versnoflibdir}
229 %define mainlibdirbi %{versmainlibdirbi}
231 %define mainlibdir %{_libdir}
232 %define mainlibdirbi32 %{_prefix}/lib
233 %define mainlibdirbi64 %{_prefix}/lib64
234 %define noflibdir %{_prefix}/lib/nof
235 %if %{build_primary_64bit}
236 %define mainlibdirbi %{mainlibdirbi32}
238 %define mainlibdirbi %{mainlibdirbi64}
243 # Now define a few macros that make it easy to package libs and
244 # related files just to the right package, without caring for the
245 # exact path the files are in.
246 # %mainlib package X from all dirs that belong to the main package
247 # %biarchlib package X from all dirs that belong to the -32/64bit package
248 # by default, nof libs go where the 32bit libs go.
250 %define mainlib() %{mainlibdir}/%1\
254 %define mainlib() %{mainlibdir}/%1\
257 %define biarchlib() %{nil}
259 %if !%{separate_biarch}
261 %define mainlib() %{mainlibdir}/%1\
266 %define mainlib() %{mainlibdir}/%1\
272 %define biarchlib() %{mainlibdirbi}/%1\
275 %define mainlib() %{mainlibdir}/%1\
278 %define biarchlib() %{mainlibdirbi}/%1\
285 %define versmainlib() %{versmainlibdir}/%1\
289 %define versmainlib() %{versmainlibdir}/%1\
292 %define versbiarchlib() %{nil}
294 %if !%{separate_biarch}
296 %define versmainlib() %{versmainlibdir}/%1\
297 %{versmainlibdirbi}/%1\
301 %define versmainlib() %{versmainlibdir}/%1\
302 %{versmainlibdirbi}/%1\
307 %define versbiarchlib() %{versmainlibdirbi}/%1\
310 %define versmainlib() %{versmainlibdir}/%1\
313 %define versbiarchlib() %{versmainlibdirbi}/%1\
323 %setup -q -n gcc-%{gcc_version}%{snapshot_date}
326 # Avoid rebuilding of generated files
327 contrib/gcc_update --touch
328 # Avoid fucking up testsuite results with Java and indirect dispatch
329 export LD_AS_NEEDED=0
330 # Split version file into version used for directories (X.Y) and
331 # version to report with --version (X.Y.Z).
332 # See also gcc-dir-version.patch.
333 # Also decrement the patchlevel version by one
334 if test `cat gcc/DEV-PHASE` == "prerelease"; then
335 ( 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
337 mv gcc/BASE-VER gcc/FULL-VER
339 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
341 rm -rf obj-%{GCCDIST}
344 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
345 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'`
347 # -mcpu is superceded by -mtune but -mtune is not supported by
348 # our bootstrap compiler. -mcpu gives a warning that stops
349 # the build process, so remove it for now. Also remove all other
350 # -march and -mtune flags. They are superseeded by proper
351 # default compiler settings now.
352 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'`
354 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
355 # Kill all -march/tune/cpu because that screws building the target libs
356 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
358 # Replace 2 spaces by one finally
359 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
363 languages=$languages,c++
366 languages=$languages,objc
369 languages=$languages,fortran
372 languages=$languages,obj-c++
375 languages=$languages,java
378 languages=$languages,ada
382 if test -z "$J"; then
383 J=$(getconf _NPROCESSORS_CONF)
386 test 1 -gt "$J" && J=1
387 JL=$(($(getconf _NPROCESSORS_CONF)*2))
389 if test "$J" == "0"; then
392 if test "$JL" == "0"; then
395 PARALLEL="-j$J -l$JL"
397 # we don't want some miscompiles in the testsuite, or some fault in
398 # the compiler to kill the machine. Hence we limit the amount of memory
399 # by the physical RAM plus half of swap
400 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
401 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
402 #ulimit -v $(((MEM + SWAP/2)*1024))
404 # In general we want to ship release checking enabled compilers
405 # and run BETA with checking enabled.
406 #ENABLE_CHECKING="--enable-checking=yes"
407 ENABLE_CHECKING="--enable-checking=release"
409 # Work around tail/head -1 changes
410 export _POSIX2_VERSION=199209
412 # configure tries to parse include/features.h to detect
413 # if glibc supports SSP. When cross compiling we would need
414 # to install a cross glibc, which we don't, or make the whole
415 # thing point to the native glibc, which is in /, hence the
419 # Using the host gnatmake like
420 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
421 # GNATMAKE="gnatmake%{hostsuffix}"
422 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
424 mkdir -p host-tools/bin
425 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
426 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
427 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
428 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
429 ln -sf /usr/%{_lib} host-tools/%{_lib}
430 export PATH="`pwd`/host-tools/bin:$PATH"
432 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
434 # --enable-threads=posix \
437 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
438 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
440 --prefix=%{_prefix} \
441 --infodir=%{_infodir} \
442 --mandir=%{_mandir} \
443 --libdir=%{_libdir} \
444 --libexecdir=%{_libdir} \
445 --enable-languages=$languages \
447 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
452 --disable-bootstrap \
455 --with-bugurl="http://bugs.tizen.org/" \
456 --with-pkgversion="Tizen Linux" \
457 %if !%{build_libjava}
460 --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
461 --with-ecj-jar=%{libsubdir}/ecj.jar \
463 %if !%{biarch_libjava}
464 --disable-libjava-multilib \
467 %if !%{build_with_mudflap}
468 --disable-libmudflap \
470 --with-slibdir=/%{_lib} \
472 --enable-__cxa_atexit \
473 --enable-libstdcxx-allocator=new \
474 --disable-libstdcxx-pch \
475 --enable-version-specific-runtime-libs \
476 --enable-linker-build-id \
477 %if 0%{?gcc_target_arch:1}
478 %if 0%{?gcc_icecream:1}
479 --with-build-sysroot=/ \
480 --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
481 --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
482 --enable-linux-futex \
484 %if 0%{?canonical_target:1}
485 --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
487 %if 0%{?build_static:1}
490 %if "%{TARGET_ARCH}" == "spu"
491 --with-sysroot=/usr/spu \
492 --with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
496 --target=%{CONFIGURE_TARGET} \
498 --program-suffix=%{binsuffix} \
499 --enable-linux-futex \
501 --with-system-libunwind \
503 --without-system-libunwind \
506 %if "%{TARGET_ARCH}" == "armv5tel"
507 --with-arch=armv5te \
510 --with-abi=aapcs-linux \
511 --disable-sjlj-exceptions \
513 %if "%{TARGET_ARCH}" == "armv7el"
514 --with-arch=armv7-a \
515 --with-tune=cortex-a9 \
519 --disable-sjlj-exceptions \
521 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
522 --with-arch=armv7-a \
523 --with-tune=cortex-a9 \
525 --with-abi=aapcs-linux \
526 --with-fpu=vfpv3-d16 \
527 --disable-sjlj-exceptions \
529 %if "%{TARGET_ARCH}" == "i586"
530 --with-arch-32=i586 \
531 --with-tune=generic \
533 %if "%{TARGET_ARCH}" == "x86_64"
534 --with-arch-32=i586 \
535 --with-tune=generic \
541 %if 0%{?building_libffi:1}
542 make stage1-bubble $PARALLEL
543 make all-target-libffi $PARALLEL
545 # Only run profiled bootstrap on archs where it works
546 #%ifarch %ix86 x86_64 ppc ppc64 ia64
547 #make profiledbootstrap-lean STAGE1_CFLAGS="-O -g" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
554 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
555 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
561 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
562 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
563 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
564 make -k check $PARALLEL || true
566 ../contrib/test_summary | tee ../testresults/test_summary.txt
571 export NO_BRP_CHECK_BYTECODE_VERSION=true
574 cp `find . -name "*.sum"` ../testresults/
575 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
576 chmod 644 ../testresults/*
581 %defattr(-,root,root)
582 %doc testresults/test_summary.txt
583 %doc testresults/*.sum
584 %doc testresults/*.log