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 aarch64
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
42 %define build_fortran !0%{?building_libjava:1}%{?building_libffi:1}
43 %define build_objc !0%{?building_libjava:1}%{?building_libffi:1}
44 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
45 %define build_go !0%{?building_libjava:1}%{?building_libffi:1}
56 # For optional compilers only build C, C++ and Fortran
57 %if 0%{?build_optional_compiler_languages:1}
60 %define build_libjava 0
66 # Shared library SONAME versions
76 %define libgcj_sover %{nil}
77 %define libgcj_bc_sover %{nil}
78 %define libffi_sover %{nil}
79 %define libgomp_sover %{nil}
80 %define libstdcxx_sover %{nil}
81 %define libobjc_sover %{nil}
82 %define libgfortran_sover %{nil}
83 %define libquadmath_sover %{nil}
84 %define libasan_sover %{nil}
85 %define libtsan_sover %{nil}
86 %define libatomic_sover %{nil}
87 %define libitm_sover %{nil}
88 %define libubsan_sover %{nil}
89 %define liblsan_sover %{nil}
90 %define libvtv_sover %{nil}
91 %define libcilkrts_sover %{nil}
92 %define libgo_sover %{nil}
94 # Shared library package suffix
95 # This is used for the "non-standard" set of libraries, the standard
96 # being defined by %product_libs_gcc_ver, the GCC version that should
97 # provide un-suffixed shared library packages following the shared-library
98 # policy. Even suffixed variants should provide the shared-library policy
99 # mandated names and ensure they conflict with each other.
100 # Note that on SONAME changes of any library the %product_libs_gcc_ver
101 # define needs to be either split or the newest GCC version still providing
102 # the old SONAME needs to unconditionally produce an un-suffixed library
103 # if %product_libs_gcc_ver is newer than it. Similar the _oldest_ GCC
104 # version first providing a new SONAME needs to unconditionally produce
105 # an un-suffixed library if %product_libs_gcc_ver is lower that it.
106 %if %{!?product_libs_gcc_ver:49}%{?product_libs_gcc_ver} != 49
109 %define libgcc_s_suffix %{?pne:-gcc49}
110 # libgcj SONAME changes with every GCC version
111 %define libgcj_suffix %nil
112 %define libgcj_bc_suffix %{?pne:-gcc49}
113 %define libffi_suffix %{?pne:-gcc49}
114 %define libgomp_suffix %{?pne:-gcc49}
115 %define libstdcxx_suffix %{?pne:-gcc49}
116 %define libobjc_suffix %{?pne:-gcc49}
117 %define libgfortran_suffix %{?pne:-gcc49}
118 %define libquadmath_suffix %{?pne:-gcc49}
119 %define libasan_suffix %{?pne:-gcc49}
120 %define libtsan_suffix %{?pne:-gcc49}
121 %define libatomic_suffix %{?pne:-gcc49}
122 %define libitm_suffix %{?pne:-gcc49}
125 %define libubsan_suffix %{?pne:-gcc49}
126 %define liblsan_suffix %{?pne:-gcc49}
127 %define libvtv_suffix %{?pne:-gcc49}
128 %define libcilkrts_suffix %{?pne:-gcc49}
129 %define libgo_suffix %{?pne:-gcc49}
131 %define selfconflict() %1
134 # With generated files in src we could drop the following
137 BuildRequires: gettext-devel
138 BuildRequires: makeinfo
139 # until here, but at least renaming and patching info files breaks this
140 BuildRequires: gcc-c++
141 BuildRequires: glibc-devel
142 BuildRequires: mpc-devel
143 BuildRequires: mpfr-devel
145 BuildRequires: zlib-devel
146 %ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm aarch64
147 BuildRequires: cloog-isl-devel
148 BuildRequires: isl-devel
151 %define hostsuffix -4.9
152 BuildRequires: gcc49-ada
154 %if 0%{?building_libjava:1}%{?building_testsuite:1}
155 BuildRequires: fastjar
157 %if 0%{?building_libffi:1}
158 BuildRequires: pkg-config
161 BuildRequires: libunwind-devel
164 BuildRequires: dejagnu
165 BuildRequires: expect
169 %define separate_bi32 0
170 %define separate_bi64 0
172 # Beware, this does _not_ separate libgcj, as for that one multilibing
173 # is inactive for the time being
174 %define separate_bi64 1
176 %ifarch x86_64 s390x ppc64 sparc64
177 %define separate_bi32 1
180 # Define two macros to trigger -32bit or -64bit package variants
181 %define separate_biarch 0
183 %define separate_biarch 1
184 %define separate_biarch_suffix -32bit
187 %define separate_biarch 1
188 %define separate_biarch_suffix -64bit
191 %ifarch x86_64 ia64 s390x alpha ppc64 sparc64 aarch64
192 # 64-bit is primary build target
193 %define build_primary_64bit 1
195 %define build_primary_64bit 0
198 %define biarch_libjava 0
200 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
202 URL: http://gcc.gnu.org/
205 %define gcc_dir_version 4.9
206 %define binsuffix -4.9
208 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
209 Requires: binutils glibc-devel
210 Requires: cpp49 = %{version}-%{release}
211 Requires: libgcc_s%{libgcc_s} >= %{version}-%{release}
212 Requires: libgomp%{libgomp_sover} >= %{version}-%{release}
214 Requires: libasan%{libasan_sover} >= %{version}-%{release}
217 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
220 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
223 Requires: libitm%{libitm_sover} >= %{version}-%{release}
225 %ifarch %cilkrts_arch
226 Requires: libcilkrts%{libcilkrts_sover} >= %{version}-%{release}
229 Requires: liblsan%{liblsan_sover} >= %{version}-%{release}
232 Requires: libubsan%{libubsan_sover} >= %{version}-%{release}
235 Requires: libvtv%{libvtv_sover} >= %{version}-%{release}
237 Suggests: gcc49-info gcc49-locale
240 BuildRoot: %{_tmppath}/%{name}-%{version}-build
241 Source: gcc-%{version}.tar.bz2
243 Source2: libffi49-rpmlintrc
244 Source3: gcc49-rpmlintrc
246 Source5: baselibs.conf
247 Source6: libgcj49-rpmlintrc
249 Group: Development/Building
250 Summary: The GNU C Compiler and Support Files
254 Core package for the GNU Compiler Collection, including the C language
257 Language frontends other than C are split to different sub-packages,
258 namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
260 %package -n libffi%{libffi_sover}%{libffi_suffix}
261 Summary: Foreign Function Interface library
262 License: BSD-3-Clause
263 Group: Development/Building
264 Provides: libffi%{libffi_sover} = %{version}-%{release}
266 %description -n libffi%{libffi_sover}%{libffi_suffix}
267 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.
269 %post -n libffi%{libffi_sover}%{libffi_suffix} -p /sbin/ldconfig
271 %postun -n libffi%{libffi_sover}%{libffi_suffix} -p /sbin/ldconfig
272 %package -n libffi%{libffi_sover}%{libffi_suffix}-32bit
273 Summary: Foreign Function Interface library
274 License: BSD-3-Clause
275 Group: Development/Building
276 Provides: libffi%{libffi_sover}-32bit = %{version}-%{release}
278 %description -n libffi%{libffi_sover}%{libffi_suffix}-32bit
279 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.
281 %post -n libffi%{libffi_sover}%{libffi_suffix}-32bit -p /sbin/ldconfig
283 %postun -n libffi%{libffi_sover}%{libffi_suffix}-32bit -p /sbin/ldconfig
284 %package -n libffi%{libffi_sover}%{libffi_suffix}-64bit
285 Summary: Foreign Function Interface library
286 License: BSD-3-Clause
287 Group: Development/Building
288 Provides: libffi%{libffi_sover}-64bit = %{version}-%{release}
290 %description -n libffi%{libffi_sover}%{libffi_suffix}-64bit
291 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.
293 %post -n libffi%{libffi_sover}%{libffi_suffix}-64bit -p /sbin/ldconfig
295 %postun -n libffi%{libffi_sover}%{libffi_suffix}-64bit -p /sbin/ldconfig
297 %package -n libffi49-devel
298 Summary: Foreign Function Interface library development files
299 License: BSD 3-Clause
300 Group: Development/Building
301 Requires: libffi%{libffi_sover} >= %{version}-%{release}
302 Provides: libffi-devel = %{version}-%{release}
304 %description -n libffi49-devel
305 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.
306 %package -n libffi49-devel-32bit
307 Summary: Foreign Function Interface library development files
308 License: BSD 3-Clause
309 Group: Development/Building
310 Requires: libffi%{libffi_sover}-32bit >= %{version}-%{release}
311 Provides: libffi-devel-32bit = %{version}-%{release}
313 %description -n libffi49-devel-32bit
314 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.
315 %package -n libffi49-devel-64bit
316 Summary: Foreign Function Interface library development files
317 License: BSD 3-Clause
318 Group: Development/Building
319 Requires: libffi%{libffi_sover}-64bit >= %{version}-%{release}
320 Provides: libffi-devel-64bit = %{version}-%{release}
322 %description -n libffi49-devel-64bit
323 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.
326 Summary: GNU Go Compiler
328 Group: Development/Languages
329 Requires: gcc49 = %{version}-%{release}
330 Requires: libgo%{libgo_sover} >= %{version}-%{release}
333 This package contains a Go compiler and associated development
334 files based on the GNU GCC technology.
336 Summary: GNU Go Compiler
338 Group: Development/Languages
339 Requires: gcc49-32bit = %{version}-%{release}
340 Requires: libgo%{libgo_sover}-32bit >= %{version}-%{release}
342 %description go-32bit
343 This package contains a Go compiler and associated development
344 files based on the GNU GCC technology.
346 Summary: GNU Go Compiler
348 Group: Development/Languages
349 Requires: gcc49-64bit = %{version}-%{release}
350 Requires: libgo%{libgo_sover}-64bit >= %{version}-%{release}
352 %description go-64bit
353 This package contains a Go compiler and associated development
354 files based on the GNU GCC technology.
356 %package -n libgo%{libgo_sover}%{libgo_suffix}
357 Summary: GNU Go compiler runtime library
358 License: BSD-3-Clause
359 Group: Development/Languages
360 Provides: libgo%{libgo_sover} = %{version}-%{release}
362 %description -n libgo%{libgo_sover}%{libgo_suffix}
363 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.
365 %post -n libgo%{libgo_sover}%{libgo_suffix} -p /sbin/ldconfig
367 %postun -n libgo%{libgo_sover}%{libgo_suffix} -p /sbin/ldconfig
368 %package -n libgo%{libgo_sover}%{libgo_suffix}-32bit
369 Summary: GNU Go compiler runtime library
370 License: BSD-3-Clause
371 Group: Development/Languages
372 Provides: libgo%{libgo_sover}-32bit = %{version}-%{release}
374 %description -n libgo%{libgo_sover}%{libgo_suffix}-32bit
375 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.
377 %post -n libgo%{libgo_sover}%{libgo_suffix}-32bit -p /sbin/ldconfig
379 %postun -n libgo%{libgo_sover}%{libgo_suffix}-32bit -p /sbin/ldconfig
380 %package -n libgo%{libgo_sover}%{libgo_suffix}-64bit
381 Summary: GNU Go compiler runtime library
382 License: BSD-3-Clause
383 Group: Development/Languages
384 Provides: libgo%{libgo_sover}-64bit = %{version}-%{release}
386 %description -n libgo%{libgo_sover}%{libgo_suffix}-64bit
387 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.
389 %post -n libgo%{libgo_sover}%{libgo_suffix}-64bit -p /sbin/ldconfig
391 %postun -n libgo%{libgo_sover}%{libgo_suffix}-64bit -p /sbin/ldconfig
394 %package -n gcc49-testresults
395 Summary: Testsuite results
396 License: SUSE-Public-Domain
397 Group: Development/Languages
399 %description -n gcc49-testresults
400 Results from running the gcc and target library testsuites.
405 # Define the canonical target and host architecture
406 # %gcc_target_arch is supposed to be the full target triple
407 # %TARGET_ARCH is the canonicalized CPU part
408 # %CONFIGURE_TARGET is the target triple used for --target=
409 %if 0%{?gcc_target_arch:1}
410 %define CONFIGURE_TARGET %{gcc_target_arch}
411 %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/;")
412 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
413 %define CONFIGURE_TARGET powerpc64-tizen-linux
415 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
416 %define CONFIGURE_TARGET powerpc64-tizen-linux
418 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
419 %define CONFIGURE_TARGET i586-tizen-linux
421 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "aarch64"
422 %define CONFIGURE_TARGET aarch64-tizen-linux
424 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
425 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
427 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
428 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
430 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
431 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
434 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
436 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
438 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
440 %define GCCDIST powerpc64-tizen-linux
443 %define GCCDIST sparc64-tizen-linux
446 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
448 %define GCCDIST %{HOST_ARCH}-tizen-linux
453 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
454 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
457 # Versionspecific directories
458 %define versmainlibdir %{libsubdir}
459 %define versmainlibdirbi32 %{libsubdir}/32
460 %define versmainlibdirbi64 %{libsubdir}/64
462 %define versmainlibdirbi32 %{libsubdir}
463 %define versmainlibdirbi64 %{libsubdir}/64
465 %if %{build_primary_64bit}
466 %define versmainlibdirbi %{versmainlibdirbi32}
468 %define versmainlibdirbi %{versmainlibdirbi64}
471 %define mainlibdir %{_libdir}
472 %define mainlibdirbi32 %{_prefix}/lib
473 %define mainlibdirbi64 %{_prefix}/lib64
474 %if %{build_primary_64bit}
475 %define mainlibdirbi %{mainlibdirbi32}
477 %define mainlibdirbi %{mainlibdirbi64}
481 # Now define a few macros that make it easy to package libs and
482 # related files just to the right package, without caring for the
483 # exact path the files are in.
484 # %mainlib package X from all dirs that belong to the main package
485 # %biarchlib package X from all dirs that belong to the -32/64bit package
486 %define mainlib() %{mainlibdir}/%1\
488 %define biarchlib() %{nil}
490 %if !%{separate_biarch}
491 %define mainlib() %{mainlibdir}/%1\
495 %define biarchlib() %{mainlibdirbi}/%1\
500 %define versmainlib() %{versmainlibdir}/%1\
502 %define versbiarchlib() %{nil}
504 %if !%{separate_biarch}
505 %define versmainlib() %{versmainlibdir}/%1\
506 %{versmainlibdirbi}/%1\
509 %define versbiarchlib() %{versmainlibdirbi}/%1\
517 %setup -q -n gcc-%{version}
519 # We are configuring ppc as ppc64 but with switched multilibs. Adjust
520 # the libstdc++ abi testsuite baseline files accordingly
522 if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
523 mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
524 mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt \
525 libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64/
526 mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt \
527 libstdc++-v3/config/abi/post/powerpc64-linux-gnu/
532 # Avoid rebuilding of generated files
533 contrib/gcc_update --touch
534 # Avoid fucking up testsuite results with Java and indirect dispatch
536 # Split version file into version used for directories (X.Y) and
537 # version to report with --version (X.Y.Z).
538 # See also gcc-dir-version.patch.
539 # Also decrement the patchlevel version by one if possible and remove
540 # the 'prerelease' tagging in this case
541 if test `cat gcc/DEV-PHASE` == "prerelease"; then
542 if test `cat gcc/BASE-VER | cut -d '.' -f 3` != "0"; then
545 ( 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
547 mv gcc/BASE-VER gcc/FULL-VER
549 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
551 rm -rf obj-%{GCCDIST}
554 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
555 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'`
557 # -mcpu is superceded by -mtune but -mtune is not supported by
558 # our bootstrap compiler. -mcpu gives a warning that stops
559 # the build process, so remove it for now. Also remove all other
560 # -march and -mtune flags. They are superseeded by proper
561 # default compiler settings now.
562 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'`
565 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
566 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
568 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
569 # Kill all -march/tune/cpu because that screws building the target libs
570 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
572 # Replace 2 spaces by one finally
573 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
577 languages=$languages,c++
580 languages=$languages,objc
583 languages=$languages,fortran
586 languages=$languages,obj-c++
589 languages=$languages,java
592 languages=$languages,ada
595 languages=$languages,go
599 if test -z "$J"; then
600 J=$(getconf _NPROCESSORS_CONF)
603 test 1 -gt "$J" && J=1
604 JL=$(($(getconf _NPROCESSORS_CONF)*2))
606 if test "$J" == "0"; then
609 if test "$JL" == "0"; then
612 PARALLEL="-j$J -l$JL"
614 # we don't want some miscompiles in the testsuite, or some fault in
615 # the compiler to kill the machine. Hence we limit the amount of memory
616 # by the physical RAM plus half of swap
617 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
618 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
619 #ulimit -v $(((MEM + SWAP/2)*1024))
621 # In general we want to ship release checking enabled compilers
622 # and run BETA with checking enabled.
623 #ENABLE_CHECKING="--enable-checking=yes"
624 ENABLE_CHECKING="--enable-checking=release"
626 # Work around tail/head -1 changes
627 export _POSIX2_VERSION=199209
630 # Using the host gnatmake like
631 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
632 # GNATMAKE="gnatmake%{hostsuffix}"
633 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
635 mkdir -p host-tools/bin
636 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
637 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
638 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
639 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
640 ln -sf /usr/%{_lib} host-tools/%{_lib}
641 export PATH="`pwd`/host-tools/bin:$PATH"
643 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
645 # --enable-threads=posix \
648 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
649 # temporary workaround for a miscompilation of hash functions in java code
650 GCJ_EXTRA_FLAGS="-marm"
653 export RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed -e "s/ -Wp,-D_FORTIFY_SOURCE=2 / /g"`"
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 --disable-bootstrap \
664 --enable-languages=$languages \
666 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
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 x86_64 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