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