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.xz
13 # Source0-md5: dd49a8726695a06c7fe9fc531dc6c637
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 BuildConflicts: cloog-isl-devel
26 %if %{without bootstrap}
27 BuildRequires: crossnacl-newlib
29 ExclusiveArch: %{ix86} %{x8664}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define target x86_64-nacl
33 %define arch %{_prefix}/%{target}
34 %define gcc_ver %{version}
35 %define gcclib %{_libdir}/gcc/%{target}/%{gcc_ver}
36 %define gccnlib %{_prefix}/lib/gcc/%{target}/%{gcc_ver}
38 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
39 %define filterout_c -Werror=format-security
42 The gcc package contains the GNU Compiler Collection version 4.4.3.
43 You'll need this package in order to compile C code.
45 This provides support for NaCl targets.
48 Summary: C++ support for crossnacl-gcc
49 Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc
50 Group: Development/Languages
51 Requires: %{name} = %{version}-%{release}
54 This package adds C++ support to the GNU Compiler Collection for NaCl
57 %description c++ -l pl.UTF-8
58 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
61 Summary: NaCL binary utility development utilities - objc
62 Summary(pl.UTF-8): Zestaw narzędzi NaCL - objc
63 Group: Development/Languages
64 Requires: %{name} = %{version}-%{release}
67 This package contains cross targeted objc compiler.
69 %description objc -l pl.UTF-8
70 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
73 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
77 install -d obj-%{target}
80 OPT_FLAGS="%{rpmcflags}"
81 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
83 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
85 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
88 *-fasynchronous-unwind-tables*)
89 %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
94 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
98 --infodir=%{_infodir} \
99 --libexecdir=%{_libdir} \
100 --enable-checking=release \
102 --enable-__cxa_atexit \
103 --disable-libunwind-exceptions \
104 --enable-gnu-unique-object \
105 --disable-decimal-float \
107 --disable-libmudflap \
109 --disable-libstdcxx-pch \
111 --with-ppl --with-cloog \
113 CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
114 CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
115 XCFLAGS="$OPT_FLAGS" \
116 %if %{with bootstrap}
118 --enable-languages="c" \
120 CFLAGS_FOR_TARGET="-O2 -g" \
121 CXXFLAGS_FOR_TARGET="-O2 -g" \
123 CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
124 CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
125 --enable-threads=nacl \
126 --enable-languages="c,c++,objc" \
131 --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
132 --disable-ppl-version-check \
136 BOOT_CFLAGS="$OPT_FLAGS" \
137 %if %{with bootstrap}
138 all-gcc all-target-libgcc
144 rm -rf $RPM_BUILD_ROOT
147 %if %{with bootstrap}
148 install-gcc install-target-libgcc \
152 DESTDIR=$RPM_BUILD_ROOT
154 # move fixed includes to proper place
155 mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include
157 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed
158 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools
160 # Delete supplemental files that would conflict with the core toolchain
161 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
162 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
163 # I suspect that the core toolchain locale files will work with this reasonably well.
164 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
166 # Don't dupe the system libiberty.a
167 %if %{without bootstrap}
168 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
169 %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a
173 rm -rf $RPM_BUILD_ROOT
176 %defattr(644,root,root,755)
178 %attr(755,root,root) %{_bindir}/%{target}-cpp
179 %attr(755,root,root) %{_bindir}/%{target}-gcc
180 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver}
181 %attr(755,root,root) %{_bindir}/%{target}-gccbug
182 %attr(755,root,root) %{_bindir}/%{target}-gcov
184 %if "%{_lib}" != "lib"
185 %dir %{_prefix}/lib/gcc
186 %dir %{_prefix}/lib/gcc/%{target}
191 %dir %{gccnlib}/include
192 %{gccnlib}/include/*.h
198 %dir %{_libexecdir}/gcc
199 %dir %{_libexecdir}/gcc/%{target}
201 %attr(755,root,root) %{gcclib}/cc1
202 %attr(755,root,root) %{gcclib}/collect2
204 %if "%{_lib}" != "lib"
205 # not present on ix86, not needed?
206 %dir %{gcclib}/install-tools
207 %attr(755,root,root) %{gcclib}/install-tools/*
210 %{_mandir}/man1/%{target}-cpp.*
211 %{_mandir}/man1/%{target}-gcc.*
212 %{_mandir}/man1/%{target}-gcov.*
214 %if %{without bootstrap}
216 %defattr(644,root,root,755)
217 %attr(755,root,root) %{_bindir}/%{target}-c++
218 %attr(755,root,root) %{_bindir}/%{target}-g++
219 %attr(755,root,root) %{gcclib}/cc1plus
220 %{_prefix}/%{target}/include/c++
221 %dir %{_prefix}/%{target}/lib32
222 %dir %{_prefix}/%{target}/lib64
223 %{_prefix}/%{target}/lib*/libstdc++.*a
224 %{_prefix}/%{target}/lib*/libsupc++.*a
225 %{_mandir}/man1/%{target}-g++.*
228 %defattr(644,root,root,755)
229 %attr(755,root,root) %{gcclib}/cc1obj
230 %{_prefix}/%{target}/lib*/libobjc.*a
231 %{gccnlib}/include/objc