]> git.ipfire.org Git - ipfire-3.x.git/blame - gcc/gcc.nm
flex: Package libfl_pic.a.
[ipfire-3.x.git] / gcc / gcc.nm
CommitLineData
166a6c21 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
166a6c21
MT
4###############################################################################
5
802ea3af
MT
6# Configure build to compile with cloog and ppl.
7# XXX THIS PACKAGE DOES CURRENTLY NOT BUILD WITH CLOOG AND PPL WHICH
8# NEEDS TO BE FIXED SOON.
9build_cloog_ppl = 0
166a6c21 10
802ea3af 11name = gcc
de58ea22
MT
12version = 4.6.2
13release = 1
f0d77f5d 14
802ea3af
MT
15maintainer = Michael Tremer <michael.tremer@ipfire.org>
16groups = Development/Compilers
17url = http://gcc.gnu.org/
18license = GPLv3+ and GPLv2+ with exceptions
19summary = Various compilers (C, C++, Objective-C, Java, ...).
166a6c21 20
802ea3af 21description
166a6c21
MT
22 The gcc package contains the GNU Compiler Collection. \
23 You'll need this package in order to compile C code.
802ea3af
MT
24end
25
26# This is the at least required version of binutils.
27required_binutils_version = 2.21.51.0.8-1
28
de58ea22 29source_dl = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
802ea3af
MT
30sources = %{thisapp}.tar.gz
31
32patches
33 gcc46-hack.patch0
34 gcc46-c++-builtin-redecl.patch0
35 gcc46-pr33763.patch0
36 gcc46-libgomp-omp_h-multilib.patch0
37 gcc46-libtool-no-rpath.patch0
38 gcc46-cloog-dl.patch0
39 gcc46-pr38757.patch0
40 gcc46-no-add-needed.patch0
41 gcc46-unwind-debughook-sdt.patch0
42 gcc46-ppl-0.10.patch
43 gcc46-Woverlength-string.patch0
44 gcc46-Woverlength-string-asm.patch0
3c926509 45 gcc-4.6.0-piepatches-20110407.patch
802ea3af
MT
46end
47
48build
49 requires
50 autogen
51 binutils>=%{required_binutils_version}
52 dejagnu
53 elfutils-devel
54 expect
55 flex
56 glibc-devel
57 gmp-devel
58 libffi-devel
59 mpc-devel
60 mpfr-devel
61 texinfo
62 zlib-devel
63 end
64
65 # If cloog support is enabled, we require the devel packages for build.
66 if "%{build_cloog_ppl}" == "1"
67 requires += cloog-ppl-devel ppl-devel
68 end
69
70 # A couple of configure arguments depending on the architecture and
71 # configuration.
72 configure_options =
73
74 if "%{DISTRO_ARCH}" == "x86_64"
75 configure_options = --disable-multilib
76 end
77
78 if "%{DISTRO_ARCH}" == "i686"
79 configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
80 end
81
82 if "%{build_cloog_ppl}" == "1"
83 configure_options += --with-cloog --with-ppl
84 end
85
86 # CFLAGS for hardening.
87 HARD_CFLAGS = -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW
88
89 prepare_cmds
90 mkdir -v %{DIR_SRC}/gcc-build
91
92 # Remove unneeded features that will save some compile time
93 rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp}
94
95 # Apply a sed substitution that will suppress the installation of
96 # libiberty.a. The version of libiberty.a provided by Binutils will be used
97 # instead:
98 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
99
100 # Branding gcc
101 echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE
102
103 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
104 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
105 sed -e "s/-Werror//" -i libgomp/configure
106
107 # The fixincludes script is known to occasionally erroneously attempt to
108 # "fix" the system headers installed so far. As the headers up to this point
109 # are known to not require fixing, issue the following command to prevent
110 # the fixincludes script from running:
111 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
112
113 sed -i gcc/Makefile.in \
114 -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
115
116 # we want to be able to control the pie patch logic via something other
117 # than ALL_CFLAGS...
118 sed -i gcc/Makefile.in \
119 -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
120 -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |'
121
122 # Enable the GCC hardening by default.
123 sed -i gcc/Makefile.in \
124 -e "s|^HARD_CFLAGS = |HARD_CFLAGS = %{HARD_CFLAGS} |"
125
126 # Compile the compiler with -fPIC as well.
127 sed -i gcc/Makefile.in \
128 -e "s|^ESP_NOPIE_CFLAGS = .*|ESP_NOPIE_CFLAGS =|"
129
130 ./contrib/gcc_update --touch
131 end
132
133 build
134 cd %{DIR_SRC}/gcc-build
135
136 # Modify CFLAGS
137 OPT_FLAGS="%{CFLAGS}"
138 CFLAGS="%{CFLAGS}"
139 CFLAGS=$(echo ${CFLAGS} | sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g')
140 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
141 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-march=i.86//g')
142 #CFLAGS=$(echo ${CFLAGS} | sed -e 's/ -pipe / /g')
143 CFLAGS=$(echo "${CFLAGS}" | sed -e 's/[[:blank:]]\+/ /g')
144 CXXFLAGS=$(echo ${CFLAGS} | sed -e 's/ -Wall//g')
145
146 CFLAGS="${CFLAGS}" \
147 CXXFLAGS="${CXXFLAGS}" \
148 XCFLAGS="${CFLAGS}" \
149 TCFLAGS="${CFLAGS}" \
150 ../%{thisapp}/configure \
151 --build=%{DISTRO_BUILDTARGET} \
166a6c21
MT
152 --prefix=/usr \
153 --libexecdir=/usr/lib \
107ed6ee 154 --mandir=/usr/share/man \
b8b873e7 155 --enable-esp \
166a6c21
MT
156 --enable-shared \
157 --enable-threads=posix \
158 --enable-__cxa_atexit \
159 --enable-clocale=gnu \
f23b0b6e
MT
160 --enable-languages=c,c++,lto \
161 --enable-bootstrap \
162 --enable-checking=release \
166a6c21
MT
163 --disable-werror \
164 --disable-libssp \
165 --disable-static \
f23b0b6e
MT
166 --with-system-zlib \
167 --with-bugurl=http://bugtracker.ipfire.org \
b415c6aa
MT
168 --disable-libunwind-exceptions \
169 --enable-gnu-unique-object \
170 --enable-linker-build-id \
802ea3af
MT
171 %{configure_options}
172
173 # GCC does not support a parallel build.
174 make profiledbootstrap BOOT_CFLAGS="${OPT_FLAGS}" #%{PARALLELISMFLAGS}
175 end
176
177 #test
178 # cd %{DIR_SRC}/gcc-build && make check
179 # cd %{DIR_APP} && ./contrib/test_summary
180 #end
181
182 install
183 cd %{DIR_SRC}/gcc-build
184 make install DESTDIR=%{BUILDROOT}
185
186 mkdir -pv %{BUILDROOT}/lib
187 ln -sfv ../usr/bin/cpp %{BUILDROOT}/lib/cpp
188 ln -sfv gcc %{BUILDROOT}/usr/bin/cc
189
190 # Move libgcc_s to /lib
191 mv -vf %{BUILDROOT}/usr/lib/libgcc_s.so.1 %{BUILDROOT}/lib/
192 ln -svf ../../lib/libgcc_s.so.1 %{BUILDROOT}/usr/lib/libgcc_s.so
193
194 # Remove some GNU debugger stuff.
195 rm -vf %{BUILDROOT}/usr/lib/lib*.py
196 end
197end
198
199packages
200 package %{name}
201 groups += Build
202
203 requires
204 binutils>=%{required_binutils_version}
205 glibc-devel
7112214f 206 gmp-devel
802ea3af
MT
207 libgcc-devel
208 end
209
210 if "%{build_cloog_ppl}" == "1"
211 requires += cloog-ppl>=0.15
212 end
213 end
214
215 # XXX add package descriptions
216
217 package %{name}-c++
218 requires = gcc=%{thisver} libstdc++-devel
219
220 files
221 /usr/bin/*++
222 /usr/lib/gcc/*/*/cc1plus
223 /usr/share/man/man*/*++*
224 end
225 end
226
227 package libgcc
228 files
229 /lib/libgcc*.so.*
230 end
231 end
232
233 package libgcc-devel
234 requires = libgcc=%{thisver}
235
236 files
237 /usr/lib/libgcc*.so
238 end
239 end
240
241 package libstdc++
242 files
243 /usr/lib/libstdc++*.so.*
244 end
245 end
246
247 package libstdc++-devel
248 files
249 /usr/include/c++
250 /usr/lib/libstdc++*.so
251 end
252 end
253
254 package libgomp
255 files
256 /usr/lib/libgomp*.so.*
257 end
258 end
259
260 package libgomp
261 files
262 /usr/lib/libgomp*.so
263 /usr/lib/libgomp.spec
264 end
265 end
266
267 package libmudflap
268 files
269 /usr/lib/libmudflap*.so.*
270 end
271 end
272
273 package libmudflap-devel
274 files
275 /usr/lib/libmudflap*.so
276 end
277 end
278
279 package libquadmath
280 files
281 /usr/lib/libquadmath*.so.*
282 end
283 end
284
285 package libquadmath-devel
286 files
287 /usr/lib/libquadmath*.so
288 end
289 end
290end