1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
6 # Configure build to compile with cloog and ppl.
13 maintainer = Michael Tremer <michael.tremer@ipfire.org>
14 groups = Development/Compilers
15 url = http://gcc.gnu.org/
16 license = GPLv3+ and GPLv2+ with exceptions
17 summary = Various compilers (C, C++, Objective-C, Java, ...).
20 The gcc package contains the GNU Compiler Collection. \
21 You'll need this package in order to compile C code.
24 # This is the at least required version of binutils.
25 required_binutils_version = 2.21.51.0.8-1
27 source_dl = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
28 sources = %{thisapp}.tar.gz
32 gcc46-c++-builtin-redecl.patch0 \
33 gcc46-pr33763.patch0 \
34 gcc46-libgomp-omp_h-multilib.patch0 \
35 gcc46-libtool-no-rpath.patch0 \
36 gcc46-cloog-dl.patch0 \
37 gcc46-pr38757.patch0 \
38 gcc46-no-add-needed.patch0 \
39 gcc46-unwind-debughook-sdt.patch0 \
40 gcc46-ppl-0.10.patch \
41 gcc46-Woverlength-string.patch0 \
42 gcc46-Woverlength-string-asm.patch0 \
43 gcc-4.6.0-piepatches-20110407.patch
48 binutils>=%{required_binutils_version}
62 # If cloog support is enabled, we require the devel packages for build.
63 if "%{build_cloog_ppl}" == "1"
64 requires += cloog-ppl-devel ppl-devel
67 # Build libquadmath (only on x86).
70 # A couple of configure arguments depending on the architecture and
74 if "%{DISTRO_ARCH}" == "x86_64"
75 configure_options = --disable-multilib
80 if "%{DISTRO_ARCH}" == "i686"
81 configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
86 if "%{DISTRO_ARCH}" == "armv5tel"
87 configure_options += --disable-sjlj-exceptions
89 configure_options += --with-float=soft
92 if "${DISTRO_ARCH}" == "armv7hl"
93 configure_options += --disable-sjlj-exceptions
95 configure_options += \
96 --with-cpu=cortex-a8 \
97 --with-tune=cortex-a8 \
100 --with-fpu=vfpv3-d16 \
101 --with-abi=aapcs-linux
104 if "%{build_cloog_ppl}" == "1"
105 configure_options += --with-cloog --with-ppl
108 # CFLAGS for hardening.
109 HARD_CFLAGS = -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW
112 mkdir -v %{DIR_SRC}/gcc-build
114 # Remove unneeded features that will save some compile time
115 rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp}
117 # Apply a sed substitution that will suppress the installation of
118 # libiberty.a. The version of libiberty.a provided by Binutils will be used
120 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
123 echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE
125 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
126 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
127 sed -e "s/-Werror//" -i libgomp/configure
129 # The fixincludes script is known to occasionally erroneously attempt to
130 # "fix" the system headers installed so far. As the headers up to this point
131 # are known to not require fixing, issue the following command to prevent
132 # the fixincludes script from running:
133 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
135 sed -i gcc/Makefile.in \
136 -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
138 # we want to be able to control the pie patch logic via something other
140 sed -i gcc/Makefile.in \
141 -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
142 -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |'
144 # Enable the GCC hardening by default.
145 sed -i gcc/Makefile.in \
146 -e "s|^HARD_CFLAGS = |HARD_CFLAGS = %{HARD_CFLAGS} |"
148 # Compile the compiler with -fPIC as well.
149 sed -i gcc/Makefile.in \
150 -e "s|^ESP_NOPIE_CFLAGS = .*|ESP_NOPIE_CFLAGS =|"
152 # Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2
153 sed -i gcc/common.opt \
154 -e '/UInteger Var(dwarf_version)/s/Init(2)/Init(4)/' \
155 -e '/flag_debug_types_section/s/Init(1)/Init(0)/' \
156 -e '/dwarf_record_gcc_switches/s/Init(0)/Init(1)/' \
157 -e 's/\(may be either 2, 3 or 4; the default version is \)2\./\14./'
159 ./contrib/gcc_update --touch
163 cd %{DIR_SRC}/gcc-build
167 CFLAGS=$(echo ${CFLAGS} | sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g')
168 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
169 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-march=i.86//g')
170 CFLAGS=$(echo ${CFLAGS} | sed -e 's/ -pipe / /g')
171 CFLAGS=$(echo "${CFLAGS}" | sed -e 's/[[:blank:]]\+/ /g')
172 CXXFLAGS=$(echo ${CFLAGS} | sed -e 's/ -Wall//g')
175 CXXFLAGS="${CXXFLAGS}" \
176 XCFLAGS="${CFLAGS}" \
177 TCFLAGS="${CFLAGS}" \
178 ../%{thisapp}/configure \
179 --build=%{DISTRO_BUILDTARGET} \
181 --libexecdir=/usr/lib \
182 --mandir=/usr/share/man \
185 --enable-threads=posix \
186 --enable-__cxa_atexit \
187 --enable-clocale=gnu \
188 --enable-languages=c,c++,lto \
190 --enable-checking=release \
195 --with-bugurl=http://bugtracker.ipfire.org \
196 --disable-libunwind-exceptions \
197 --enable-gnu-unique-object \
198 --enable-linker-build-id \
201 # GCC does not support a parallel build.
202 make profiledbootstrap BOOT_CFLAGS="${CFLAGS}"
206 # cd %{DIR_SRC}/gcc-build && make check
207 # cd %{DIR_APP} && ./contrib/test_summary
211 cd %{DIR_SRC}/gcc-build
212 make install DESTDIR=%{BUILDROOT}
214 # Check if the installation path exists.
215 FULLPATH="%{BUILDROOT}/usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}"
216 [ -d "${FULLPATH}" ] || exit 1
218 mkdir -pv %{BUILDROOT}/lib
219 ln -sfv ../usr/bin/cpp %{BUILDROOT}/lib/cpp
220 ln -sfv gcc %{BUILDROOT}/usr/bin/cc
222 # Move libgcc_s to /lib
223 mv -vf %{BUILDROOT}/usr/lib/libgcc_s.so.1 %{BUILDROOT}/lib/
224 ln -svf ../../lib/libgcc_s.so.1 %{BUILDROOT}/usr/lib/libgcc_s.so
226 # Remove some GNU debugger stuff.
227 rm -vf %{BUILDROOT}/usr/lib/lib*.py
230 mv -vf %{BUILDROOT}/usr/lib/libgomp.spec ${FULLPATH}/
231 ln -svf ../../../libgomp.so.1.0.0 ${FULLPATH}/libgomp.so
232 chmod 755 %{BUILDROOT}/usr/lib/libgomp.so.1.*
235 ln -svf ../../../libstdc++.so.6.0.16 ${FULLPATH}/libstdc++.so
238 ln -svf ../../../libmudflap.so.0.0.0 ${FULLPATH}/libmudflap.so
239 ln -svf ../../../libmudflapth.so.0.0.0 ${FULLPATH}/libmudflapth.so
240 chmod 755 %{BUILDROOT}/usr/lib/libmudflap{,th}.so.0.*
243 if [ "%{build_libquadmath}" = "1" ]; then
244 ln -svf ../../../libquadmath.so.0.* ${FULLPATH}/libquadmath.so
245 chmod 755 %{BUILDROOT}/usr/lib/libquadmath.so.0.*
250 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc.a
251 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc_eh.a
260 binutils>=%{required_binutils_version}
268 if "%{build_cloog_ppl}" == "1"
269 requires += cloog-ppl>=0.15
274 summary = C++ support for GCC.
276 This package adds C++ support to the GNU Compiler Collection.
277 It includes support for most of the current C++ specification,
278 including templates and exception handling.
284 libstdc++-devel=%{thisver}
289 /usr/lib/gcc/*/*/cc1plus
290 /usr/share/man/man*/*++*
295 summary = The C Preprocessor.
297 Cpp is the GNU C-Compatible Compiler Preprocessor.
298 Cpp is a macro processor which is used automatically
299 by the C compiler to transform your program before actual
300 compilation. It is called a macro processor because it allows
301 you to define macros, abbreviations for longer
304 The C preprocessor provides four separate functionalities: the
305 inclusion of header files (files of declarations that can be
306 substituted into your program); macro expansion (you can define macros,
307 and the C preprocessor will replace the macros with their definitions
308 throughout the program); conditional compilation (using special
309 preprocessing directives, you can include or exclude parts of the
310 program according to various conditions); and line control (if you use
311 a program to combine or rearrange source files into an intermediate
312 file which is then compiled, you can use line control to inform the
313 compiler about where each source line originated).
315 You should install this package if you are a C programmer and you use
318 group = Development/Languages
323 /usr/share/man/man1/cpp.1*
324 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/cc1
329 summary = GCC shared support library.
331 This package contains GCC shared support library which is needed
332 e.g. for exception handling support.
341 summary = GNU Standard C++ Library.
343 The libstdc++ package contains a rewritten standard compliant GCC Standard
348 /usr/lib/libstdc++*.so.*
352 package libstdc++-devel
353 summary = Header files and libraries for C++ development.
355 This is the GNU implementation of the standard C++ libraries. This
356 package includes the header files and libraries needed for C++
357 development. This includes rewritten implementation of STL.
366 /usr/lib/libstdc++*.so
371 summary = GCC OpenMP v3.0 shared support library.
373 This package contains GCC shared support library which is needed
374 for OpenMP v3.0 support.
378 /usr/lib/libgomp*.so.*
383 summary = GCC mudflap shared support library.
385 This package contains GCC shared support library which is needed
390 /usr/lib/libmudflap*.so.*
394 package libmudflap-devel
395 summary = Development files for GCC mudflap support.
397 This package contains headers for building mudflap-instrumented programs.
399 To instrument a non-threaded program, add -fmudflap
400 option to GCC and when linking add -lmudflap, for threaded programs
401 also add -fmudflapth and -lmudflapth.
405 libmudflap=%{thisver}
409 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/mf-runtime.h
410 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflap.so
411 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflapth.so
415 if "%{build_libquadmath}" == "1"
417 summary = GCC __float128 shared support library.
419 This package contains GCC shared support library which is needed
420 for __float128 math support and for Fortran REAL*16 support.
424 /usr/lib/libquadmath*.so.*
428 package libquadmath-devel
429 summary = Development files for GCC __float128 support.
431 This package contains headers for building Fortran programs using
432 REAL*16 and programs using __float128 math.
437 libquadmath=%{thisver}
441 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath.h
442 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath_weak.h
443 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libquadmath.so
448 package gcc-plugin-devel
449 summary = Support for compiling GCC plugins.
451 This package contains header files and other support files
452 for compiling GCC plugins. The GCC plugin ABI is currently
453 not stable, so plugins must be rebuilt any time GCC is updated.
464 /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/plugin
468 package %{name}-debuginfo