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