3 %bcond_with bootstrap # build without nacl newlib package dependency (without c++ package)
5 %define gitver cff9ac88
6 Summary: Various compilers (C, C++) for nacl
9 Release: 4.git%{gitver}
11 # git clone http://git.chromium.org/native_client/nacl-gcc.git
12 # (Checkout ID taken from chromium-15.0.874.106/native_client/tools/REVISIONS)
14 # git checkout cff9ac884908ba53ae16149e7c7d19c336aa4895
16 # For gcc version, echo gcc/BASE-VER
17 # mv nacl-gcc nacl-gcc-4.4.3-gitcff9ac88
18 # tar cfj nacl-gcc-4.4.3-gitcff9ac88.tar.bz2 nacl-gcc-4.4.3-gitcff9ac88
19 License: GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions
20 Group: Development/Languages
21 Source0: nacl-gcc-%{version}-git%{gitver}.tar.bz2
22 # Source0-md5: 5f96c99136882b2b22a5d173890f8026
23 URL: http://sourceware.org/gcc/
24 BuildRequires: cloog-ppl-devel
25 BuildRequires: crossnacl-binutils
26 BuildRequires: elfutils-devel
27 BuildRequires: gmp-c++-devel
28 BuildRequires: gmp-devel
29 BuildRequires: mpfr-devel
30 BuildRequires: ppl-pwl-devel
31 %if %{without bootstrap}
32 BuildRequires: crossnacl-newlib
34 ExclusiveArch: %{ix86} %{x8664}
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define target x86_64-nacl
38 %define arch %{_prefix}/%{target}
39 %define gcc_ver %{version}
40 %define gcclib %{_libdir}/gcc/%{target}/%{gcc_ver}
41 %define gccnlib %{_prefix}/lib/gcc/%{target}/%{gcc_ver}
43 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
46 The gcc package contains the GNU Compiler Collection version 4.4.3.
47 You'll need this package in order to compile C code.
49 This provides support for NaCl targets.
52 Summary: C++ support for crossnacl-gcc
53 Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc
54 Group: Development/Languages
55 Requires: %{name} = %{version}-%{release}
58 This package adds C++ support to the GNU Compiler Collection for NaCl
61 %description c++ -l pl.UTF-8
62 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
65 Summary: NaCL binary utility development utilities - objc
66 Summary(pl.UTF-8): Zestaw narzędzi NaCL - objc
67 Group: Development/Languages
68 Requires: %{name} = %{version}-%{release}
71 This package contains cross targeted objc compiler.
73 %description objc -l pl.UTF-8
74 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
77 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
81 install -d obj-%{target}
84 OPT_FLAGS="%{rpmcflags}"
85 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
87 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
89 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
92 *-fasynchronous-unwind-tables*)
93 %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
98 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
100 --prefix=%{_prefix} \
101 --mandir=%{_mandir} \
102 --infodir=%{_infodir} \
103 --libexecdir=%{_libdir} \
104 --enable-checking=release \
106 --enable-__cxa_atexit \
107 --disable-libunwind-exceptions \
108 --enable-gnu-unique-object \
109 --disable-decimal-float \
111 --disable-libmudflap \
113 --disable-libstdcxx-pch \
115 --with-ppl --with-cloog \
117 CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
118 CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
119 XCFLAGS="$OPT_FLAGS" \
120 %if %{with bootstrap}
122 --enable-languages="c" \
124 CFLAGS_FOR_TARGET="-O2 -g" \
125 CXXFLAGS_FOR_TARGET="-O2 -g" \
127 CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
128 CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
129 --enable-threads=nacl \
130 --enable-languages="c,c++,objc" \
135 --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
136 --disable-ppl-version-check \
140 BOOT_CFLAGS="$OPT_FLAGS" \
141 %if %{with bootstrap}
142 all-gcc all-target-libgcc
148 rm -rf $RPM_BUILD_ROOT
151 %if %{with bootstrap}
152 install-gcc install-target-libgcc \
156 DESTDIR=$RPM_BUILD_ROOT
158 # move fixed includes to proper place
159 mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include
161 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed
162 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools
164 # Delete supplemental files that would conflict with the core toolchain
165 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
166 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
167 # I suspect that the core toolchain locale files will work with this reasonably well.
168 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
170 # Don't dupe the system libiberty.a
171 %if %{without bootstrap}
172 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
173 %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a
177 rm -rf $RPM_BUILD_ROOT
180 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_bindir}/%{target}-cpp
183 %attr(755,root,root) %{_bindir}/%{target}-gcc
184 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver}
185 %attr(755,root,root) %{_bindir}/%{target}-gccbug
186 %attr(755,root,root) %{_bindir}/%{target}-gcov
188 %if "%{_lib}" != "lib"
189 %dir %{_prefix}/lib/gcc
190 %dir %{_prefix}/lib/gcc/%{target}
195 %dir %{gccnlib}/include
196 %{gccnlib}/include/*.h
202 %dir %{_libexecdir}/gcc
203 %dir %{_libexecdir}/gcc/%{target}
205 %attr(755,root,root) %{gcclib}/cc1
206 %attr(755,root,root) %{gcclib}/collect2
208 %if "%{_lib}" != "lib"
209 # not present on ix86, not needed?
210 %dir %{gcclib}/install-tools
211 %attr(755,root,root) %{gcclib}/install-tools/*
214 %{_mandir}/man1/%{target}-cpp.*
215 %{_mandir}/man1/%{target}-gcc.*
216 %{_mandir}/man1/%{target}-gcov.*
218 %if %{without bootstrap}
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_bindir}/%{target}-c++
222 %attr(755,root,root) %{_bindir}/%{target}-g++
223 %attr(755,root,root) %{gcclib}/cc1plus
224 %{_prefix}/%{target}/include/c++
225 %dir %{_prefix}/%{target}/lib32
226 %dir %{_prefix}/%{target}/lib64
227 %{_prefix}/%{target}/lib*/libstdc++.*a
228 %{_prefix}/%{target}/lib*/libsupc++.*a
229 %{_mandir}/man1/%{target}-g++.*
232 %defattr(644,root,root,755)
233 %attr(755,root,root) %{gcclib}/cc1obj
234 %{_prefix}/%{target}/lib*/libobjc.*a
235 %{gccnlib}/include/objc