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 %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]+
38 %define filterout_c -Werror=format-security
41 The gcc package contains the GNU Compiler Collection version 4.4.3.
42 You'll need this package in order to compile C code.
44 This provides support for NaCl targets.
47 Summary: C++ support for crossnacl-gcc
48 Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc
49 Group: Development/Languages
50 Requires: %{name} = %{version}-%{release}
53 This package adds C++ support to the GNU Compiler Collection for NaCl
56 %description c++ -l pl.UTF-8
57 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
60 Summary: NaCL binary utility development utilities - objc
61 Summary(pl.UTF-8): Zestaw narzędzi NaCL - objc
62 Group: Development/Languages
63 Requires: %{name} = %{version}-%{release}
66 This package contains cross targeted objc compiler.
68 %description objc -l pl.UTF-8
69 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
72 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
76 install -d obj-%{target}
79 OPT_FLAGS="%{rpmcflags}"
80 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
82 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
84 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
87 *-fasynchronous-unwind-tables*)
88 %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
93 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
97 --infodir=%{_infodir} \
98 --libexecdir=%{_libdir} \
99 --enable-checking=release \
101 --enable-__cxa_atexit \
102 --disable-libunwind-exceptions \
103 --enable-gnu-unique-object \
104 --disable-decimal-float \
106 --disable-libmudflap \
108 --disable-libstdcxx-pch \
110 --with-ppl --with-cloog \
112 CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
113 CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
114 XCFLAGS="$OPT_FLAGS" \
115 %if %{with bootstrap}
117 --enable-languages="c" \
119 CFLAGS_FOR_TARGET="-O2 -g" \
120 CXXFLAGS_FOR_TARGET="-O2 -g" \
122 CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
123 CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
124 --enable-threads=nacl \
125 --enable-languages="c,c++,objc" \
130 --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
131 --disable-ppl-version-check \
135 BOOT_CFLAGS="$OPT_FLAGS" \
136 %if %{with bootstrap}
137 all-gcc all-target-libgcc
143 rm -rf $RPM_BUILD_ROOT
146 %if %{with bootstrap}
147 install-gcc install-target-libgcc \
151 DESTDIR=$RPM_BUILD_ROOT
153 # move fixed includes to proper place
154 mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include
156 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed
157 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools
159 # Delete supplemental files that would conflict with the core toolchain
160 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
161 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
162 # I suspect that the core toolchain locale files will work with this reasonably well.
163 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
165 # Don't dupe the system libiberty.a
166 %if %{without bootstrap}
167 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
168 %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a
172 rm -rf $RPM_BUILD_ROOT
175 %defattr(644,root,root,755)
177 %attr(755,root,root) %{_bindir}/%{target}-cpp
178 %attr(755,root,root) %{_bindir}/%{target}-gcc
179 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver}
180 %attr(755,root,root) %{_bindir}/%{target}-gccbug
181 %attr(755,root,root) %{_bindir}/%{target}-gcov
183 %if "%{_lib}" != "lib"
184 %dir %{_prefix}/lib/gcc
185 %dir %{_prefix}/lib/gcc/%{target}
190 %dir %{gccnlib}/include
191 %{gccnlib}/include/*.h
197 %dir %{_libexecdir}/gcc
198 %dir %{_libexecdir}/gcc/%{target}
200 %attr(755,root,root) %{gcclib}/cc1
201 %attr(755,root,root) %{gcclib}/collect2
203 %if "%{_lib}" != "lib"
204 # not present on ix86, not needed?
205 %dir %{gcclib}/install-tools
206 %attr(755,root,root) %{gcclib}/install-tools/*
209 %{_mandir}/man1/%{target}-cpp.*
210 %{_mandir}/man1/%{target}-gcc.*
211 %{_mandir}/man1/%{target}-gcov.*
213 %if %{without bootstrap}
215 %defattr(644,root,root,755)
216 %attr(755,root,root) %{_bindir}/%{target}-c++
217 %attr(755,root,root) %{_bindir}/%{target}-g++
218 %attr(755,root,root) %{gcclib}/cc1plus
219 %{_prefix}/%{target}/include/c++
220 %dir %{_prefix}/%{target}/lib32
221 %dir %{_prefix}/%{target}/lib64
222 %{_prefix}/%{target}/lib*/libstdc++.*a
223 %{_prefix}/%{target}/lib*/libsupc++.*a
224 %{_mandir}/man1/%{target}-g++.*
227 %defattr(644,root,root,755)
228 %attr(755,root,root) %{gcclib}/cc1obj
229 %{_prefix}/%{target}/lib*/libobjc.*a
230 %{gccnlib}/include/objc