]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - gcc/gcc.nm
gcc: Do no profiled bootstrap on armv7hl either.
[people/ms/ipfire-3.x.git] / gcc / gcc.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 # Configure build to compile with cloog and ppl.
7 build_cloog_ppl = 1
8
9 name = gcc
10 version = 4.6.2
11 release = 10
12
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, ...).
18
19 description
20 The gcc package contains the GNU Compiler Collection. \
21 You'll need this package in order to compile C code.
22 end
23
24 # This is the at least required version of binutils.
25 required_binutils_version = 2.21.51.0.8-1
26
27 source_dl = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
28 sources = %{thisapp}.tar.gz
29
30 patches = \
31 gcc46-hack.patch0 \
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
44
45 build
46 requires
47 autogen
48 binutils>=%{required_binutils_version}
49 dejagnu
50 elfutils-devel
51 expect
52 flex
53 glibc-devel
54 gmp-devel
55 libffi-devel
56 libmpc-devel
57 mpfr-devel
58 texinfo
59 zlib-devel
60 end
61
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
65 end
66
67 # Build libquadmath (only on x86).
68 build_libquadmath = 0
69
70 # A couple of configure arguments depending on the architecture and
71 # configuration.
72 configure_options =
73
74 make_bootstrap = profiledbootstrap
75
76 if "%{DISTRO_ARCH}" == "x86_64"
77 configure_options = --disable-multilib
78
79 build_libquadmath = 1
80 end
81
82 if "%{DISTRO_ARCH}" == "i686"
83 configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
84
85 build_libquadmath = 1
86 end
87
88 if "%{DISTRO_ARCH}" == "armv5tel"
89 make_bootstrap = bootstrap
90
91 configure_options += --disable-sjlj-exceptions
92 configure_options += --with-float=soft
93 end
94
95 if "${DISTRO_ARCH}" == "armv7hl"
96 make_bootstrap = bootstrap
97
98 configure_options += --disable-sjlj-exceptions
99
100 configure_options += \
101 --with-cpu=cortex-a8 \
102 --with-tune=cortex-a8 \
103 --with-arch=armv7-a \
104 --with-float=hard \
105 --with-fpu=vfpv3-d16 \
106 --with-abi=aapcs-linux
107 end
108
109 if "%{build_cloog_ppl}" == "1"
110 configure_options += --with-cloog --with-ppl
111 end
112
113 # CFLAGS for hardening.
114 HARD_CFLAGS = -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW
115
116 prepare_cmds
117 mkdir -v %{DIR_SRC}/gcc-build
118
119 # Remove unneeded features that will save some compile time
120 rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp}
121
122 # Apply a sed substitution that will suppress the installation of
123 # libiberty.a. The version of libiberty.a provided by Binutils will be used
124 # instead:
125 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
126
127 # Branding gcc
128 echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE
129
130 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
131 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
132 sed -e "s/-Werror//" -i libgomp/configure
133
134 # The fixincludes script is known to occasionally erroneously attempt to
135 # "fix" the system headers installed so far. As the headers up to this point
136 # are known to not require fixing, issue the following command to prevent
137 # the fixincludes script from running:
138 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
139
140 sed -i gcc/Makefile.in \
141 -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
142
143 # we want to be able to control the pie patch logic via something other
144 # than ALL_CFLAGS...
145 sed -i gcc/Makefile.in \
146 -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
147 -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |'
148
149 # Enable the GCC hardening by default.
150 sed -i gcc/Makefile.in \
151 -e "s|^HARD_CFLAGS = |HARD_CFLAGS = %{HARD_CFLAGS} |"
152
153 # Compile the compiler with -fPIC as well.
154 sed -i gcc/Makefile.in \
155 -e "s|^ESP_NOPIE_CFLAGS = .*|ESP_NOPIE_CFLAGS =|"
156
157 # Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2
158 sed -i gcc/common.opt \
159 -e '/UInteger Var(dwarf_version)/s/Init(2)/Init(4)/' \
160 -e '/flag_debug_types_section/s/Init(1)/Init(0)/' \
161 -e '/dwarf_record_gcc_switches/s/Init(0)/Init(1)/' \
162 -e 's/\(may be either 2, 3 or 4; the default version is \)2\./\14./'
163
164 ./contrib/gcc_update --touch
165 end
166
167 build
168 cd %{DIR_SRC}/gcc-build
169
170 # Modify CFLAGS
171 CFLAGS="%{CFLAGS}"
172 CFLAGS=$(echo ${CFLAGS} | sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g')
173 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
174 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-march=i.86//g')
175 CFLAGS=$(echo ${CFLAGS} | sed -e 's/ -pipe / /g')
176 CFLAGS=$(echo "${CFLAGS}" | sed -e 's/[[:blank:]]\+/ /g')
177 CXXFLAGS=$(echo ${CFLAGS} | sed -e 's/ -Wall//g')
178
179 CFLAGS="${CFLAGS}" \
180 CXXFLAGS="${CXXFLAGS}" \
181 XCFLAGS="${CFLAGS}" \
182 TCFLAGS="${CFLAGS}" \
183 ../%{thisapp}/configure \
184 --build=%{DISTRO_BUILDTARGET} \
185 --prefix=/usr \
186 --libdir=%{libdir} \
187 --libexecdir=%{libdir} \
188 --mandir=/usr/share/man \
189 --enable-esp \
190 --enable-shared \
191 --enable-threads=posix \
192 --enable-__cxa_atexit \
193 --enable-clocale=gnu \
194 --enable-languages=c,c++,lto \
195 --enable-bootstrap \
196 --enable-checking=release \
197 --disable-werror \
198 --disable-libssp \
199 --disable-static \
200 --with-system-zlib \
201 --with-bugurl=http://bugtracker.ipfire.org \
202 --disable-libunwind-exceptions \
203 --enable-gnu-unique-object \
204 --enable-linker-build-id \
205 %{configure_options}
206
207 # GCC does not support a parallel build.
208 make %{make_bootstrap} BOOT_CFLAGS="${CFLAGS}"
209 end
210
211 #test
212 # cd %{DIR_SRC}/gcc-build && make check
213 # cd %{DIR_APP} && ./contrib/test_summary
214 #end
215
216 install
217 cd %{DIR_SRC}/gcc-build
218 make install DESTDIR=%{BUILDROOT}
219
220 # Check if the installation path exists.
221 FULLPATH="%{BUILDROOT}%{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}"
222 [ -d "${FULLPATH}" ] || exit 1
223
224 mkdir -pv %{BUILDROOT}/%{lib}
225 ln -sfv ../usr/bin/cpp %{BUILDROOT}/%{lib}/cpp
226 ln -sfv gcc %{BUILDROOT}/usr/bin/cc
227
228 # Move libgcc_s to /lib
229 rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}%{libdir}/libgcc_s.so
230 mkdir -pv %{BUILDROOT}/%{lib}
231 mv -vf %{BUILDROOT}%{libdir}/libgcc_s.so.1 %{BUILDROOT}/%{lib}/
232 case "%{DISTRO_ARCH}" in
233 arm*)
234 cat <<EOF >${FULLPATH}/libgcc_s.so
235 /* GNU ld script
236 Use the shared library, but some functions are only in
237 the static library, so try that secondarily. */
238 OUTPUT_FORMAT(elf32-littlearm)
239 GROUP ( /%{lib}/libgcc_s.so.1 libgcc.a )
240 EOF
241 ;;
242 *)
243 ln -svf ../../../../../%{lib}/libgcc_s.so.1 ${FULLPATH}/libgcc_s.so
244 ;;
245 esac
246
247 # Remove some GNU debugger stuff.
248 rm -vf %{BUILDROOT}%{libdir}/lib*.py
249
250 # libgomp
251 mv -vf %{BUILDROOT}%{libdir}/libgomp.spec ${FULLPATH}/
252 ln -svf ../../../libgomp.so.1.0.0 ${FULLPATH}/libgomp.so
253 chmod 755 %{BUILDROOT}%{libdir}/libgomp.so.1.*
254
255 # libstdc++
256 ln -svf ../../../libstdc++.so.6.0.16 ${FULLPATH}/libstdc++.so
257
258 # libmudflap
259 ln -svf ../../../libmudflap.so.0.0.0 ${FULLPATH}/libmudflap.so
260 ln -svf ../../../libmudflapth.so.0.0.0 ${FULLPATH}/libmudflapth.so
261 chmod 755 %{BUILDROOT}%{libdir}/libmudflap{,th}.so.0.*
262
263 # libquadmath
264 if [ "%{build_libquadmath}" = "1" ]; then
265 ln -svf ../../../libquadmath.so.0.0.0 ${FULLPATH}/libquadmath.so
266 chmod 755 %{BUILDROOT}%{libdir}/libquadmath.so.0.*
267 fi
268 end
269
270 keep_libraries
271 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc.a
272 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc_eh.a
273 end
274 end
275
276 packages
277 package %{name}
278 groups += Build
279
280 requires
281 binutils>=%{required_binutils_version}
282 glibc-devel
283 gmp-devel
284 cpp=%{thisver}
285 libgcc=%{thisver}
286 libgomp=%{thisver}
287 end
288
289 # We do not ship libgcc-devel anymore.
290 provides += libgcc-devel=%{thisver}
291 obsoletes += libgcc-devel<%{thisver}
292
293 if "%{build_cloog_ppl}" == "1"
294 requires += cloog-ppl>=0.15
295 end
296 end
297
298 package %{name}-c++
299 summary = C++ support for GCC.
300 description
301 This package adds C++ support to the GNU Compiler Collection.
302 It includes support for most of the current C++ specification,
303 including templates and exception handling.
304 end
305
306 requires
307 gcc=%{thisver}
308 libstdc++=%{thisver}
309 libstdc++-devel=%{thisver}
310 end
311
312 files
313 /usr/bin/*++
314 %{libdir}/gcc/*/*/cc1plus
315 /usr/share/man/man*/*++*
316 end
317 end
318
319 package cpp
320 summary = The C Preprocessor.
321 description
322 Cpp is the GNU C-Compatible Compiler Preprocessor.
323 Cpp is a macro processor which is used automatically
324 by the C compiler to transform your program before actual
325 compilation. It is called a macro processor because it allows
326 you to define macros, abbreviations for longer
327 constructs.
328
329 The C preprocessor provides four separate functionalities: the
330 inclusion of header files (files of declarations that can be
331 substituted into your program); macro expansion (you can define macros,
332 and the C preprocessor will replace the macros with their definitions
333 throughout the program); conditional compilation (using special
334 preprocessing directives, you can include or exclude parts of the
335 program according to various conditions); and line control (if you use
336 a program to combine or rearrange source files into an intermediate
337 file which is then compiled, you can use line control to inform the
338 compiler about where each source line originated).
339
340 You should install this package if you are a C programmer and you use
341 macros.
342 end
343 group = Development/Languages
344
345 files
346 /%{lib}/cpp
347 /usr/bin/cpp
348 /usr/share/man/man1/cpp.1*
349 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/cc1
350 end
351 end
352
353 package libgcc
354 summary = GCC shared support library.
355 description
356 This package contains GCC shared support library which is needed
357 e.g. for exception handling support.
358 end
359
360 files
361 /%{lib}/libgcc*.so.*
362 end
363 end
364
365 package libstdc++
366 summary = GNU Standard C++ Library.
367 description
368 The libstdc++ package contains a rewritten standard compliant GCC Standard
369 C++ Library.
370 end
371
372 files
373 %{libdir}/libstdc++*.so.*
374 end
375 end
376
377 package libstdc++-devel
378 summary = Header files and libraries for C++ development.
379 description
380 This is the GNU implementation of the standard C++ libraries. This
381 package includes the header files and libraries needed for C++
382 development. This includes rewritten implementation of STL.
383 end
384
385 requires
386 libstdc++=%{thisver}
387 end
388
389 files
390 %{includedir}/c++
391 %{libdir}/libstdc++*.so
392 end
393 end
394
395 package libgomp
396 summary = GCC OpenMP v3.0 shared support library.
397 description
398 This package contains GCC shared support library which is needed
399 for OpenMP v3.0 support.
400 end
401
402 files
403 %{libdir}/libgomp*.so.*
404 end
405 end
406
407 package libmudflap
408 summary = GCC mudflap shared support library.
409 description
410 This package contains GCC shared support library which is needed
411 for mudflap support.
412 end
413
414 files
415 %{libdir}/libmudflap*.so.*
416 end
417 end
418
419 package libmudflap-devel
420 summary = Development files for GCC mudflap support.
421 description
422 This package contains headers for building mudflap-instrumented programs.
423
424 To instrument a non-threaded program, add -fmudflap
425 option to GCC and when linking add -lmudflap, for threaded programs
426 also add -fmudflapth and -lmudflapth.
427 end
428
429 requires
430 libmudflap=%{thisver}
431 end
432
433 files
434 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/mf-runtime.h
435 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflap.so
436 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflapth.so
437 end
438 end
439
440 if "%{build_libquadmath}" == "1"
441 package libquadmath
442 summary = GCC __float128 shared support library.
443 description
444 This package contains GCC shared support library which is needed
445 for __float128 math support and for Fortran REAL*16 support.
446 end
447
448 files
449 %{libdir}/libquadmath*.so.*
450 end
451 end
452
453 package libquadmath-devel
454 summary = Development files for GCC __float128 support.
455 description
456 This package contains headers for building Fortran programs using
457 REAL*16 and programs using __float128 math.
458 end
459
460 requires
461 gcc=%{thisver}
462 libquadmath=%{thisver}
463 end
464
465 files
466 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath.h
467 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath_weak.h
468 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libquadmath.so
469 end
470 end
471 end
472
473 package gcc-plugin-devel
474 summary = Support for compiling GCC plugins.
475 description
476 This package contains header files and other support files
477 for compiling GCC plugins. The GCC plugin ABI is currently
478 not stable, so plugins must be rebuilt any time GCC is updated.
479 end
480
481 requires
482 gcc=%{thisver}
483 gmp-devel>=4.1.2-8
484 mpfr-devel>=2.2.1
485 libmpc-devel>=0.8.1
486 end
487
488 files
489 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/plugin
490 end
491 end
492
493 package %{name}-debuginfo
494 template DEBUGINFO
495 end
496 end