e3d04cc98f26898b34362b245a46d47a9ecf0008
[platform/upstream/gcc48.git] / packaging / gcc48-testresults.spec
1 %define building_testsuite 1
2 %define run_tests 1
3 #
4 # spec file for package gcc48
5 #
6 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
7 #
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.
16
17 # Please submit bugfixes or comments via http://bugs.opensuse.org/
18 #
19
20 # norootforbuild
21 # icecream 0
22
23
24 %define build_ada 0
25
26 %define quadmath_arch %ix86 x86_64 ia64
27 %define tsan_arch x86_64
28 %define asan_arch x86_64 %ix86 ppc ppc64
29 %define itm_arch x86_64 %ix86 %arm ppc ppc64
30 %define atomic_arch x86_64 %ix86 %arm ppc ppc64 s390 s390x
31
32 # We don't want to build java
33 %define build_java 0
34 %define build_libjava 0
35
36 %define build_cp 1
37 %define build_fortran !0%{?building_libjava:1}%{?building_libffi:1}
38 %define build_objc !0%{?building_libjava:1}%{?building_libffi:1}
39 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
40 %define build_with_mudflap 0
41
42 %if %{build_objcp}
43 %define build_cp 1
44 %define build_objc 1
45 %endif
46
47 %if %{build_libjava}
48 %define build_cp 1
49 %endif
50
51 # For optional compilers only build C, C++ and Fortran
52 %if 0%{?build_optional_compiler_languages:1}
53 %define build_ada 0
54 %define build_java 0
55 %define build_libjava 0
56 %define build_objc 0
57 %define build_objcp 0
58 %endif
59
60 # Shared library SONAME versions
61 %ifarch hppa
62 %define libgcc_s 4
63 %else
64 %define libgcc_s 1
65 %endif
66 %define libgcj_sover 14
67 %define libgcj_bc_sover 1
68 %define libffi_sover 4
69 %define libmudflap_sover 0
70 %define libgomp_sover 1
71 %define libstdcxx_sover 6
72 %define libobjc_sover 4
73 %define libgfortran_sover 3
74 %define libquadmath_sover 0
75 %define libasan_sover 0
76 %define libtsan_sover 0
77 %define libatomic_sover 1
78 %define libitm_sover 1
79
80 # Shared library package suffix
81 # This is used for the "non-standard" set of libraries, the standard
82 # being defined by %product_libs_gcc_ver, the GCC version that should
83 # provide un-suffixed shared library packages following the shared-library
84 # policy.  Even suffixed variants should provide the shared-library policy
85 # mandated names and ensure they conflict with each other.
86 # Note that on SONAME changes of any library the %product_libs_gcc_ver
87 # define needs to be either split or the newest GCC version still providing
88 # the old SONAME needs to unconditionally produce an un-suffixed library
89 # if %product_libs_gcc_ver is newer than it.  Similar the _oldest_ GCC
90 # version first providing a new SONAME needs to unconditionally produce
91 # an un-suffixed library if %product_libs_gcc_ver is lower that it.
92 %if %{!?product_libs_gcc_ver:48}%{?product_libs_gcc_ver} != 48
93 %define pne 1
94 %endif
95 %define libgcc_s_suffix %{?pne:-gcc48}
96 # libgcj SONAME changes with every GCC version
97 %define libgcj_suffix %nil
98 %define libgcj_bc_suffix %{?pne:-gcc48}
99 %define libffi_suffix %{?pne:-gcc48}
100 %define libmudflap_suffix %{?pne:-gcc48}
101 %define libgomp_suffix %{?pne:-gcc48}
102 %define libstdcxx_suffix %{?pne:-gcc48}
103 %define libobjc_suffix %{?pne:-gcc48}
104 %define libgfortran_suffix %{?pne:-gcc48}
105 %define libquadmath_suffix %{?pne:-gcc48}
106 %define libasan_suffix %{?pne:-gcc48}
107 %define libtsan_suffix %{?pne:-gcc48}
108 %define libatomic_suffix %{?pne:-gcc48}
109 %define libitm_suffix %{?pne:-gcc48}
110
111
112
113
114 Name: gcc48-testresults
115 BuildRequires: gcc-c++
116 BuildRequires: bison
117 BuildRequires: flex
118 BuildRequires: glibc-devel-32bit
119 BuildRequires: mpc-devel
120 BuildRequires: mpfr-devel
121 BuildRequires: perl
122 BuildRequires: makeinfo
123 BuildRequires: zlib-devel
124 %ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm
125 BuildRequires: cloog-isl-devel
126 BuildRequires: isl-devel
127 %endif
128 %if %{build_ada}
129 %define hostsuffix -4.7
130 BuildRequires: gcc47-ada
131 %endif
132 %if 0%{?building_libjava:1}%{?building_testsuite:1}
133 BuildRequires: fastjar
134 %endif
135 %if 0%{?building_libffi:1}
136 BuildRequires: pkg-config
137 %endif
138 %ifarch ia64
139 BuildRequires: libunwind-devel
140 %endif
141 %if 0%{?run_tests:1}
142 BuildRequires: dejagnu
143 BuildRequires: expect
144 BuildRequires: gdb
145 %endif
146
147 %define separate_bi32 0
148 %define separate_bi64 0
149 %ifarch ppc sparcv9
150 # Beware, this does _not_ separate libgcj, as for that one multilibing
151 # is inactive for the time being
152 %define separate_bi64 1
153 %endif
154 %ifarch x86_64 s390x ppc64 sparc64
155 %define separate_bi32 1
156 %endif
157
158 # Define two macros to trigger -32bit or -64bit package variants
159 %define separate_biarch 0
160 %if %{separate_bi32}
161 %define separate_biarch 1
162 %define separate_biarch_suffix -32bit
163 %endif
164 %if %{separate_bi64}
165 %define separate_biarch 1
166 %define separate_biarch_suffix -64bit
167 %endif
168
169 %ifarch x86_64 ia64 s390x alpha ppc64 sparc64
170 # 64-bit is primary build target
171 %define build_primary_64bit 1
172 %else
173 %define build_primary_64bit 0
174 %endif
175
176 %define biarch_libjava 0
177
178 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
179
180 URL:          http://gcc.gnu.org/
181 Version: 4.8.1
182 Release:      1
183 %define gcc_version %(echo %version | sed 's/_.*//')
184 %define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
185 %define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed 's/_/-/')
186 %define binsuffix -4.8
187
188 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
189 Requires: binutils glibc-devel
190 Requires: cpp48 = %{version}-%{release}
191 Requires: libgcc_s%{libgcc_s} >= %{version}-%{release}
192 Requires: libgomp%{libgomp_sover} >= %{version}-%{release}
193 %if %{build_with_mudflap}
194 Requires: libmudflap%{libmudflap_sover} >= %{version}-%{release}
195 Requires: libmudflapth%{libmudflap_sover} >= %{version}-%{release}
196 %endif
197 %ifarch %asan_arch
198 Requires: libasan%{libasan_sover} >= %{version}-%{release}
199 %endif
200 %ifarch %tsan_arch
201 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
202 %endif
203 %ifarch %atomic_arch
204 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
205 %endif
206 %ifarch %itm_arch
207 Requires: libitm%{libitm_sover} >= %{version}-%{release}
208 %endif
209 Suggests: gcc48-info gcc48-locale
210 %endif
211
212 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
213 Source:         gcc-%{gcc_version}%{snapshot_date}.tar.bz2
214 Source1:        change_spec
215 Source3:        gcc48-rpmlintrc
216 Source4:        ecj.jar
217 Source6:        baselibs.conf
218
219
220 Summary:      Testsuite results
221 License:        SUSE-Public-Domain
222 Group:        Development/Languages/C and C++
223
224 %description 
225 Results from running the gcc and target library testsuites.
226
227
228
229 # Define the canonical target and host architecture
230 #   %gcc_target_arch  is supposed to be the full target triple
231 #   %TARGET_ARCH      is the canonicalized CPU part
232 #   %CONFIGURE_TARGET is the target triple used for --target=
233 %if 0%{?gcc_target_arch:1}
234 %define CONFIGURE_TARGET %{gcc_target_arch}
235 %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/;")
236 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
237 %define CONFIGURE_TARGET powerpc64-tizen-linux
238 %endif
239 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
240 %define CONFIGURE_TARGET powerpc64-tizen-linux
241 %endif
242 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
243 %define CONFIGURE_TARGET i586-tizen-linux
244 %endif
245 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
246 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
247 %endif
248 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
249 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
250 %endif
251 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
252 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
253 %endif
254 %else
255 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
256 %endif
257 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
258
259 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
260
261 %ifarch ppc
262 %define GCCDIST powerpc64-tizen-linux
263 %else
264 %ifarch %sparc
265 %define GCCDIST sparc64-tizen-linux
266 %else
267 %ifarch %arm
268 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
269 %else
270 %define GCCDIST %{HOST_ARCH}-tizen-linux
271 %endif
272 %endif
273 %endif
274
275 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
276 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
277
278
279 # Versionspecific directories
280 %define versmainlibdir %{libsubdir}
281 %define versmainlibdirbi32 %{libsubdir}/32
282 %define versmainlibdirbi64 %{libsubdir}/64
283 %ifarch ppc
284 %define versmainlibdirbi32 %{libsubdir}
285 %define versmainlibdirbi64 %{libsubdir}/64
286 %endif
287 %if %{build_primary_64bit}
288 %define versmainlibdirbi %{versmainlibdirbi32}
289 %else
290 %define versmainlibdirbi %{versmainlibdirbi64}
291 %endif
292
293 %define mainlibdir %{_libdir}
294 %define mainlibdirbi32 %{_prefix}/lib
295 %define mainlibdirbi64 %{_prefix}/lib64
296 %if %{build_primary_64bit}
297 %define mainlibdirbi %{mainlibdirbi32}
298 %else
299 %define mainlibdirbi %{mainlibdirbi64}
300 %endif
301
302
303 # Now define a few macros that make it easy to package libs and
304 # related files just to the right package, without caring for the
305 # exact path the files are in.
306 #   %mainlib  package X from all dirs that belong to the main package
307 #   %biarchlib   package X from all dirs that belong to the -32/64bit package
308 %define mainlib() %{mainlibdir}/%1\
309 %{nil}
310 %define biarchlib() %{nil}
311 %if %{biarch}
312 %if !%{separate_biarch}
313 %define mainlib() %{mainlibdir}/%1\
314 %{mainlibdirbi}/%1\
315 %{nil}
316 %else
317 %define biarchlib() %{mainlibdirbi}/%1\
318 %{nil}
319 %endif
320 %endif
321
322 %define versmainlib() %{versmainlibdir}/%1\
323 %{nil}
324 %define versbiarchlib() %{nil}
325 %if %{biarch}
326 %if !%{separate_biarch}
327 %define versmainlib() %{versmainlibdir}/%1\
328 %{versmainlibdirbi}/%1\
329 %{nil}
330 %else
331 %define versbiarchlib() %{versmainlibdirbi}/%1\
332 %{nil}
333 %endif
334 %endif
335
336
337
338 %prep
339 %setup -q -n gcc-%{gcc_version}%{snapshot_date}
340
341
342 # We are configuring ppc as ppc64 but with switched multilibs.  Adjust
343 # the libstdc++ abi testsuite baseline files accordingly
344 %ifarch ppc
345 if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
346   mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
347   mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt \
348         libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64/
349   mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt \
350         libstdc++-v3/config/abi/post/powerpc64-linux-gnu/
351 fi
352 %endif
353
354 %build
355 # Avoid rebuilding of generated files
356 contrib/gcc_update --touch
357 # Avoid fucking up testsuite results with Java and indirect dispatch
358 export LD_AS_NEEDED=0
359 # Split version file into version used for directories (X.Y) and
360 # version to report with --version (X.Y.Z).
361 # See also gcc-dir-version.patch.
362 # Also decrement the patchlevel version by one
363 if test `cat gcc/DEV-PHASE` == "prerelease"; then
364   ( 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
365 else
366   mv gcc/BASE-VER gcc/FULL-VER
367 fi
368 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
369
370 rm -rf obj-%{GCCDIST}
371 mkdir obj-%{GCCDIST}
372 cd obj-%{GCCDIST}
373 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
374 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'`
375 %ifarch %ix86
376 # -mcpu is superceded by -mtune but -mtune is not supported by
377 # our bootstrap compiler.  -mcpu gives a warning that stops
378 # the build process, so remove it for now.  Also remove all other
379 # -march and -mtune flags.  They are superseeded by proper
380 # default compiler settings now.
381 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'`
382 %endif
383 %ifarch s390 s390x
384 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
385 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
386 %endif
387 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
388 # Kill all -march/tune/cpu because that screws building the target libs
389 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
390 %endif
391 # Replace 2 spaces by one finally
392 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  / /g'`
393
394 languages=c
395 %if %{build_cp}
396 languages=$languages,c++
397 %endif
398 %if %{build_objc}
399 languages=$languages,objc
400 %endif
401 %if %{build_fortran}
402 languages=$languages,fortran
403 %endif
404 %if %{build_objcp}
405 languages=$languages,obj-c++
406 %endif
407 %if %{build_java}
408 languages=$languages,java
409 %endif
410 %if %{build_ada}
411 languages=$languages,ada
412 %endif
413
414 J=%{?jobs:%jobs}
415 if test -z "$J"; then
416   J=$(getconf _NPROCESSORS_CONF)
417   JL=$(($J * 2))
418 else
419   test 1 -gt "$J" && J=1
420   JL=$(($(getconf _NPROCESSORS_CONF)*2))
421 fi
422 if test "$J" == "0"; then
423   J=1
424 fi
425 if test "$JL" == "0"; then
426   JL=1
427 fi
428 PARALLEL="-j$J -l$JL"
429
430 # we don't want some miscompiles in the testsuite, or some fault in
431 # the compiler to kill the machine.  Hence we limit the amount of memory
432 # by the physical RAM plus half of swap
433 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
434 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
435 #ulimit -v $(((MEM + SWAP/2)*1024))
436
437 # In general we want to ship release checking enabled compilers
438 # and run BETA with checking enabled.
439 #ENABLE_CHECKING="--enable-checking=yes"
440 ENABLE_CHECKING="--enable-checking=release"
441
442 # Work around tail/head -1 changes
443 export _POSIX2_VERSION=199209
444
445 # configure tries to parse include/features.h to detect
446 # if glibc supports SSP.  When cross compiling we would need
447 # to install a cross glibc, which we don't, or make the whole
448 # thing point to the native glibc, which is in /, hence the
449 # --with-build-sysroot=/
450
451 %if %{build_ada}
452 # Using the host gnatmake like
453 #   CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
454 #   GNATMAKE="gnatmake%{hostsuffix}"
455 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
456 # available
457 mkdir -p host-tools/bin
458 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
459 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
460 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
461 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
462 ln -sf /usr/%{_lib} host-tools/%{_lib}
463 export PATH="`pwd`/host-tools/bin:$PATH"
464 %endif
465 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
466 #%else
467 #       --enable-threads=posix \
468 #%endif
469 #       --enable-shared \
470 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
471 # temporary workaround for a miscompilation of hash functions in java code
472 GCJ_EXTRA_FLAGS="-marm"
473 %endif
474 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
475 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS $GCJ_EXTRA_FLAGS" \
476 ../configure \
477         --prefix=%{_prefix} \
478         --infodir=%{_infodir} \
479         --mandir=%{_mandir} \
480         --libdir=%{_libdir} \
481         --libexecdir=%{_libdir} \
482     --disable-bootstrap \
483         --enable-languages=$languages \
484         $ENABLE_CHECKING \
485         --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
486         --enable-ssp \
487         --disable-libssp \
488         --disable-plugin \
489         --with-bugurl="http://bugs.tizen.org/" \
490         --with-pkgversion="Tizen" \
491 %if !%{build_libjava}
492         --disable-libgcj \
493 %else
494         --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
495         --with-ecj-jar=%{libsubdir}/ecj.jar \
496         --disable-java-awt \
497 %if !%{biarch_libjava}
498         --disable-libjava-multilib \
499 %endif
500 %endif
501 %if !%{build_with_mudflap}
502         --disable-libmudflap \
503 %endif
504         --with-slibdir=/%{_lib} \
505         --with-system-zlib \
506         --enable-__cxa_atexit \
507         --enable-libstdcxx-allocator=new \
508         --disable-libstdcxx-pch \
509         --enable-version-specific-runtime-libs \
510         --enable-linker-build-id \
511 %if 0%{?gcc_target_arch:1}
512 %if 0%{?gcc_icecream:1}
513         --with-build-sysroot=/ \
514         --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
515         --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
516         --enable-linux-futex \
517 %endif
518 %if 0%{?canonical_target:1}
519         --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
520 %endif
521 %if 0%{?sysroot:1}
522         --with-sysroot=%sysroot \
523 %endif
524 %if 0%{?build_static:1}
525         --disable-shared \
526 %endif
527 %if "%{TARGET_ARCH}" == "spu"
528         --with-gxx-include-dir=%sysroot/include/c++/%{gcc_dir_version} \
529         --with-newlib \
530 %endif
531         --disable-nls \
532         --target=%{CONFIGURE_TARGET} \
533 %else
534         --program-suffix=%{binsuffix} \
535         --enable-linux-futex \
536 %ifarch ia64
537         --with-system-libunwind \
538 %else
539         --without-system-libunwind \
540 %endif
541 %endif
542 %if "%{TARGET_ARCH}" == "armv5tel"
543         --with-arch=armv5te \
544         --with-float=soft \
545         --with-mode=arm \
546         --with-abi=aapcs-linux \
547         --disable-sjlj-exceptions \
548 %endif
549 %if "%{TARGET_ARCH}" == "armv7l" 
550         --with-arch=armv7-a \
551         --with-tune=cortex-a9 \
552         --with-float=hard \
553         --with-abi=aapcs-linux \
554         --with-fpu=vfpv3-d16 \
555         --disable-sjlj-exceptions \
556 %endif
557 %if  "%{TARGET_ARCH}" == "armv7hl"
558         --with-arch=armv7-a \
559         --with-tune=cortex-a9 \
560         --with-float=hard \
561         --with-abi=aapcs-linux \
562         --with-fpu=vfpv3-d16 \
563         --disable-sjlj-exceptions \
564 %endif
565 %if "%{TARGET_ARCH}" == "powerpc" || "%{TARGET_ARCH}" == "powerpc64"
566 %if "%{TARGET_ARCH}" == "powerpc"
567         --with-cpu=default32 \
568 %endif
569         --with-cpu-64=power4 \
570         --enable-secureplt \
571         --with-long-double-128 \
572 %endif
573 %if "%{TARGET_ARCH}" == "sparc64"
574         --with-cpu=ultrasparc \
575         --with-long-double-128 \
576 %endif
577 %if "%{TARGET_ARCH}" == "sparc"
578         --with-cpu=v8 \
579         --with-long-double-128 \
580 %endif
581 %if "%{TARGET_ARCH}" == "i586"
582         --with-arch-32=i586 \
583         --with-tune=generic \
584 %endif
585 %if "%{TARGET_ARCH}" == "x86_64"
586         --with-arch-32=i586 \
587         --with-tune=generic \
588 %endif
589 %if "%{TARGET_ARCH}" == "s390"
590         --with-tune=z196 --with-arch=z10 \
591         --with-long-double-128 \
592         --enable-decimal-float \
593 %endif
594 %if "%{TARGET_ARCH}" == "s390x"
595         --with-tune=z196 --with-arch=z10 \
596         --with-long-double-128 \
597         --enable-decimal-float \
598 %endif
599         --build=%{GCCDIST}
600
601
602 %if 0%{?building_libffi:1}
603 make stage1-bubble $PARALLEL
604 make all-target-libffi $PARALLEL
605 %else
606 STAGE1_FLAGS="-g"
607 # Only run profiled bootstrap on archs where it works
608 #%ifarch %ix86 x86_64 ppc ppc64 ia64
609 #make profiledbootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
610 #%else
611 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
612 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
613 #%endif
614 #make -C gcc proto
615 make info
616 %if 0%{?run_tests:1}
617 echo "Run testsuite"
618 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
619 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
620 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
621 # asan needs a whole shadow address space
622 ulimit -v unlimited || true
623 make -k check $PARALLEL || true
624 mkdir ../testresults
625 ../contrib/test_summary | tee ../testresults/test_summary.txt
626 %endif
627 %endif
628
629 %install
630 export NO_BRP_CHECK_BYTECODE_VERSION=true
631 cd obj-%{GCCDIST}
632 %if 0%{?run_tests:1} 
633 cp `find . -name "*.sum"` ../testresults/
634 cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
635 chmod 644 ../testresults/*
636 %endif
637
638 %if 0%{?run_tests:1}
639 %files 
640 %defattr(-,root,root)
641 %doc testresults/test_summary.txt
642 %doc testresults/*.sum
643 %doc testresults/*.log
644 %endif
645
646
647 %changelog