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: 1.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-devel
28 BuildRequires: mpfr-devel
29 BuildRequires: ppl-pwl-devel
30 %if %{without bootstrap}
31 BuildRequires: nacl-newlib
33 ExclusiveArch: %{ix86} %{x8664}
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define gcc_target_platform x86_64-nacl
39 The gcc package contains the GNU Compiler Collection version 4.4.3.
40 You'll need this package in order to compile C code.
42 This provides support for NaCl targets.
45 Summary: C++ support for crossnacl-gcc
46 Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc
47 Group: Development/Languages
48 Requires: %{name} = %{version}-%{release}
51 This package adds C++ support to the GNU Compiler Collection for NaCl
54 %description c++ -l pl.UTF-8
55 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
58 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
61 rm -rf obj-%{gcc_target_platform}
62 mkdir obj-%{gcc_target_platform}
63 cd obj-%{gcc_target_platform}
65 OPT_FLAGS=`echo %{rpmcflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
66 OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
68 OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
70 OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
72 *-fasynchronous-unwind-tables*)
73 %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
78 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
82 --infodir=%{_infodir} \
83 --libexecdir=%{_libdir} \
84 --enable-checking=release \
85 --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
86 --enable-gnu-unique-object \
87 --disable-decimal-float \
89 --disable-libmudflap \
91 --disable-libstdcxx-pch \
93 --with-ppl --with-cloog \
95 CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
96 CXXFLAGS="`echo $OPT_FLAGS | sed 's/ -Wall / /g'`" \
97 XCFLAGS="$OPT_FLAGS" \
100 --enable-languages="c" \
102 CFLAGS_FOR_TARGET="-O2 -g" \
103 CXXFLAGS_FOR_TARGET="-O2 -g" \
105 CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
106 CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
107 --enable-threads=nacl \
108 --enable-languages="c,c++,objc" \
112 --target=%{gcc_target_platform} \
113 --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
114 --disable-ppl-version-check \
118 BOOT_CFLAGS="$OPT_FLAGS" \
119 %if %{with bootstrap}
120 all-gcc all-target-libgcc
126 rm -rf $RPM_BUILD_ROOT
127 cd obj-%{gcc_target_platform}
129 %if %{with bootstrap}
130 install-gcc install-target-libgcc \
134 DESTDIR=$RPM_BUILD_ROOT
136 # Delete supplemental files that would conflict with the core toolchain
137 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
138 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7/
139 # I suspect that the core toolchain locale files will work with this reasonably well.
140 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/
142 # Don't dupe the system libiberty.a
143 #%{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
146 rm -rf $RPM_BUILD_ROOT
149 %defattr(644,root,root,755)
150 %doc gcc/README* gcc/COPYING*
151 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-cpp
152 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcc
153 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcc-%{version}
154 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gccbug
155 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcov
156 %dir %{_prefix}/lib/gcc
157 %{_prefix}/lib/gcc/%{gcc_target_platform}/
158 %{_libexecdir}/gcc/%{gcc_target_platform}/
159 %{_mandir}/man1/%{gcc_target_platform}-cpp.*
160 %{_mandir}/man1/%{gcc_target_platform}-gcc.*
161 %{_mandir}/man1/%{gcc_target_platform}-gcov.*
163 %if %{without bootstrap}
165 %defattr(644,root,root,755)
166 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-c++
167 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-g++
168 %{_prefix}/%{gcc_target_platform}/include/c++
169 %{_prefix}/%{gcc_target_platform}/lib*/
170 %{_mandir}/man1/%{gcc_target_platform}-g++.*