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