1 %define building_libffi 1
3 # spec file for package gcc49
5 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
7 # All modifications and additions to the file contributed by third parties
8 # remain the property of their copyright owners, unless otherwise agreed
9 # upon. The license for this file, and modifications and additions to the
10 # file, is the same license as for the pristine package itself (unless the
11 # license for the pristine package is not an Open Source License, in which
12 # case the license is the MIT License). An "Open Source License" is a
13 # license that conforms to the Open Source Definition (Version 1.9)
14 # published by the Open Source Initiative.
16 # Please submit bugfixes or comments via http://bugs.opensuse.org/
25 %define quadmath_arch %ix86 x86_64 ia64
26 %define tsan_arch x86_64
27 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm
28 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc
29 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
30 %define lsan_arch x86_64
31 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm
32 %if 0%{?build_libvtv:1}
33 %define vtv_arch x86_64 %ix86
35 %define cilkrts_arch x86_64 %ix86
37 # We don't want to build java
39 %define build_libjava 0
41 # Also go and objc aren't needed right now
47 %define build_fortran !0%{?building_libjava:1}%{?building_libffi:1}
58 # For optional compilers only build C, C++ and Fortran
59 %if 0%{?build_optional_compiler_languages:1}
62 %define build_libjava 0
68 # Shared library SONAME versions
78 %define libgcj_sover %{nil}
79 %define libgcj_bc_sover %{nil}
80 %define libffi_sover %{nil}
81 %define libgomp_sover %{nil}
82 %define libstdcxx_sover %{nil}
83 %define libobjc_sover %{nil}
84 %define libgfortran_sover %{nil}
85 %define libquadmath_sover %{nil}
86 %define libasan_sover %{nil}
87 %define libtsan_sover %{nil}
88 %define libatomic_sover %{nil}
89 %define libitm_sover %{nil}
90 %define libubsan_sover %{nil}
91 %define liblsan_sover %{nil}
92 %define libvtv_sover %{nil}
93 %define libcilkrts_sover %{nil}
94 %define libgo_sover %{nil}
96 # Shared library package suffix
97 # This is used for the "non-standard" set of libraries, the standard
98 # being defined by %product_libs_gcc_ver, the GCC version that should
99 # provide un-suffixed shared library packages following the shared-library
100 # policy. Even suffixed variants should provide the shared-library policy
101 # mandated names and ensure they conflict with each other.
102 # Note that on SONAME changes of any library the %product_libs_gcc_ver
103 # define needs to be either split or the newest GCC version still providing
104 # the old SONAME needs to unconditionally produce an un-suffixed library
105 # if %product_libs_gcc_ver is newer than it. Similar the _oldest_ GCC
106 # version first providing a new SONAME needs to unconditionally produce
107 # an un-suffixed library if %product_libs_gcc_ver is lower that it.
108 %if %{!?product_libs_gcc_ver:49}%{?product_libs_gcc_ver} != 49
111 %define libgcc_s_suffix %{?pne:-gcc49}
112 # libgcj SONAME changes with every GCC version
113 %define libgcj_suffix %nil
114 %define libgcj_bc_suffix %{?pne:-gcc49}
115 %define libffi_suffix %{?pne:-gcc49}
116 %define libgomp_suffix %{?pne:-gcc49}
117 %define libstdcxx_suffix %{?pne:-gcc49}
118 %define libobjc_suffix %{?pne:-gcc49}
119 %define libgfortran_suffix %{?pne:-gcc49}
120 %define libquadmath_suffix %{?pne:-gcc49}
121 %define libasan_suffix %{?pne:-gcc49}
122 %define libtsan_suffix %{?pne:-gcc49}
123 %define libatomic_suffix %{?pne:-gcc49}
124 %define libitm_suffix %{?pne:-gcc49}
127 %define libubsan_suffix %{?pne:-gcc49}
128 %define liblsan_suffix %{?pne:-gcc49}
129 %define libvtv_suffix %{?pne:-gcc49}
130 %define libcilkrts_suffix %{?pne:-gcc49}
131 %define libgo_suffix %{?pne:-gcc49}
133 %define selfconflict() %1
136 # With generated files in src we could drop the following
139 BuildRequires: gettext-devel
140 BuildRequires: makeinfo
141 # until here, but at least renaming and patching info files breaks this
142 BuildRequires: gcc-c++
143 BuildRequires: glibc-devel-32bit
144 BuildRequires: mpc-devel
145 BuildRequires: mpfr-devel
147 BuildRequires: zlib-devel
148 %ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm aarch64
149 BuildRequires: cloog-isl-devel
150 BuildRequires: isl-devel
153 %define hostsuffix -4.9
154 BuildRequires: gcc49-ada
156 %if 0%{?building_libjava:1}%{?building_testsuite:1}
157 BuildRequires: fastjar
159 %if 0%{?building_libffi:1}
160 BuildRequires: pkg-config
163 BuildRequires: libunwind-devel
166 BuildRequires: dejagnu
167 BuildRequires: expect
171 %define separate_bi32 0
172 %define separate_bi64 0
174 # Beware, this does _not_ separate libgcj, as for that one multilibing
175 # is inactive for the time being
176 %define separate_bi64 1
178 %ifarch x86_64 s390x ppc64 sparc64
179 %define separate_bi32 1
182 # Define two macros to trigger -32bit or -64bit package variants
183 %define separate_biarch 0
185 %define separate_biarch 1
186 %define separate_biarch_suffix -32bit
189 %define separate_biarch 1
190 %define separate_biarch_suffix -64bit
193 %ifarch x86_64 ia64 s390x alpha ppc64 sparc64 aarch64
194 # 64-bit is primary build target
195 %define build_primary_64bit 1
197 %define build_primary_64bit 0
200 %define biarch_libjava 0
202 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
204 URL: http://gcc.gnu.org/
207 %define gcc_dir_version 4.9
208 %define binsuffix -4.9
210 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
211 Requires: binutils glibc-devel
212 Requires: cpp49 = %{version}-%{release}
213 Requires: libgcc_s%{libgcc_s} >= %{version}-%{release}
214 Requires: libgomp%{libgomp_sover} >= %{version}-%{release}
216 Requires: libasan%{libasan_sover} >= %{version}-%{release}
219 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
222 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
225 Requires: libitm%{libitm_sover} >= %{version}-%{release}
227 %ifarch %cilkrts_arch
228 Requires: libcilkrts%{libcilkrts_sover} >= %{version}-%{release}
231 Requires: liblsan%{liblsan_sover} >= %{version}-%{release}
234 Requires: libubsan%{libubsan_sover} >= %{version}-%{release}
237 Requires: libvtv%{libvtv_sover} >= %{version}-%{release}
239 Requires: gcc49-info gcc49-locale
242 BuildRoot: %{_tmppath}/%{name}-%{version}-build
243 Source: gcc-%{version}.tar.bz2
245 Source2: libffi49-rpmlintrc
246 Source3: gcc49-rpmlintrc
248 Source5: baselibs.conf
249 Source6: libgcj49-rpmlintrc
251 Group: Development/Building
252 Summary: The GNU C Compiler and Support Files
256 Core package for the GNU Compiler Collection, including the C language
259 Language frontends other than C are split to different sub-packages,
260 namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
262 %package -n libffi%{libffi_sover}%{libffi_suffix}
263 Summary: Foreign Function Interface library
264 License: BSD-3-Clause
265 Group: Development/Building
266 Provides: libffi%{libffi_sover} = %{version}-%{release}
268 %description -n libffi%{libffi_sover}%{libffi_suffix}
269 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
271 %post -n libffi%{libffi_sover}%{libffi_suffix} -p /sbin/ldconfig
273 %postun -n libffi%{libffi_sover}%{libffi_suffix} -p /sbin/ldconfig
274 %package -n libffi%{libffi_sover}%{libffi_suffix}-32bit
275 Summary: Foreign Function Interface library
276 License: BSD-3-Clause
277 Group: Development/Building
278 Provides: libffi%{libffi_sover}-32bit = %{version}-%{release}
280 %description -n libffi%{libffi_sover}%{libffi_suffix}-32bit
281 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
283 %post -n libffi%{libffi_sover}%{libffi_suffix}-32bit -p /sbin/ldconfig
285 %postun -n libffi%{libffi_sover}%{libffi_suffix}-32bit -p /sbin/ldconfig
286 %package -n libffi%{libffi_sover}%{libffi_suffix}-64bit
287 Summary: Foreign Function Interface library
288 License: BSD-3-Clause
289 Group: Development/Building
290 Provides: libffi%{libffi_sover}-64bit = %{version}-%{release}
292 %description -n libffi%{libffi_sover}%{libffi_suffix}-64bit
293 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
295 %post -n libffi%{libffi_sover}%{libffi_suffix}-64bit -p /sbin/ldconfig
297 %postun -n libffi%{libffi_sover}%{libffi_suffix}-64bit -p /sbin/ldconfig
299 %package -n libffi49-devel
300 Summary: Foreign Function Interface library development files
301 License: BSD 3-Clause
302 Group: Development/Building
303 Requires: libffi%{libffi_sover} >= %{version}-%{release}
304 Provides: libffi-devel = %{version}-%{release}
306 %description -n libffi49-devel
307 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
308 %package -n libffi49-devel-32bit
309 Summary: Foreign Function Interface library development files
310 License: BSD 3-Clause
311 Group: Development/Building
312 Requires: libffi%{libffi_sover}-32bit >= %{version}-%{release}
313 Provides: libffi-devel-32bit = %{version}-%{release}
315 %description -n libffi49-devel-32bit
316 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
317 %package -n libffi49-devel-64bit
318 Summary: Foreign Function Interface library development files
319 License: BSD 3-Clause
320 Group: Development/Building
321 Requires: libffi%{libffi_sover}-64bit >= %{version}-%{release}
322 Provides: libffi-devel-64bit = %{version}-%{release}
324 %description -n libffi49-devel-64bit
325 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
328 Summary: GNU Go Compiler
330 Group: Development/Languages
331 Requires: gcc49 = %{version}-%{release}
332 Requires: libgo%{libgo_sover} >= %{version}-%{release}
335 This package contains a Go compiler and associated development
336 files based on the GNU GCC technology.
338 Summary: GNU Go Compiler
340 Group: Development/Languages
341 Requires: gcc49-32bit = %{version}-%{release}
342 Requires: libgo%{libgo_sover}-32bit >= %{version}-%{release}
344 %description go-32bit
345 This package contains a Go compiler and associated development
346 files based on the GNU GCC technology.
348 Summary: GNU Go Compiler
350 Group: Development/Languages
351 Requires: gcc49-64bit = %{version}-%{release}
352 Requires: libgo%{libgo_sover}-64bit >= %{version}-%{release}
354 %description go-64bit
355 This package contains a Go compiler and associated development
356 files based on the GNU GCC technology.
358 %package -n libgo%{libgo_sover}%{libgo_suffix}
359 Summary: GNU Go compiler runtime library
360 License: BSD-3-Clause
361 Group: Development/Languages
362 Provides: libgo%{libgo_sover} = %{version}-%{release}
364 %description -n libgo%{libgo_sover}%{libgo_suffix}
365 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
367 %post -n libgo%{libgo_sover}%{libgo_suffix} -p /sbin/ldconfig
369 %postun -n libgo%{libgo_sover}%{libgo_suffix} -p /sbin/ldconfig
370 %package -n libgo%{libgo_sover}%{libgo_suffix}-32bit
371 Summary: GNU Go compiler runtime library
372 License: BSD-3-Clause
373 Group: Development/Languages
374 Provides: libgo%{libgo_sover}-32bit = %{version}-%{release}
376 %description -n libgo%{libgo_sover}%{libgo_suffix}-32bit
377 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
379 %post -n libgo%{libgo_sover}%{libgo_suffix}-32bit -p /sbin/ldconfig
381 %postun -n libgo%{libgo_sover}%{libgo_suffix}-32bit -p /sbin/ldconfig
382 %package -n libgo%{libgo_sover}%{libgo_suffix}-64bit
383 Summary: GNU Go compiler runtime library
384 License: BSD-3-Clause
385 Group: Development/Languages
386 Provides: libgo%{libgo_sover}-64bit = %{version}-%{release}
388 %description -n libgo%{libgo_sover}%{libgo_suffix}-64bit
389 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
391 %post -n libgo%{libgo_sover}%{libgo_suffix}-64bit -p /sbin/ldconfig
393 %postun -n libgo%{libgo_sover}%{libgo_suffix}-64bit -p /sbin/ldconfig
396 %package -n gcc49-testresults
397 Summary: Testsuite results
398 License: SUSE-Public-Domain
399 Group: Development/Languages
401 %description -n gcc49-testresults
402 Results from running the gcc and target library testsuites.
407 # Define the canonical target and host architecture
408 # %gcc_target_arch is supposed to be the full target triple
409 # %TARGET_ARCH is the canonicalized CPU part
410 # %CONFIGURE_TARGET is the target triple used for --target=
411 %if 0%{?gcc_target_arch:1}
412 %define CONFIGURE_TARGET %{gcc_target_arch}
413 %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/;")
414 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
415 %define CONFIGURE_TARGET powerpc64-tizen-linux
417 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
418 %define CONFIGURE_TARGET powerpc64-tizen-linux
420 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
421 %define CONFIGURE_TARGET i586-tizen-linux
423 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "aarch64"
424 %define CONFIGURE_TARGET aarch64-tizen-linux
426 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
427 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
429 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
430 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
432 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
433 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
436 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
438 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
440 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
442 %define GCCDIST powerpc64-tizen-linux
445 %define GCCDIST sparc64-tizen-linux
448 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
450 %define GCCDIST %{HOST_ARCH}-tizen-linux
455 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
456 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
459 # Versionspecific directories
460 %define versmainlibdir %{libsubdir}
461 %define versmainlibdirbi32 %{libsubdir}/32
462 %define versmainlibdirbi64 %{libsubdir}/64
464 %define versmainlibdirbi32 %{libsubdir}
465 %define versmainlibdirbi64 %{libsubdir}/64
467 %if %{build_primary_64bit}
468 %define versmainlibdirbi %{versmainlibdirbi32}
470 %define versmainlibdirbi %{versmainlibdirbi64}
473 %define mainlibdir %{_libdir}
474 %define mainlibdirbi32 %{_prefix}/lib
475 %define mainlibdirbi64 %{_prefix}/lib64
476 %if %{build_primary_64bit}
477 %define mainlibdirbi %{mainlibdirbi32}
479 %define mainlibdirbi %{mainlibdirbi64}
483 # Now define a few macros that make it easy to package libs and
484 # related files just to the right package, without caring for the
485 # exact path the files are in.
486 # %mainlib package X from all dirs that belong to the main package
487 # %biarchlib package X from all dirs that belong to the -32/64bit package
488 %define mainlib() %{mainlibdir}/%1\
490 %define biarchlib() %{nil}
492 %if !%{separate_biarch}
493 %define mainlib() %{mainlibdir}/%1\
497 %define biarchlib() %{mainlibdirbi}/%1\
502 %define versmainlib() %{versmainlibdir}/%1\
504 %define versbiarchlib() %{nil}
506 %if !%{separate_biarch}
507 %define versmainlib() %{versmainlibdir}/%1\
508 %{versmainlibdirbi}/%1\
511 %define versbiarchlib() %{versmainlibdirbi}/%1\
519 %setup -q -n gcc-%{version}
521 # We are configuring ppc as ppc64 but with switched multilibs. Adjust
522 # the libstdc++ abi testsuite baseline files accordingly
524 if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
525 mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
526 mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt \
527 libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64/
528 mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt \
529 libstdc++-v3/config/abi/post/powerpc64-linux-gnu/
534 # Avoid rebuilding of generated files
535 contrib/gcc_update --touch
536 # Avoid fucking up testsuite results with Java and indirect dispatch
537 export LD_AS_NEEDED=0
538 # Split version file into version used for directories (X.Y) and
539 # version to report with --version (X.Y.Z).
540 # See also gcc-dir-version.patch.
541 # Also decrement the patchlevel version by one if possible and remove
542 # the 'prerelease' tagging in this case
543 if test `cat gcc/DEV-PHASE` == "prerelease"; then
544 if test `cat gcc/BASE-VER | cut -d '.' -f 3` != "0"; then
547 ( 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
549 mv gcc/BASE-VER gcc/FULL-VER
551 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
553 rm -rf obj-%{GCCDIST}
556 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'
557 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
559 # -mcpu is superceded by -mtune but -mtune is not supported by
560 # our bootstrap compiler. -mcpu gives a warning that stops
561 # the build process, so remove it for now. Also remove all other
562 # -march and -mtune flags. They are superseeded by proper
563 # default compiler settings now.
564 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'`
567 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
568 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
570 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
571 # Kill all -march/tune/cpu because that screws building the target libs
572 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
574 # Replace 2 spaces by one finally
575 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
579 languages=$languages,c++
582 languages=$languages,objc
585 languages=$languages,fortran
588 languages=$languages,obj-c++
591 languages=$languages,java
594 languages=$languages,ada
597 languages=$languages,go
601 if test -z "$J"; then
602 J=$(getconf _NPROCESSORS_CONF)
605 test 1 -gt "$J" && J=1
606 JL=$(($(getconf _NPROCESSORS_CONF)*2))
608 if test "$J" == "0"; then
611 if test "$JL" == "0"; then
614 PARALLEL="-j$J -l$JL"
616 # we don't want some miscompiles in the testsuite, or some fault in
617 # the compiler to kill the machine. Hence we limit the amount of memory
618 # by the physical RAM plus half of swap
619 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
620 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
621 #ulimit -v $(((MEM + SWAP/2)*1024))
623 # In general we want to ship release checking enabled compilers
624 # and run BETA with checking enabled.
625 #ENABLE_CHECKING="--enable-checking=yes"
626 ENABLE_CHECKING="--enable-checking=release"
628 # Work around tail/head -1 changes
629 export _POSIX2_VERSION=199209
632 # Using the host gnatmake like
633 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
634 # GNATMAKE="gnatmake%{hostsuffix}"
635 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
637 mkdir -p host-tools/bin
638 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
639 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
640 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
641 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
642 ln -sf /usr/%{_lib} host-tools/%{_lib}
643 export PATH="`pwd`/host-tools/bin:$PATH"
645 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
647 # --enable-threads=posix \
650 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
651 # temporary workaround for a miscompilation of hash functions in java code
652 GCJ_EXTRA_FLAGS="-marm"
655 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
656 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS $GCJ_EXTRA_FLAGS" \
658 --prefix=%{_prefix} \
659 --infodir=%{_infodir} \
660 --mandir=%{_mandir} \
661 --libdir=%{_libdir} \
662 --libexecdir=%{_libdir} \
663 --enable-languages=$languages \
665 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
668 --disable-bootstrap \
669 %if 0%{!?build_libvtv:1}
673 --with-bugurl="http://bugs.tizen.org/" \
674 --with-pkgversion="Tizen" \
675 %if !%{build_fortran}
676 --disable-libquadmath \
678 %if !%{build_libjava}
681 --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
682 --with-ecj-jar=%{libsubdir}/ecj.jar \
684 %if !%{biarch_libjava}
685 --disable-libjava-multilib \
688 --with-slibdir=/%{_lib} \
690 --enable-__cxa_atexit \
691 --enable-libstdcxx-allocator=new \
692 --disable-libstdcxx-pch \
693 --enable-version-specific-runtime-libs \
694 --enable-linker-build-id \
695 --enable-linux-futex \
696 --program-suffix=%{binsuffix} \
697 %if 0%{!?gcc_target_arch:1}
699 --with-system-libunwind \
701 --without-system-libunwind \
704 %if 0%{?gcc_target_arch:1}
705 --program-prefix=%{gcc_target_arch}- \
706 --target=%{gcc_target_arch} \
709 --with-sysroot=%sysroot \
711 --with-sysroot=%{_prefix}/%{gcc_target_arch} \
713 %if 0%{?build_sysroot:1}
714 --with-build-sysroot=%{build_sysroot} \
717 --with-build-sysroot=%{sysroot} \
719 --with-build-sysroot=%{_prefix}/%{gcc_target_arch} \
722 %if 0%{?canonical_target:1}
723 --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
725 %if "%{TARGET_ARCH}" == "spu"
726 --with-gxx-include-dir=%sysroot/include/c++/%{gcc_dir_version} \
730 %if "%{TARGET_ARCH}" == "armv5tel"
731 --with-arch=armv5te \
734 --with-abi=aapcs-linux \
735 --disable-sjlj-exceptions \
737 %if "%{TARGET_ARCH}" == "armv7l"
738 --with-arch=armv7-a \
739 --with-tune=cortex-a8 \
740 --with-float=softfp \
743 --disable-sjlj-exceptions \
745 %if "%{TARGET_ARCH}" == "armv7hl"
746 --with-arch=armv7-a \
747 --with-tune=cortex-a9 \
749 --with-abi=aapcs-linux \
750 --with-fpu=vfpv3-d16 \
751 --disable-sjlj-exceptions \
753 %if "%{TARGET_ARCH}" == "aarch64"
754 --with-arch=armv8-a \
755 --disable-sjlj-exceptions \
757 %if "%{TARGET_ARCH}" == "powerpc" || "%{TARGET_ARCH}" == "powerpc64"
758 %if "%{TARGET_ARCH}" == "powerpc"
759 --with-cpu=default32 \
761 %if "%{TARGET_ARCH}" == "powerpc64le"
764 --with-cpu-64=power4 \
767 --with-long-double-128 \
768 %if "%{TARGET_ARCH}" == "powerpc64le"
772 %if "%{TARGET_ARCH}" == "sparc64"
773 --with-cpu=ultrasparc \
774 --with-long-double-128 \
776 %if "%{TARGET_ARCH}" == "sparc"
778 --with-long-double-128 \
780 %if "%{TARGET_ARCH}" == "i586"
781 --with-arch-32=i586 \
782 --with-tune=generic \
784 %if "%{TARGET_ARCH}" == "x86_64"
785 --with-arch-32=i586 \
786 --with-tune=generic \
789 %if "%{TARGET_ARCH}" == "s390"
790 --with-tune=zEC12 --with-arch=z196 \
791 --with-long-double-128 \
792 --enable-decimal-float \
794 %if "%{TARGET_ARCH}" == "s390x"
795 --with-tune=zEC12 --with-arch=z196 \
796 --with-long-double-128 \
797 --enable-decimal-float \
799 %if "%{TARGET_ARCH}" == "m68k"
806 %if 0%{?building_libffi:1}
807 make stage1-bubble $PARALLEL
808 make all-target-libffi $PARALLEL
811 # Only run profiled bootstrap on archs where it works and matters
812 %ifarch ppc64le s390x
813 make profiledbootstrap STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
815 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
818 %if 0%{?building_libjava:1}
819 make -C %{GCCDIST}/libstdc++-v3/doc doc-html-doxygen
823 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
824 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
825 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
826 # asan needs a whole shadow address space
827 ulimit -v unlimited || true
828 make -k check $PARALLEL || true
830 ../contrib/test_summary | tee ../testresults/test_summary.txt
835 export NO_BRP_CHECK_BYTECODE_VERSION=true
837 # Work around tail/head -1 changes
838 export _POSIX2_VERSION=199209
839 export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
840 %if 0%{?building_libffi:1}
841 make -C %{GCCDIST}/libffi install DESTDIR=$RPM_BUILD_ROOT
843 %if 0%{?building_libjava:1}
844 make -C %{GCCDIST}/libjava install DESTDIR=$RPM_BUILD_ROOT
845 make -C gcc java.install-man DESTDIR=$RPM_BUILD_ROOT
846 make -C gcc java.install-common DESTDIR=$RPM_BUILD_ROOT
847 make -C gcc install-common DESTDIR=$RPM_BUILD_ROOT COMPILERS='jc1$(exeext) jvgenmain$(exeext)'
848 # copy the libstdc++ API reference
849 cp -r %{GCCDIST}/libstdc++-v3/doc/doxygen/html ../libstdc++-v3/doc/html/api
850 # install-common also installs collect2, gcov and the g++ and gfortran driver
852 rm $RPM_BUILD_ROOT%{_prefix}/bin/g++%{binsuffix}
855 rm $RPM_BUILD_ROOT%{_prefix}/bin/gfortran%{binsuffix}
857 rm $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{binsuffix}
858 rm $RPM_BUILD_ROOT%{libsubdir}/collect2
860 make install DESTDIR=$RPM_BUILD_ROOT
862 make -C gcc java.uninstall DESTDIR=$RPM_BUILD_ROOT
863 make -C gcc java.install-info DESTDIR=$RPM_BUILD_ROOT
864 rm $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump%{binsuffix}
865 rm $RPM_BUILD_ROOT%{_mandir}/man1/jcf-dump%{binsuffix}.1
866 rm $RPM_BUILD_ROOT%{libsubdir}/jc1
867 rm $RPM_BUILD_ROOT%{libsubdir}/jvgenmain
872 # Remove libffi installed files if we did not want to build it
873 %if !0%{?building_libffi:1}
874 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.*
876 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.*
878 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h
879 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h
880 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi%{binsuffix}.3*
881 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_call%{binsuffix}.3*
882 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif%{binsuffix}.3*
883 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif_var%{binsuffix}.3*
886 # Remove some useless .la files
887 for lib in libobjc libgfortran libgfortranbegin libquadmath libcaf_single \
888 libgomp libstdc++ libsupc++ libgcj-tools libgij libgo \
889 libasan libatomic libitm libtsan libcilkrts liblsan libubsan libvtv; do
890 rm -f $RPM_BUILD_ROOT%{versmainlibdir}/$lib.la
892 rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
896 mkdir -p $RPM_BUILD_ROOT%{_libdir}
898 %if %{build_primary_64bit}
899 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
901 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
907 mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
908 ln -sf %{_libdir}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
909 ln -sf %{_libdir}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnat.so
910 chmod a+x $RPM_BUILD_ROOT%{_libdir}/libgna*-*.so
912 mv $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/lib*-*.so $RPM_BUILD_ROOT%{mainlibdirbi}/
913 ln -sf %{mainlibdirbi}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
914 ln -sf %{mainlibdirbi}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
915 chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
919 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
921 # Remove some crap from the .la files:
922 for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
924 # -e '/^dependency_libs/s|%{libsubdir}/\([^.]*\)\.la |%{_libdir}/\1\.la |g'
925 sed -e '/^dependency_libs/s| -L%{_builddir}/[^ ]*||g' \
926 -e '/^dependency_libs/s| -L/usr/%{GCCDIST}/bin||g' \
927 -e '/^dependency_libs/s|-lm \(-lm \)*|-lm |' \
928 -e '/^dependency_libs/s|-L[^ ]* ||g' \
930 %if %{build_primary_64bit}
931 -e '/^libdir/s|%{_libdir}/32|%{_prefix}/lib|' \
932 -e '/^libdir/s|lib64/\.\./||' \
934 -e '/^libdir/s|%{_libdir}/64|%{_prefix}/lib64|' \
942 cp `find . -name "*.sum"` ../testresults/
943 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
944 chmod 644 ../testresults/*
946 # Remove files that we do not need to clean up filelist
947 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
948 rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
949 #rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
950 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/zutil.h
951 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/linux/a.out.h
952 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/asm-generic/socket.h
954 rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
955 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
958 %if 0%{?building_libjava:1}
959 # gcj -static doesn't work properly anyway, unless using --whole-archive
960 # let's save the space instead.
961 find $RPM_BUILD_ROOT -name libgcj.a \
962 -o -name libgcj-tools.a \
965 -o -name libgcj_bc.a \
968 find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
969 sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
971 # security files have broken install locations, also they cause conflicts
972 # between libgcj versions. Simply delete them here, libgcj will use its
973 # defaults in this case (which is what these files contain anyway).
974 rm -f $RPM_BUILD_ROOT%{libsubdir}/logging.properties
975 rm -r $RPM_BUILD_ROOT%{libsubdir}/security
978 %if 0%{?building_libffi:1}
979 # Move libffi headers, remove empty libffi libtool file
980 mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
981 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h $RPM_BUILD_ROOT%{_prefix}/include/
982 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h $RPM_BUILD_ROOT%{_prefix}/include/
983 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.la
985 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
987 # Generate a simple pkg-config file
988 mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
989 echo -e 'Name: libffi\nVersion: 3.0.9\nDescription: libffi\nLibs: -lffi' > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libffi.pc
993 %if !%{build_libjava}
994 rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
995 rm $RPM_BUILD_ROOT%{_mandir}/man1/gcj-dbtool%{binsuffix}.1
996 rm $RPM_BUILD_ROOT%{_mandir}/man1/gij%{binsuffix}.1
997 rm $RPM_BUILD_ROOT%{_mandir}/man1/grmic%{binsuffix}.1
998 rm $RPM_BUILD_ROOT%{_mandir}/man1/gc-analyze%{binsuffix}.1
999 rm $RPM_BUILD_ROOT%{_mandir}/man1/aot-compile%{binsuffix}.1
1000 rm $RPM_BUILD_ROOT%{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1
1002 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/aotcompile.py
1003 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/classfile.py
1005 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/fsf-funding.7
1006 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gfdl.7
1007 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gpl.7
1008 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
1010 %if %{build_primary_64bit}
1011 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
1013 rm -f $RPM_BUILD_ROOT%{_prefix}/lib64/libiberty.a
1016 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
1017 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
1019 # gccgo.info isn't properly versioned
1020 rm $RPM_BUILD_ROOT%{_infodir}/gccgo.info*
1025 %if 0%{?building_libffi:1}
1026 %files -n libffi%{libffi_sover}%{libffi_suffix}
1027 %defattr(-,root,root)
1028 %mainlib libffi.so.%{libffi_sover}*
1030 %if %{separate_biarch}
1031 %files -n libffi%{libffi_sover}%{libffi_suffix}%{separate_biarch_suffix}
1032 %defattr(-,root,root)
1033 %biarchlib libffi.so.%{libffi_sover}*
1036 %post -n libffi49-devel
1037 %install_info --info-dir=%{_infodir} %{_infodir}/libffi%{binsuffix}.info.gz
1038 %postun -n libffi49-devel
1039 %install_info_delete --info-dir=%{_infodir} %{_infodir}/libffi%{binsuffix}.info.gz
1041 %files -n libffi49-devel
1042 %defattr(-,root,root)
1043 %{_prefix}/include/ffi.h
1044 %{_prefix}/include/ffitarget.h
1047 %{_libdir}/pkgconfig/libffi.pc
1048 %doc %{_infodir}/libffi%{binsuffix}.info.gz
1049 %doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
1050 %doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
1051 %doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
1052 %doc %{_mandir}/man3/ffi_prep_cif_var%{binsuffix}.3.gz
1054 %if %{separate_biarch}
1055 %files -n libffi49-devel%{separate_biarch_suffix}
1056 %defattr(-,root,root)
1057 %biarchlib libffi.so
1065 %{_prefix}/bin/gccgo%{binsuffix}
1067 %versmainlib libgo.a
1068 %versmainlib libgo.so
1069 %versmainlib libgobegin.a
1071 %dir %mainlibdir/go/%{gcc_dir_version}
1072 %mainlibdir/go/%{gcc_dir_version}/%{GCCDIST}
1073 %doc %{_mandir}/man1/gccgo%{binsuffix}.1.gz
1075 %if %{separate_biarch}
1076 %files go%{separate_biarch_suffix}
1077 %versbiarchlib libgo.a
1078 %versbiarchlib libgo.so
1079 %versbiarchlib libgobegin.a
1080 %dir %mainlibdirbi/go
1081 %dir %mainlibdirbi/go/%{gcc_dir_version}
1082 %mainlibdirbi/go/%{gcc_dir_version}/%{GCCDIST}
1085 %files -n libgo%{libgo_sover}%{libgo_suffix}
1086 %defattr(-,root,root)
1087 %mainlib libgo.so.%{libgo_sover}*
1089 %if %{separate_biarch}
1090 %files -n libgo%{libgo_sover}%{libgo_suffix}%{separate_biarch_suffix}
1091 %defattr(-,root,root)
1092 %biarchlib libgo.so.%{libgo_sover}*
1096 %if 0%{?run_tests:1}
1097 %files -n gcc49-testresults
1098 %defattr(-,root,root)
1099 %doc testresults/test_summary.txt
1100 %doc testresults/*.sum
1101 %doc testresults/*.log