3 %bcond_with bootstrap # build without NaCL newlib package dependency (without c++ package)
6 Summary: Various compilers (C, C++) for NaCl
9 Release: 6.git%{gitver}
10 License: GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions
11 Group: Development/Languages
12 Source0: nacl-gcc-%{version}-git%{gitver}.tar.bz2
13 # Source0-md5: fcdfdd30b82d8ad8fa6e39e7e32cee64
14 Source1: get-source.sh
15 URL: http://sourceware.org/gcc/
16 BuildRequires: cloog-ppl-devel
17 BuildRequires: crossnacl-binutils
18 BuildRequires: elfutils-devel
19 BuildRequires: gmp-c++-devel
20 BuildRequires: gmp-devel
21 BuildRequires: mpfr-devel
22 BuildRequires: ppl-pwl-devel
23 BuildRequires: tar >= 1:1.22
25 %if %{without bootstrap}
26 BuildRequires: crossnacl-newlib
28 ExclusiveArch: %{ix86} %{x8664}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define target x86_64-nacl
32 %define arch %{_prefix}/%{target}
33 %define gcc_ver %{version}
34 %define gcclib %{_libdir}/gcc/%{target}/%{gcc_ver}
35 %define gccnlib %{_prefix}/lib/gcc/%{target}/%{gcc_ver}
37 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
40 The gcc package contains the GNU Compiler Collection version 4.4.3.
41 You'll need this package in order to compile C code.
43 This provides support for NaCl targets.
46 Summary: C++ support for crossnacl-gcc
47 Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc
48 Group: Development/Languages
49 Requires: %{name} = %{version}-%{release}
52 This package adds C++ support to the GNU Compiler Collection for NaCl
55 %description c++ -l pl.UTF-8
56 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
59 Summary: NaCL binary utility development utilities - objc
60 Summary(pl.UTF-8): Zestaw narzędzi NaCL - objc
61 Group: Development/Languages
62 Requires: %{name} = %{version}-%{release}
65 This package contains cross targeted objc compiler.
67 %description objc -l pl.UTF-8
68 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
71 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
75 install -d obj-%{target}
78 OPT_FLAGS="%{rpmcflags}"
79 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
81 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
83 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
86 *-fasynchronous-unwind-tables*)
87 %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
92 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
96 --infodir=%{_infodir} \
97 --libexecdir=%{_libdir} \
98 --enable-checking=release \
100 --enable-__cxa_atexit \
101 --disable-libunwind-exceptions \
102 --enable-gnu-unique-object \
103 --disable-decimal-float \
105 --disable-libmudflap \
107 --disable-libstdcxx-pch \
109 --with-ppl --with-cloog \
111 CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
112 CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
113 XCFLAGS="$OPT_FLAGS" \
114 %if %{with bootstrap}
116 --enable-languages="c" \
118 CFLAGS_FOR_TARGET="-O2 -g" \
119 CXXFLAGS_FOR_TARGET="-O2 -g" \
121 CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
122 CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
123 --enable-threads=nacl \
124 --enable-languages="c,c++,objc" \
129 --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
130 --disable-ppl-version-check \
134 BOOT_CFLAGS="$OPT_FLAGS" \
135 %if %{with bootstrap}
136 all-gcc all-target-libgcc
142 rm -rf $RPM_BUILD_ROOT
145 %if %{with bootstrap}
146 install-gcc install-target-libgcc \
150 DESTDIR=$RPM_BUILD_ROOT
152 # move fixed includes to proper place
153 mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include
155 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed
156 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools
158 # Delete supplemental files that would conflict with the core toolchain
159 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
160 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
161 # I suspect that the core toolchain locale files will work with this reasonably well.
162 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
164 # Don't dupe the system libiberty.a
165 %if %{without bootstrap}
166 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
167 %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a
171 rm -rf $RPM_BUILD_ROOT
174 %defattr(644,root,root,755)
176 %attr(755,root,root) %{_bindir}/%{target}-cpp
177 %attr(755,root,root) %{_bindir}/%{target}-gcc
178 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver}
179 %attr(755,root,root) %{_bindir}/%{target}-gccbug
180 %attr(755,root,root) %{_bindir}/%{target}-gcov
182 %if "%{_lib}" != "lib"
183 %dir %{_prefix}/lib/gcc
184 %dir %{_prefix}/lib/gcc/%{target}
189 %dir %{gccnlib}/include
190 %{gccnlib}/include/*.h
196 %dir %{_libexecdir}/gcc
197 %dir %{_libexecdir}/gcc/%{target}
199 %attr(755,root,root) %{gcclib}/cc1
200 %attr(755,root,root) %{gcclib}/collect2
202 %if "%{_lib}" != "lib"
203 # not present on ix86, not needed?
204 %dir %{gcclib}/install-tools
205 %attr(755,root,root) %{gcclib}/install-tools/*
208 %{_mandir}/man1/%{target}-cpp.*
209 %{_mandir}/man1/%{target}-gcc.*
210 %{_mandir}/man1/%{target}-gcov.*
212 %if %{without bootstrap}
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_bindir}/%{target}-c++
216 %attr(755,root,root) %{_bindir}/%{target}-g++
217 %attr(755,root,root) %{gcclib}/cc1plus
218 %{_prefix}/%{target}/include/c++
219 %dir %{_prefix}/%{target}/lib32
220 %dir %{_prefix}/%{target}/lib64
221 %{_prefix}/%{target}/lib*/libstdc++.*a
222 %{_prefix}/%{target}/lib*/libsupc++.*a
223 %{_mandir}/man1/%{target}-g++.*
226 %defattr(644,root,root,755)
227 %attr(755,root,root) %{gcclib}/cc1obj
228 %{_prefix}/%{target}/lib*/libobjc.*a
229 %{gccnlib}/include/objc