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
16 # We don't want to build java
18 %define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
21 %define build_fortran 1
23 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
24 %define build_with_mudflap 0
35 # For optional compilers only build C, C++ and Fortran
36 ##%if 0%{?build_optional_compiler:1}%{?build_optional_compiler_languages:1}
37 %if 0%{!?building_libffi:1}
40 %define build_libjava 0
46 Name: gcc47-testresults
49 BuildRequires: gettext-tools
50 BuildRequires: makeinfo
51 BuildRequires: glibc-devel-32bit
52 BuildRequires: mpc-devel
53 BuildRequires: mpfr-devel
55 BuildRequires: texinfo
56 BuildRequires: zlib-devel
57 %ifarch %ix86 x86_64 %arm
58 BuildRequires: cloog-devel
59 BuildRequires: ppl-devel
62 %define hostsuffix -4.7
63 BuildRequires: gcc47-ada
65 %if 0%{?building_libjava:1}%{?building_testsuite:1}
66 BuildRequires: fastjar
69 %if 0%{?building_libffi:1}
70 BuildRequires: pkg-config
73 BuildRequires: dejagnu
78 # Define version number of libgcc_s
82 %define separate_bi32 0
83 %define separate_bi64 0
85 %define separate_bi32 1
88 # Define two macros to trigger -32bit or -64bit package variants
89 %define separate_biarch 0
91 %define separate_biarch 1
92 %define separate_biarch_suffix -32bit
95 %define separate_biarch 1
96 %define separate_biarch_suffix -64bit
100 # 64-bit is primary build target
101 %define build_primary_64bit 1
103 %define build_primary_64bit 0
106 %define biarch_libjava 0
109 %define biarch_targets x86_64
111 URL: http://gcc.gnu.org/
114 %define gcc_version %(echo %version | sed 's/_.*//')
115 %define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
116 %define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed 's/_/-/')
117 %define binsuffix -4.7
120 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
121 Requires: binutils glibc-devel
122 Requires: cpp47 = %{version}-%{release}
123 %if 0%{!?build_optional_compiler:1}
124 Requires: libgcc%{libgcc_s} >= %{version}-%{release}
125 Requires: libgomp1 >= %{version}-%{release}
126 %if %{build_with_mudflap}
127 Requires: libmudflap0 >= %{version}-%{release}
128 Requires: libmudflapth0 >= %{version}-%{release}
131 Requires: libgcc47 = %{version}-%{release}
132 Requires: libgomp47 = %{version}-%{release}
137 BuildRoot: %{_tmppath}/%{name}-%{version}-build
138 #Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
139 Source: gcc-%{version}.tar.bz2
142 Source2: libgcj47-rpmlintrc
143 Source3: gcc47-rpmlintrc
145 Source6: baselibs.conf
146 # Patches auto-generated by git-buildpackage:
147 Patch0: 0001-dir-version.patch
148 Patch1: 0002-textdomain.patch
149 Patch2: 0003-rename-info-files.patch
150 Patch3: 0004-ARM-linker.patch
152 Summary: Testsuite results
153 License: Public-Domain
154 Group: Development/Toolchain
157 Results from running the gcc and target library testsuites.
162 # Define the canonical target and host architecture
163 # %gcc_target_arch is supposed to be the full target triple
164 # %TARGET_ARCH is the canonicalized CPU part
165 # %CONFIGURE_TARGET is the target triple used for --target=
166 %if 0%{?gcc_target_arch:1}
167 %define CONFIGURE_TARGET %{gcc_target_arch}
168 %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/;")
169 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
170 %define CONFIGURE_TARGET i586-tizen-linux
172 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
173 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
175 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
176 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
178 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7el"
179 %define CONFIGURE_TARGET armv7el-tizen-linux-gnueabi
181 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5el"
182 %define CONFIGURE_TARGET armv5el-tizen-linux-gnueabi
185 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
187 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
189 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
192 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
194 %define GCCDIST %{HOST_ARCH}-tizen-linux
197 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
198 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
202 # Versionspecific directories
203 %define versmainlibdir %{libsubdir}
204 %define versmainlibdirbi32 %{libsubdir}/32
205 %define versmainlibdirbi64 %{libsubdir}/64
206 %if %{build_primary_64bit}
207 %define versmainlibdirbi %{versmainlibdirbi32}
209 %define versmainlibdirbi %{versmainlibdirbi64}
212 %if 0%{?build_optional_compiler:1}
213 %define mainlibdir %{versmainlibdir}
214 %define mainlibdirbi32 %{versmainlibdirbi32}
215 %define mainlibdirbi64 %{versmainlibdirbi64}
216 %define noflibdir %{versnoflibdir}
217 %define mainlibdirbi %{versmainlibdirbi}
219 %define mainlibdir %{_libdir}
220 %define mainlibdirbi32 %{_prefix}/lib
221 %define mainlibdirbi64 %{_prefix}/lib64
222 %define noflibdir %{_prefix}/lib/nof
223 %if %{build_primary_64bit}
224 %define mainlibdirbi %{mainlibdirbi32}
226 %define mainlibdirbi %{mainlibdirbi64}
231 # Now define a few macros that make it easy to package libs and
232 # related files just to the right package, without caring for the
233 # exact path the files are in.
234 # %mainlib package X from all dirs that belong to the main package
235 # %biarchlib package X from all dirs that belong to the -32/64bit package
236 # by default, nof libs go where the 32bit libs go.
238 %define mainlib() %{mainlibdir}/%1\
242 %define mainlib() %{mainlibdir}/%1\
245 %define biarchlib() %{nil}
247 %if !%{separate_biarch}
249 %define mainlib() %{mainlibdir}/%1\
254 %define mainlib() %{mainlibdir}/%1\
260 %define biarchlib() %{mainlibdirbi}/%1\
263 %define mainlib() %{mainlibdir}/%1\
266 %define biarchlib() %{mainlibdirbi}/%1\
273 %define versmainlib() %{versmainlibdir}/%1\
277 %define versmainlib() %{versmainlibdir}/%1\
280 %define versbiarchlib() %{nil}
282 %if !%{separate_biarch}
284 %define versmainlib() %{versmainlibdir}/%1\
285 %{versmainlibdirbi}/%1\
289 %define versmainlib() %{versmainlibdir}/%1\
290 %{versmainlibdirbi}/%1\
295 %define versbiarchlib() %{versmainlibdirbi}/%1\
298 %define versmainlib() %{versmainlibdir}/%1\
301 %define versbiarchlib() %{versmainlibdirbi}/%1\
311 #%setup -q -n gcc-%{gcc_version}%{snapshot_date}
312 %setup -q -n gcc-%{version}
313 # 0001-dir-version.patch
320 # Avoid rebuilding of generated files
321 contrib/gcc_update --touch
322 # Avoid fucking up testsuite results with Java and indirect dispatch
323 export LD_AS_NEEDED=0
324 # Split version file into version used for directories (X.Y) and
325 # version to report with --version (X.Y.Z).
326 # See also gcc-dir-version.patch.
327 # Also decrement the patchlevel version by one
328 if test `cat gcc/DEV-PHASE` == "prerelease"; then
329 ( 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
331 mv gcc/BASE-VER gcc/FULL-VER
333 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
335 rm -rf obj-%{GCCDIST}
338 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
339 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'`
341 # -mcpu is superceded by -mtune but -mtune is not supported by
342 # our bootstrap compiler. -mcpu gives a warning that stops
343 # the build process, so remove it for now. Also remove all other
344 # -march and -mtune flags. They are superseeded by proper
345 # default compiler settings now.
346 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'`
348 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
349 # Kill all -march/tune/cpu because that screws building the target libs
350 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
352 # Replace 2 spaces by one finally
353 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
357 languages=$languages,c++
360 languages=$languages,objc
363 languages=$languages,fortran
366 languages=$languages,obj-c++
369 languages=$languages,java
372 languages=$languages,ada
376 if test -z "$J"; then
377 J=$(getconf _NPROCESSORS_CONF)
380 test 1 -gt "$J" && J=1
381 JL=$(($(getconf _NPROCESSORS_CONF)*2))
383 if test "$J" == "0"; then
386 if test "$JL" == "0"; then
389 PARALLEL="-j$J -l$JL"
391 # we don't want some miscompiles in the testsuite, or some fault in
392 # the compiler to kill the machine. Hence we limit the amount of memory
393 # by the physical RAM plus half of swap
394 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
395 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
396 #ulimit -v $(((MEM + SWAP/2)*1024))
398 # In general we want to ship release checking enabled compilers
399 # and run BETA with checking enabled.
400 #ENABLE_CHECKING="--enable-checking=yes"
401 ENABLE_CHECKING="--enable-checking=release"
403 # Work around tail/head -1 changes
404 export _POSIX2_VERSION=199209
406 # configure tries to parse include/features.h to detect
407 # if glibc supports SSP. When cross compiling we would need
408 # to install a cross glibc, which we don't, or make the whole
409 # thing point to the native glibc, which is in /, hence the
413 # Using the host gnatmake like
414 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
415 # GNATMAKE="gnatmake%{hostsuffix}"
416 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
418 mkdir -p host-tools/bin
419 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
420 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
421 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
422 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
423 ln -sf /usr/%{_lib} host-tools/%{_lib}
424 export PATH="`pwd`/host-tools/bin:$PATH"
426 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
428 # --enable-threads=posix \
431 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
432 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
434 --prefix=%{_prefix} \
435 --infodir=%{_infodir} \
436 --mandir=%{_mandir} \
437 --libdir=%{_libdir} \
438 --libexecdir=%{_libdir} \
439 --enable-languages=$languages \
441 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
446 --disable-bootstrap \
449 --with-bugurl="http://bugs.tizen.org/" \
450 --with-pkgversion="Tizen Linux" \
451 %if !%{build_libjava}
454 --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
455 --with-ecj-jar=%{libsubdir}/ecj.jar \
457 %if !%{biarch_libjava}
458 --disable-libjava-multilib \
461 %if !%{build_with_mudflap}
462 --disable-libmudflap \
464 --with-slibdir=/%{_lib} \
466 --enable-__cxa_atexit \
467 --enable-libstdcxx-allocator=new \
468 --disable-libstdcxx-pch \
469 --enable-version-specific-runtime-libs \
470 --enable-linker-build-id \
471 %if 0%{?gcc_target_arch:1}
472 %if 0%{?gcc_icecream:1}
473 --with-build-sysroot=/ \
474 --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
475 --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
476 --enable-linux-futex \
478 %if 0%{?canonical_target:1}
479 --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
481 %if 0%{?build_static:1}
484 %if "%{TARGET_ARCH}" == "spu"
485 --with-sysroot=/usr/spu \
486 --with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
490 --target=%{CONFIGURE_TARGET} \
492 --program-suffix=%{binsuffix} \
493 --enable-linux-futex \
494 --without-system-libunwind \
496 %if "%{TARGET_ARCH}" == "armv5tel"
497 --with-arch=armv5te \
500 --with-abi=aapcs-linux \
501 --disable-sjlj-exceptions \
503 %if "%{TARGET_ARCH}" == "armv7el"
504 --with-arch=armv7-a \
505 --with-tune=cortex-a9 \
509 --disable-sjlj-exceptions \
511 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
512 --with-arch=armv7-a \
513 --with-tune=cortex-a9 \
515 --with-abi=aapcs-linux \
516 --with-fpu=vfpv3-d16 \
517 --disable-sjlj-exceptions \
519 %if "%{TARGET_ARCH}" == "i586"
520 --with-arch-32=i586 \
521 --with-tune=generic \
523 %if "%{TARGET_ARCH}" == "x86_64"
524 --with-arch-32=i586 \
525 --with-tune=generic \
531 %if 0%{?building_libffi:1}
532 make stage1-bubble $PARALLEL
533 make all-target-libffi $PARALLEL
535 # Only run profiled bootstrap on archs where it works
536 #%ifarch %ix86 x86_64
537 #make profiledbootstrap-lean STAGE1_CFLAGS="-O -g" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
544 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
545 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
551 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
552 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
553 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
554 make -k check $PARALLEL || true
556 ../contrib/test_summary | tee ../testresults/test_summary.txt
561 export NO_BRP_CHECK_BYTECODE_VERSION=true
564 cp `find . -name "*.sum"` ../testresults/
565 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
566 chmod 644 ../testresults/*
571 %defattr(-,root,root)
572 %doc testresults/test_summary.txt
573 %doc testresults/*.sum
574 %doc testresults/*.log