]>
Commit | Line | Data |
---|---|---|
67a2078c ER |
1 | # |
2 | # Conditional build: | |
a1e9c569 | 3 | %bcond_with bootstrap # build without NaCl newlib package dependency (without c++,objc packages) |
67a2078c | 4 | |
da62708b | 5 | %define gitver 3960379 |
a1e9c569 | 6 | %define rel 1 |
9da9bef5 | 7 | Summary: Various compilers (C, C++) for NaCl |
a1e9c569 | 8 | Summary(pl.UTF-8): Różne kompilatory (C, C++) dla NaCl |
67a2078c ER |
9 | Name: crossnacl-gcc |
10 | Version: 4.4.3 | |
a1e9c569 | 11 | Release: 13.git%{gitver}.%{rel} |
e0a44550 | 12 | License: GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions |
67a2078c | 13 | Group: Development/Languages |
bae6856c | 14 | Source0: nacl-gcc-%{version}-git%{gitver}.tar.xz |
da62708b | 15 | # Source0-md5: e72fed38d5b93e4505c1a05c69ab0796 |
ced35f34 | 16 | Source1: get-source.sh |
04c7c5f9 | 17 | Patch0: gnu_inline-mismatch.patch |
67a2078c | 18 | URL: http://sourceware.org/gcc/ |
a1e9c569 | 19 | BuildRequires: cloog-ppl-devel >= 0.15 |
67a2078c ER |
20 | BuildRequires: crossnacl-binutils |
21 | BuildRequires: elfutils-devel | |
a1e9c569 JB |
22 | BuildRequires: gmp-c++-devel >= 4.1 |
23 | BuildRequires: gmp-devel >= 4.1 | |
24 | BuildRequires: libstdc++-devel | |
25 | BuildRequires: mpfr-devel >= 2.3.2 | |
4969b224 | 26 | BuildRequires: perl-tools-pod |
a1e9c569 | 27 | BuildRequires: ppl-devel >= 0.10 |
9c139859 ER |
28 | BuildRequires: tar >= 1:1.22 |
29 | BuildRequires: xz | |
861a53d8 | 30 | BuildConflicts: cloog-isl-devel |
67a2078c | 31 | %if %{without bootstrap} |
56fc8967 | 32 | BuildRequires: crossnacl-newlib |
67a2078c ER |
33 | %endif |
34 | ExclusiveArch: %{ix86} %{x8664} | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
fd91e679 | 37 | %define target x86_64-nacl |
a1e9c569 JB |
38 | %define archprefix %{_prefix}/%{target} |
39 | %define archbindir %{archprefix}/bin | |
40 | %define archincludedir %{archprefix}/include | |
41 | %define archlib32dir %{archprefix}/lib32 | |
42 | %define archlib64dir %{archprefix}/lib64 | |
43 | %define gccarchdir %{_libdir}/gcc/%{target} | |
44 | %define gcclibdir %{gccarchdir}/%{version} | |
fd91e679 ER |
45 | |
46 | %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+ | |
a1e9c569 | 47 | %define filterout_c -Werror=format-security |
67a2078c ER |
48 | |
49 | %description | |
a1e9c569 | 50 | The gcc package contains the GNU Compiler Collection. |
e0a44550 | 51 | |
a1e9c569 JB |
52 | This package provides support for NaCl targets. |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | Pakiet gcc zawiera zestaw kompilatorów GNU Compiler Collection. | |
56 | ||
57 | Ten pakiet zapewnia obsługę platformy docelowej NaCl. | |
e0a44550 ER |
58 | |
59 | %package c++ | |
60 | Summary: C++ support for crossnacl-gcc | |
61 | Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc | |
62 | Group: Development/Languages | |
63 | Requires: %{name} = %{version}-%{release} | |
64 | ||
65 | %description c++ | |
66 | This package adds C++ support to the GNU Compiler Collection for NaCl | |
67 | targets. | |
68 | ||
69 | %description c++ -l pl.UTF-8 | |
a1e9c569 | 70 | Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCl. |
67a2078c | 71 | |
56fc8967 | 72 | %package objc |
a1e9c569 JB |
73 | Summary: NaCl binary utility development utilities - objc |
74 | Summary(pl.UTF-8): Zestaw narzędzi programistycznych NaCl - objc | |
56fc8967 ER |
75 | Group: Development/Languages |
76 | Requires: %{name} = %{version}-%{release} | |
77 | ||
78 | %description objc | |
a1e9c569 | 79 | This package contains objc compiler cross targeted to NaCl. |
56fc8967 ER |
80 | |
81 | %description objc -l pl.UTF-8 | |
a1e9c569 | 82 | Ten pakiet zawiera kompilator objc generujący kod dla NaCl. |
56fc8967 | 83 | |
67a2078c ER |
84 | %prep |
85 | %setup -q -n nacl-gcc-%{version}-git%{?gitver} | |
04c7c5f9 | 86 | %patch0 -p1 |
67a2078c ER |
87 | |
88 | %build | |
fd91e679 ER |
89 | rm -rf obj-%{target} |
90 | install -d obj-%{target} | |
91 | cd obj-%{target} | |
92 | ||
04c7c5f9 | 93 | OPT_FLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64 -fgnu89-inline" |
fd91e679 | 94 | OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g') |
67a2078c | 95 | %ifarch %{ix86} |
fd91e679 | 96 | OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g') |
67a2078c | 97 | %endif |
fd91e679 ER |
98 | OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g') |
99 | ||
67a2078c ER |
100 | case "$OPT_FLAGS" in |
101 | *-fasynchronous-unwind-tables*) | |
102 | %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \ | |
103 | ../gcc/Makefile.in | |
104 | ;; | |
105 | esac | |
106 | ||
107 | GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h" | |
108 | ../configure \ | |
a1e9c569 JB |
109 | CC="%{__cc}" \ |
110 | CFLAGS="$OPT_FLAGS $GCC_DEFINES" \ | |
111 | CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \ | |
112 | XCFLAGS="$OPT_FLAGS" \ | |
113 | MAKEINFO=/bin/true \ | |
67a2078c ER |
114 | --prefix=%{_prefix} \ |
115 | --mandir=%{_mandir} \ | |
116 | --infodir=%{_infodir} \ | |
a1e9c569 | 117 | --libdir=%{_libdir} \ |
67a2078c | 118 | --libexecdir=%{_libdir} \ |
fd91e679 | 119 | --enable-__cxa_atexit \ |
a1e9c569 | 120 | --enable-checking=release \ |
67a2078c | 121 | --disable-decimal-float \ |
a1e9c569 JB |
122 | --enable-gnu-unique-object \ |
123 | --disable-libgcj \ | |
67a2078c ER |
124 | --disable-libgomp \ |
125 | --disable-libmudflap \ | |
126 | --disable-libssp \ | |
127 | --disable-libstdcxx-pch \ | |
a1e9c569 JB |
128 | --disable-libunwind-exceptions \ |
129 | --disable-ppl-version-check \ | |
67a2078c | 130 | --disable-shared \ |
a1e9c569 JB |
131 | --with-cloog \ |
132 | --with-host-libstdcxx="-lstdc++ -lm" \ | |
133 | --with-ppl \ | |
134 | --with-system-zlib \ | |
67a2078c | 135 | %if %{with bootstrap} |
67a2078c ER |
136 | CFLAGS_FOR_TARGET="-O2 -g" \ |
137 | CXXFLAGS_FOR_TARGET="-O2 -g" \ | |
a1e9c569 JB |
138 | --enable-languages="c" \ |
139 | --disable-threads \ | |
140 | --without-headers \ | |
67a2078c ER |
141 | %else |
142 | CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \ | |
143 | CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \ | |
67a2078c | 144 | --enable-languages="c,c++,objc" \ |
a1e9c569 | 145 | --enable-threads=nacl \ |
67a2078c ER |
146 | --enable-tls \ |
147 | --with-newlib \ | |
148 | %endif | |
a1e9c569 | 149 | --target=%{target} |
67a2078c ER |
150 | |
151 | %{__make} \ | |
152 | BOOT_CFLAGS="$OPT_FLAGS" \ | |
153 | %if %{with bootstrap} | |
154 | all-gcc all-target-libgcc | |
155 | %else | |
156 | all | |
157 | %endif | |
158 | ||
159 | %install | |
160 | rm -rf $RPM_BUILD_ROOT | |
a1e9c569 JB |
161 | |
162 | %{__make} -C obj-%{target} \ | |
67a2078c ER |
163 | %if %{with bootstrap} |
164 | install-gcc install-target-libgcc \ | |
165 | %else | |
166 | install \ | |
167 | %endif | |
168 | DESTDIR=$RPM_BUILD_ROOT | |
169 | ||
fd91e679 | 170 | # move fixed includes to proper place |
a1e9c569 JB |
171 | %{__mv} $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_ROOT%{gcclibdir}/include |
172 | %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/include-fixed | |
173 | %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/install-tools | |
fd91e679 | 174 | |
67a2078c ER |
175 | # Delete supplemental files that would conflict with the core toolchain |
176 | %{__rm} -r $RPM_BUILD_ROOT%{_infodir} | |
fd91e679 | 177 | %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7 |
67a2078c | 178 | # I suspect that the core toolchain locale files will work with this reasonably well. |
fd91e679 | 179 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir} |
67a2078c ER |
180 | |
181 | # Don't dupe the system libiberty.a | |
56fc8967 ER |
182 | %if %{without bootstrap} |
183 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a | |
a1e9c569 JB |
184 | %{__rm} $RPM_BUILD_ROOT%{archlib32dir}/libiberty.a |
185 | %{__rm} $RPM_BUILD_ROOT%{archlib64dir}/libiberty.a | |
186 | %endif | |
187 | ||
188 | %if %{with bootstrap} | |
189 | # always create lib directories (place for newlib when bootstrapping) | |
190 | install -d $RPM_BUILD_ROOT{%{archlib32dir},%{archlib64dir}} | |
56fc8967 | 191 | %endif |
67a2078c ER |
192 | |
193 | %clean | |
194 | rm -rf $RPM_BUILD_ROOT | |
195 | ||
196 | %files | |
197 | %defattr(644,root,root,755) | |
a1e9c569 | 198 | %doc README NEWS gcc/README.Portability |
fd91e679 ER |
199 | %attr(755,root,root) %{_bindir}/%{target}-cpp |
200 | %attr(755,root,root) %{_bindir}/%{target}-gcc | |
a1e9c569 | 201 | %attr(755,root,root) %{_bindir}/%{target}-gcc-%{version} |
fd91e679 ER |
202 | %attr(755,root,root) %{_bindir}/%{target}-gccbug |
203 | %attr(755,root,root) %{_bindir}/%{target}-gcov | |
a1e9c569 JB |
204 | %dir %{archlib32dir} |
205 | %dir %{archlib64dir} | |
206 | %dir %{gccarchdir} | |
207 | %dir %{gcclibdir} | |
208 | %attr(755,root,root) %{gcclibdir}/cc1 | |
209 | %attr(755,root,root) %{gcclibdir}/collect2 | |
210 | %{gcclibdir}/crt*.o | |
211 | %{gcclibdir}/libgcc.a | |
212 | %{gcclibdir}/libgcov.a | |
213 | %dir %{gcclibdir}/32 | |
214 | %{gcclibdir}/32/crt*.o | |
215 | %{gcclibdir}/32/libgcc.a | |
216 | %{gcclibdir}/32/libgcov.a | |
217 | %dir %{gcclibdir}/include | |
218 | %{gcclibdir}/include/ammintrin.h | |
219 | %{gcclibdir}/include/avxintrin.h | |
220 | %{gcclibdir}/include/bmmintrin.h | |
221 | %{gcclibdir}/include/cpuid.h | |
222 | %{gcclibdir}/include/cross-stdarg.h | |
223 | %{gcclibdir}/include/emmintrin.h | |
224 | %{gcclibdir}/include/float.h | |
225 | %{gcclibdir}/include/immintrin.h | |
226 | %{gcclibdir}/include/iso646.h | |
227 | %{gcclibdir}/include/limits.h | |
228 | %{gcclibdir}/include/mm3dnow.h | |
229 | %{gcclibdir}/include/mm_malloc.h | |
230 | %{gcclibdir}/include/mmintrin-common.h | |
231 | %{gcclibdir}/include/mmintrin.h | |
232 | %{gcclibdir}/include/nmmintrin.h | |
233 | %{gcclibdir}/include/pmmintrin.h | |
234 | %{gcclibdir}/include/smmintrin.h | |
235 | %{gcclibdir}/include/stdarg.h | |
236 | %{gcclibdir}/include/stdbool.h | |
237 | %{gcclibdir}/include/stddef.h | |
238 | %{gcclibdir}/include/stdfix.h | |
239 | %{gcclibdir}/include/syslimits.h | |
240 | %{gcclibdir}/include/tmmintrin.h | |
241 | %{gcclibdir}/include/unwind.h | |
242 | %{gcclibdir}/include/varargs.h | |
243 | %{gcclibdir}/include/wmmintrin.h | |
244 | %{gcclibdir}/include/x86intrin.h | |
245 | %{gcclibdir}/include/xmmintrin.h | |
246 | %{_mandir}/man1/%{target}-cpp.1* | |
247 | %{_mandir}/man1/%{target}-gcc.1* | |
248 | %{_mandir}/man1/%{target}-gcov.1* | |
67a2078c ER |
249 | |
250 | %if %{without bootstrap} | |
e0a44550 ER |
251 | %files c++ |
252 | %defattr(644,root,root,755) | |
fd91e679 ER |
253 | %attr(755,root,root) %{_bindir}/%{target}-c++ |
254 | %attr(755,root,root) %{_bindir}/%{target}-g++ | |
a1e9c569 JB |
255 | %attr(755,root,root) %{gcclibdir}/cc1plus |
256 | %{archincludedir}/c++ | |
257 | %{archlib32dir}/libstdc++.a | |
258 | %{archlib32dir}/libstdc++.la | |
259 | %{archlib32dir}/libsupc++.a | |
260 | %{archlib32dir}/libsupc++.la | |
261 | %{archlib64dir}/libstdc++.a | |
262 | %{archlib64dir}/libstdc++.la | |
263 | %{archlib64dir}/libsupc++.a | |
264 | %{archlib64dir}/libsupc++.la | |
265 | %{_mandir}/man1/%{target}-g++.1* | |
56fc8967 ER |
266 | |
267 | %files objc | |
268 | %defattr(644,root,root,755) | |
a1e9c569 JB |
269 | %attr(755,root,root) %{gcclibdir}/cc1obj |
270 | %{gcclibdir}/include/objc | |
271 | %{archlib32dir}/libobjc.a | |
272 | %{archlib32dir}/libobjc.la | |
273 | %{archlib64dir}/libobjc.a | |
274 | %{archlib64dir}/libobjc.la | |
67a2078c | 275 | %endif |