Updating spec files with new scripts
[platform/upstream/gcc49.git] / packaging / gcc49-testresults.spec
1 %define building_testsuite 0
2 %define run_tests 0
3 #
4 # spec file for package gcc49
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 %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
35 %endif
36 %define cilkrts_arch x86_64 %ix86
37
38 # We don't want to build java
39 %define build_java 0
40 %define build_libjava 0
41
42 # Also go and objc aren't needed right now
43 %define build_objc 0
44 %define build_objcp 0
45 %define build_go 0
46
47 %define build_cp 1
48 %define build_fortran !0%{?building_libjava:1}%{?building_libffi:1}
49
50 %if %{build_objcp}
51 %define build_cp 1
52 %define build_objc 1
53 %endif
54
55 %if %{build_libjava}
56 %define build_cp 1
57 %endif
58
59 # For optional compilers only build C, C++ and Fortran
60 %if 0%{?build_optional_compiler_languages:1}
61 %define build_ada 0
62 %define build_java 0
63 %define build_libjava 0
64 %define build_objc 0
65 %define build_objcp 0
66 %define build_go 0
67 %endif
68
69 # Shared library SONAME versions
70 %ifarch hppa
71 %define libgcc_s 4
72 %else
73 %ifarch m68k
74 %define libgcc_s 2
75 %else
76 %define libgcc_s 1
77 %endif
78 %endif
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}
96
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
110 %define pne 1
111 %endif
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}
126
127
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}
133
134 %define selfconflict() %1
135
136 Name: gcc49-testresults
137 # With generated files in src we could drop the following
138 BuildRequires: bison
139 BuildRequires: flex
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
147 BuildRequires: perl
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
152 %endif
153 %if %{build_ada}
154 %define hostsuffix -4.9
155 BuildRequires: gcc49-ada
156 %endif
157 %if 0%{?building_libjava:1}%{?building_testsuite:1}
158 BuildRequires: fastjar
159 %endif
160 %if 0%{?building_libffi:1}
161 BuildRequires: pkg-config
162 %endif
163 %ifarch ia64
164 BuildRequires: libunwind-devel
165 %endif
166 %if 0%{?run_tests:1}
167 BuildRequires: dejagnu
168 BuildRequires: expect
169 BuildRequires: gdb
170 %endif
171
172 %define separate_bi32 0
173 %define separate_bi64 0
174 %ifarch ppc sparcv9
175 # Beware, this does _not_ separate libgcj, as for that one multilibing
176 # is inactive for the time being
177 %define separate_bi64 1
178 %endif
179 %ifarch x86_64 s390x ppc64 sparc64
180 %define separate_bi32 1
181 %endif
182
183 # Define two macros to trigger -32bit or -64bit package variants
184 %define separate_biarch 0
185 %if %{separate_bi32}
186 %define separate_biarch 1
187 %define separate_biarch_suffix -32bit
188 %endif
189 %if %{separate_bi64}
190 %define separate_biarch 1
191 %define separate_biarch_suffix -64bit
192 %endif
193
194 %ifarch x86_64 ia64 s390x alpha ppc64 sparc64 aarch64
195 # 64-bit is primary build target
196 %define build_primary_64bit 1
197 %else
198 %define build_primary_64bit 0
199 %endif
200
201 %define biarch_libjava 0
202
203 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
204
205 URL:          http://gcc.gnu.org/
206 Version: 4.9.1
207 Release:      1
208 %define gcc_dir_version 4.9
209 %define binsuffix -4.9
210
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}
216 %ifarch %asan_arch
217 Requires: libasan%{libasan_sover} >= %{version}-%{release}
218 %endif
219 %ifarch %tsan_arch
220 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
221 %endif
222 %ifarch %atomic_arch
223 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
224 %endif
225 %ifarch %itm_arch
226 Requires: libitm%{libitm_sover} >= %{version}-%{release}
227 %endif
228 %ifarch %cilkrts_arch
229 Requires: libcilkrts%{libcilkrts_sover} >= %{version}-%{release}
230 %endif
231 %ifarch %lsan_arch
232 Requires: liblsan%{liblsan_sover} >= %{version}-%{release}
233 %endif
234 %ifarch %ubsan_arch
235 Requires: libubsan%{libubsan_sover} >= %{version}-%{release}
236 %endif
237 %ifarch %vtv_arch
238 Requires: libvtv%{libvtv_sover} >= %{version}-%{release}
239 %endif
240 Requires: gcc49-info gcc49-locale
241 %endif
242
243 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
244 Source:         gcc-%{version}.tar.bz2
245 Source1:        change_spec
246 Source2:        libffi49-rpmlintrc
247 Source3:        gcc49-rpmlintrc
248 Source4:        ecj.jar
249 Source5:        baselibs.conf
250 Source6:        libgcj49-rpmlintrc
251
252 Summary:      Testsuite results
253 License:        SUSE-Public-Domain
254 Group:        Development/Languages
255
256 %description
257 Results from running the gcc and target library testsuites.
258
259
260
261
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
271 %endif
272 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
273 %define CONFIGURE_TARGET powerpc64-tizen-linux
274 %endif
275 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
276 %define CONFIGURE_TARGET i586-tizen-linux
277 %endif
278 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "aarch64"
279 %define CONFIGURE_TARGET aarch64-tizen-linux
280 %endif
281 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
282 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
283 %endif
284 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
285 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
286 %endif
287 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
288 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
289 %endif
290 %else
291 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
292 %endif
293 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
294
295 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
296 %ifarch ppc
297 %define GCCDIST powerpc64-tizen-linux
298 %else
299 %ifarch %sparc
300 %define GCCDIST sparc64-tizen-linux
301 %else
302 %ifarch %arm
303 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
304 %else
305 %define GCCDIST %{HOST_ARCH}-tizen-linux
306 %endif
307 %endif
308 %endif
309
310 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
311 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
312
313
314 # Versionspecific directories
315 %define versmainlibdir %{libsubdir}
316 %define versmainlibdirbi32 %{libsubdir}/32
317 %define versmainlibdirbi64 %{libsubdir}/64
318 %ifarch ppc
319 %define versmainlibdirbi32 %{libsubdir}
320 %define versmainlibdirbi64 %{libsubdir}/64
321 %endif
322 %if %{build_primary_64bit}
323 %define versmainlibdirbi %{versmainlibdirbi32}
324 %else
325 %define versmainlibdirbi %{versmainlibdirbi64}
326 %endif
327
328 %define mainlibdir %{_libdir}
329 %define mainlibdirbi32 %{_prefix}/lib
330 %define mainlibdirbi64 %{_prefix}/lib64
331 %if %{build_primary_64bit}
332 %define mainlibdirbi %{mainlibdirbi32}
333 %else
334 %define mainlibdirbi %{mainlibdirbi64}
335 %endif
336
337
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\
344 %{nil}
345 %define biarchlib() %{nil}
346 %if %{biarch}
347 %if !%{separate_biarch}
348 %define mainlib() %{mainlibdir}/%1\
349 %{mainlibdirbi}/%1\
350 %{nil}
351 %else
352 %define biarchlib() %{mainlibdirbi}/%1\
353 %{nil}
354 %endif
355 %endif
356
357 %define versmainlib() %{versmainlibdir}/%1\
358 %{nil}
359 %define versbiarchlib() %{nil}
360 %if %{biarch}
361 %if !%{separate_biarch}
362 %define versmainlib() %{versmainlibdir}/%1\
363 %{versmainlibdirbi}/%1\
364 %{nil}
365 %else
366 %define versbiarchlib() %{versmainlibdirbi}/%1\
367 %{nil}
368 %endif
369 %endif
370
371
372
373 %prep
374 %setup -q -n gcc-%{version}
375
376 # We are configuring ppc as ppc64 but with switched multilibs.  Adjust
377 # the libstdc++ abi testsuite baseline files accordingly
378 %ifarch ppc
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/
385 fi
386 %endif
387
388 %build
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
400     : > gcc/DEV-PHASE
401   fi
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
403 else
404   mv gcc/BASE-VER gcc/FULL-VER
405 fi
406 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
407
408 rm -rf obj-%{GCCDIST}
409 mkdir obj-%{GCCDIST}
410 cd 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"`
413 %ifarch %ix86
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'`
420 %endif
421 %ifarch s390 s390x
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'`
424 %endif
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'`
428 %endif
429 # Replace 2 spaces by one finally
430 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  / /g'`
431
432 languages=c
433 %if %{build_cp}
434 languages=$languages,c++
435 %endif
436 %if %{build_objc}
437 languages=$languages,objc
438 %endif
439 %if %{build_fortran}
440 languages=$languages,fortran
441 %endif
442 %if %{build_objcp}
443 languages=$languages,obj-c++
444 %endif
445 %if %{build_java}
446 languages=$languages,java
447 %endif
448 %if %{build_ada}
449 languages=$languages,ada
450 %endif
451 %if %{build_go}
452 languages=$languages,go
453 %endif
454
455 J=%{?jobs:%jobs}
456 if test -z "$J"; then
457   J=$(getconf _NPROCESSORS_CONF)
458   JL=$(($J * 2))
459 else
460   test 1 -gt "$J" && J=1
461   JL=$(($(getconf _NPROCESSORS_CONF)*2))
462 fi
463 if test "$J" == "0"; then
464   J=1
465 fi
466 if test "$JL" == "0"; then
467   JL=1
468 fi
469 PARALLEL="-j$J -l$JL"
470
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))
477
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"
482
483 # Work around tail/head -1 changes
484 export _POSIX2_VERSION=199209
485
486 %if %{build_ada}
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
491 # available
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"
499 %endif
500 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
501 #%else
502 #       --enable-threads=posix \
503 #%endif
504 #       --enable-shared \
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"
508 %endif
509
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" \
512 ../configure \
513         --prefix=%{_prefix} \
514         --infodir=%{_infodir} \
515         --mandir=%{_mandir} \
516         --libdir=%{_libdir} \
517         --libexecdir=%{_libdir} \
518         --enable-languages=$languages \
519         $ENABLE_CHECKING \
520         --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
521         --enable-ssp \
522         --disable-libssp \
523         --disable-bootstrap \
524 %if 0%{!?build_libvtv:1}
525         --disable-libvtv \
526 %endif
527         --disable-plugin \
528         --with-bugurl="http://bugs.tizen.org/" \
529         --with-pkgversion="Tizen" \
530 %if !%{build_fortran}
531         --disable-libquadmath \
532 %endif
533 %if !%{build_libjava}
534         --disable-libgcj \
535 %else
536         --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
537         --with-ecj-jar=%{libsubdir}/ecj.jar \
538         --disable-java-awt \
539 %if !%{biarch_libjava}
540         --disable-libjava-multilib \
541 %endif
542 %endif
543         --with-slibdir=/%{_lib} \
544         --with-system-zlib \
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}
553 %ifarch ia64
554         --with-system-libunwind \
555 %else
556         --without-system-libunwind \
557 %endif
558 %endif
559 %if 0%{?gcc_target_arch:1}
560         --program-prefix=%{gcc_target_arch}- \
561         --target=%{gcc_target_arch} \
562         --disable-nls \
563 %if 0%{?sysroot:1}
564         --with-sysroot=%sysroot \
565 %else
566         --with-sysroot=%{_prefix}/%{gcc_target_arch} \
567 %endif
568 %if 0%{?build_sysroot:1}
569         --with-build-sysroot=%{build_sysroot} \
570 %else
571 %if 0%{?sysroot:1}
572         --with-build-sysroot=%{sysroot} \
573 %else
574         --with-build-sysroot=%{_prefix}/%{gcc_target_arch} \
575 %endif
576 %endif
577 %if 0%{?canonical_target:1}
578         --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
579 %endif
580 %if "%{TARGET_ARCH}" == "spu"
581         --with-gxx-include-dir=%sysroot/include/c++/%{gcc_dir_version} \
582         --with-newlib \
583 %endif
584 %endif
585 %if "%{TARGET_ARCH}" == "armv5tel"
586         --with-arch=armv5te \
587         --with-float=soft \
588         --with-mode=arm \
589         --with-abi=aapcs-linux \
590         --disable-sjlj-exceptions \
591 %endif
592 %if "%{TARGET_ARCH}" == "armv7l"
593         --with-arch=armv7-a \
594         --with-tune=cortex-a8 \
595         --with-float=softfp \
596         --with-fpu=vfpv3 \
597         --with-mode=thumb \
598         --disable-sjlj-exceptions \
599 %endif
600 %if "%{TARGET_ARCH}" == "armv7hl"
601         --with-arch=armv7-a \
602         --with-tune=cortex-a9 \
603         --with-float=hard \
604         --with-abi=aapcs-linux \
605         --with-fpu=vfpv3-d16 \
606         --disable-sjlj-exceptions \
607 %endif
608 %if  "%{TARGET_ARCH}" == "aarch64"
609         --with-arch=armv8-a \
610         --disable-sjlj-exceptions \
611 %endif
612 %if "%{TARGET_ARCH}" == "powerpc" || "%{TARGET_ARCH}" == "powerpc64"
613 %if "%{TARGET_ARCH}" == "powerpc"
614         --with-cpu=default32 \
615 %endif
616 %if "%{TARGET_ARCH}" == "powerpc64le"
617         --with-cpu=power7 \
618 %else
619         --with-cpu-64=power4 \
620 %endif
621         --enable-secureplt \
622         --with-long-double-128 \
623 %if "%{TARGET_ARCH}" == "powerpc64le"
624         --disable-multilib \
625 %endif
626 %endif
627 %if "%{TARGET_ARCH}" == "sparc64"
628         --with-cpu=ultrasparc \
629         --with-long-double-128 \
630 %endif
631 %if "%{TARGET_ARCH}" == "sparc"
632         --with-cpu=v8 \
633         --with-long-double-128 \
634 %endif
635 %if "%{TARGET_ARCH}" == "i586"
636         --with-arch-32=i586 \
637         --with-tune=generic \
638 %endif
639 %if "%{TARGET_ARCH}" == "x86_64"
640         --with-arch-32=i586 \
641         --with-tune=generic \
642         --enable-multilib \
643 %endif
644 %if "%{TARGET_ARCH}" == "s390"
645         --with-tune=zEC12 --with-arch=z196 \
646         --with-long-double-128 \
647         --enable-decimal-float \
648 %endif
649 %if "%{TARGET_ARCH}" == "s390x"
650         --with-tune=zEC12 --with-arch=z196 \
651         --with-long-double-128 \
652         --enable-decimal-float \
653 %endif
654 %if "%{TARGET_ARCH}" == "m68k"
655         --disable-multilib \
656 %endif
657         --build=%{GCCDIST} \
658         --host=%{GCCDIST}
659
660
661 %if 0%{?building_libffi:1}
662 make stage1-bubble $PARALLEL
663 make all-target-libffi $PARALLEL
664 %else
665 STAGE1_FLAGS="-g"
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
669 %else
670 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
671 %endif
672 make info
673 %if 0%{?building_libjava:1}
674 make -C %{GCCDIST}/libstdc++-v3/doc doc-html-doxygen
675 %endif
676 %if 0%{?run_tests:1}
677 echo "Run testsuite"
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
684 mkdir ../testresults
685 ../contrib/test_summary | tee ../testresults/test_summary.txt
686 %endif
687 %endif
688
689 %install
690 export NO_BRP_CHECK_BYTECODE_VERSION=true
691 cd obj-%{GCCDIST}
692 %if 0%{?run_tests:1}
693 cp `find . -name "*.sum"` ../testresults/
694 cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
695 chmod 644 ../testresults/*
696 %endif
697
698 %if 0%{?run_tests:1}
699 %files
700 %defattr(-,root,root)
701 %doc testresults/test_summary.txt
702 %doc testresults/*.sum
703 %doc testresults/*.log
704 %endif
705
706
707 %changelog