3 %bcond_with bootstrap # build without NaCL newlib package dependency (without c++ package)
6 Summary: Various compilers (C, C++) for NaCl
9 Release: 13.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: e72fed38d5b93e4505c1a05c69ab0796
14 Source1: get-source.sh
15 Patch0: gnu_inline-mismatch.patch
16 URL: http://sourceware.org/gcc/
17 BuildRequires: cloog-ppl-devel
18 BuildRequires: crossnacl-binutils
19 BuildRequires: elfutils-devel
20 BuildRequires: gmp-c++-devel
21 BuildRequires: gmp-devel
22 BuildRequires: mpfr-devel
23 BuildRequires: perl-tools-pod
24 BuildRequires: tar >= 1:1.22
26 BuildConflicts: cloog-isl-devel
27 %if %{without bootstrap}
28 BuildRequires: crossnacl-newlib
30 ExclusiveArch: %{ix86} %{x8664}
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define target x86_64-nacl
34 %define arch %{_prefix}/%{target}
35 %define gcc_ver %{version}
36 %define gcclib %{_libdir}/gcc/%{target}/%{gcc_ver}
37 %define gccnlib %{_prefix}/lib/gcc/%{target}/%{gcc_ver}
39 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
40 %define filterout_c -Werror=format-security
43 The gcc package contains the GNU Compiler Collection version 4.4.3.
44 You'll need this package in order to compile C code.
46 This provides support for NaCl targets.
49 Summary: C++ support for crossnacl-gcc
50 Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc
51 Group: Development/Languages
52 Requires: %{name} = %{version}-%{release}
55 This package adds C++ support to the GNU Compiler Collection for NaCl
58 %description c++ -l pl.UTF-8
59 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
62 Summary: NaCL binary utility development utilities - objc
63 Summary(pl.UTF-8): Zestaw narzędzi NaCL - objc
64 Group: Development/Languages
65 Requires: %{name} = %{version}-%{release}
68 This package contains cross targeted objc compiler.
70 %description objc -l pl.UTF-8
71 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
74 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
79 install -d obj-%{target}
82 OPT_FLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64 -fgnu89-inline"
83 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
85 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
87 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
90 *-fasynchronous-unwind-tables*)
91 %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
96 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
100 --infodir=%{_infodir} \
101 --libexecdir=%{_libdir} \
102 --enable-checking=release \
104 --enable-__cxa_atexit \
105 --disable-libunwind-exceptions \
106 --enable-gnu-unique-object \
107 --disable-decimal-float \
109 --disable-libmudflap \
111 --disable-libstdcxx-pch \
113 --with-ppl --with-cloog \
116 CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
117 CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
118 XCFLAGS="$OPT_FLAGS" \
119 %if %{with bootstrap}
121 --enable-languages="c" \
123 CFLAGS_FOR_TARGET="-O2 -g" \
124 CXXFLAGS_FOR_TARGET="-O2 -g" \
126 CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
127 CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
128 --enable-threads=nacl \
129 --enable-languages="c,c++,objc" \
134 --with-host-libstdcxx="-lstdc++ -lm" \
135 --disable-ppl-version-check \
139 BOOT_CFLAGS="$OPT_FLAGS" \
140 %if %{with bootstrap}
141 all-gcc all-target-libgcc
147 rm -rf $RPM_BUILD_ROOT
150 %if %{with bootstrap}
151 install-gcc install-target-libgcc \
155 DESTDIR=$RPM_BUILD_ROOT
157 # move fixed includes to proper place
158 mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include
160 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed
161 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools
163 # Delete supplemental files that would conflict with the core toolchain
164 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
165 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
166 # I suspect that the core toolchain locale files will work with this reasonably well.
167 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
169 # Don't dupe the system libiberty.a
170 %if %{without bootstrap}
171 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
172 %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a
176 rm -rf $RPM_BUILD_ROOT
179 %defattr(644,root,root,755)
181 %attr(755,root,root) %{_bindir}/%{target}-cpp
182 %attr(755,root,root) %{_bindir}/%{target}-gcc
183 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver}
184 %attr(755,root,root) %{_bindir}/%{target}-gccbug
185 %attr(755,root,root) %{_bindir}/%{target}-gcov
187 %if "%{_lib}" != "lib"
188 %dir %{_prefix}/lib/gcc
189 %dir %{_prefix}/lib/gcc/%{target}
194 %dir %{gccnlib}/include
195 %{gccnlib}/include/*.h
200 %dir %{_libexecdir}/gcc/%{target}
202 %attr(755,root,root) %{gcclib}/cc1
203 %attr(755,root,root) %{gcclib}/collect2
205 %if "%{_lib}" != "lib"
206 # not present on ix86, not needed?
207 %dir %{gcclib}/install-tools
208 %attr(755,root,root) %{gcclib}/install-tools/*
211 %{_mandir}/man1/%{target}-cpp.*
212 %{_mandir}/man1/%{target}-gcc.*
213 %{_mandir}/man1/%{target}-gcov.*
215 %if %{without bootstrap}
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_bindir}/%{target}-c++
219 %attr(755,root,root) %{_bindir}/%{target}-g++
220 %attr(755,root,root) %{gcclib}/cc1plus
221 %{_prefix}/%{target}/include/c++
222 %dir %{_prefix}/%{target}/lib32
223 %dir %{_prefix}/%{target}/lib64
224 %{_prefix}/%{target}/lib*/libstdc++.*a
225 %{_prefix}/%{target}/lib*/libsupc++.*a
226 %{_mandir}/man1/%{target}-g++.*
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{gcclib}/cc1obj
231 %{_prefix}/%{target}/lib*/libobjc.*a
232 %{gccnlib}/include/objc