]>
Commit | Line | Data |
---|---|---|
67a2078c ER |
1 | # |
2 | # Conditional build: | |
9da9bef5 | 3 | %bcond_with bootstrap # build without NaCL newlib package dependency (without c++ package) |
67a2078c | 4 | |
9da9bef5 ER |
5 | %define gitver 3937565 |
6 | Summary: Various compilers (C, C++) for NaCl | |
67a2078c ER |
7 | Name: crossnacl-gcc |
8 | Version: 4.4.3 | |
9da9bef5 | 9 | Release: 6.git%{gitver} |
e0a44550 | 10 | License: GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions |
67a2078c ER |
11 | Group: Development/Languages |
12 | Source0: nacl-gcc-%{version}-git%{gitver}.tar.bz2 | |
9da9bef5 | 13 | # Source0-md5: fcdfdd30b82d8ad8fa6e39e7e32cee64 |
ced35f34 | 14 | Source1: get-source.sh |
67a2078c ER |
15 | URL: http://sourceware.org/gcc/ |
16 | BuildRequires: cloog-ppl-devel | |
17 | BuildRequires: crossnacl-binutils | |
18 | BuildRequires: elfutils-devel | |
c7c82c28 | 19 | BuildRequires: gmp-c++-devel |
67a2078c ER |
20 | BuildRequires: gmp-devel |
21 | BuildRequires: mpfr-devel | |
22 | BuildRequires: ppl-pwl-devel | |
9c139859 ER |
23 | BuildRequires: tar >= 1:1.22 |
24 | BuildRequires: xz | |
67a2078c | 25 | %if %{without bootstrap} |
56fc8967 | 26 | BuildRequires: crossnacl-newlib |
67a2078c ER |
27 | %endif |
28 | ExclusiveArch: %{ix86} %{x8664} | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
fd91e679 ER |
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} | |
36 | ||
37 | %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+ | |
67a2078c ER |
38 | |
39 | %description | |
40 | The gcc package contains the GNU Compiler Collection version 4.4.3. | |
e0a44550 ER |
41 | You'll need this package in order to compile C code. |
42 | ||
43 | This provides support for NaCl targets. | |
44 | ||
45 | %package c++ | |
46 | Summary: C++ support for crossnacl-gcc | |
47 | Summary(pl.UTF-8): Obsługa C++ dla crossnacl-gcc | |
48 | Group: Development/Languages | |
49 | Requires: %{name} = %{version}-%{release} | |
50 | ||
51 | %description c++ | |
52 | This package adds C++ support to the GNU Compiler Collection for NaCl | |
53 | targets. | |
54 | ||
55 | %description c++ -l pl.UTF-8 | |
56 | Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL. | |
67a2078c | 57 | |
56fc8967 ER |
58 | %package objc |
59 | Summary: NaCL binary utility development utilities - objc | |
60 | Summary(pl.UTF-8): Zestaw narzędzi NaCL - objc | |
61 | Group: Development/Languages | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | ||
64 | %description objc | |
65 | This package contains cross targeted objc compiler. | |
66 | ||
67 | %description objc -l pl.UTF-8 | |
68 | Ten pakiet zawiera kompilator objc generujący kod pod Win32. | |
69 | ||
67a2078c ER |
70 | %prep |
71 | %setup -q -n nacl-gcc-%{version}-git%{?gitver} | |
72 | ||
73 | %build | |
fd91e679 ER |
74 | rm -rf obj-%{target} |
75 | install -d obj-%{target} | |
76 | cd obj-%{target} | |
77 | ||
78 | OPT_FLAGS="%{rpmcflags}" | |
79 | OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g') | |
67a2078c | 80 | %ifarch %{ix86} |
fd91e679 | 81 | OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g') |
67a2078c | 82 | %endif |
fd91e679 ER |
83 | OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g') |
84 | ||
67a2078c ER |
85 | case "$OPT_FLAGS" in |
86 | *-fasynchronous-unwind-tables*) | |
87 | %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \ | |
88 | ../gcc/Makefile.in | |
89 | ;; | |
90 | esac | |
91 | ||
92 | GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h" | |
93 | ../configure \ | |
94 | --prefix=%{_prefix} \ | |
95 | --mandir=%{_mandir} \ | |
96 | --infodir=%{_infodir} \ | |
97 | --libexecdir=%{_libdir} \ | |
98 | --enable-checking=release \ | |
fd91e679 ER |
99 | --with-system-zlib \ |
100 | --enable-__cxa_atexit \ | |
101 | --disable-libunwind-exceptions \ | |
67a2078c ER |
102 | --enable-gnu-unique-object \ |
103 | --disable-decimal-float \ | |
104 | --disable-libgomp \ | |
105 | --disable-libmudflap \ | |
106 | --disable-libssp \ | |
107 | --disable-libstdcxx-pch \ | |
108 | --disable-shared \ | |
109 | --with-ppl --with-cloog \ | |
fd91e679 | 110 | CC="%{__cc}" \ |
67a2078c | 111 | CFLAGS="$OPT_FLAGS $GCC_DEFINES" \ |
fd91e679 | 112 | CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \ |
67a2078c ER |
113 | XCFLAGS="$OPT_FLAGS" \ |
114 | %if %{with bootstrap} | |
115 | --disable-threads \ | |
116 | --enable-languages="c" \ | |
117 | --without-headers \ | |
118 | CFLAGS_FOR_TARGET="-O2 -g" \ | |
119 | CXXFLAGS_FOR_TARGET="-O2 -g" \ | |
120 | %else | |
121 | CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \ | |
122 | CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \ | |
123 | --enable-threads=nacl \ | |
124 | --enable-languages="c,c++,objc" \ | |
125 | --enable-tls \ | |
126 | --with-newlib \ | |
127 | %endif | |
fd91e679 | 128 | --target=%{target} \ |
67a2078c ER |
129 | --with-host-libstdcxx="-lpwl -lstdc++ -lm" \ |
130 | --disable-ppl-version-check \ | |
131 | --disable-libgcj | |
132 | ||
133 | %{__make} \ | |
134 | BOOT_CFLAGS="$OPT_FLAGS" \ | |
135 | %if %{with bootstrap} | |
136 | all-gcc all-target-libgcc | |
137 | %else | |
138 | all | |
139 | %endif | |
140 | ||
141 | %install | |
142 | rm -rf $RPM_BUILD_ROOT | |
fd91e679 | 143 | cd obj-%{target} |
67a2078c ER |
144 | %{__make} \ |
145 | %if %{with bootstrap} | |
146 | install-gcc install-target-libgcc \ | |
147 | %else | |
148 | install \ | |
149 | %endif | |
150 | DESTDIR=$RPM_BUILD_ROOT | |
151 | ||
fd91e679 ER |
152 | # move fixed includes to proper place |
153 | mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include | |
154 | ||
155 | %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed | |
156 | %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools | |
157 | ||
67a2078c ER |
158 | # Delete supplemental files that would conflict with the core toolchain |
159 | %{__rm} -r $RPM_BUILD_ROOT%{_infodir} | |
fd91e679 | 160 | %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7 |
67a2078c | 161 | # I suspect that the core toolchain locale files will work with this reasonably well. |
fd91e679 | 162 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir} |
67a2078c ER |
163 | |
164 | # Don't dupe the system libiberty.a | |
56fc8967 ER |
165 | %if %{without bootstrap} |
166 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a | |
167 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a | |
168 | %endif | |
67a2078c ER |
169 | |
170 | %clean | |
171 | rm -rf $RPM_BUILD_ROOT | |
172 | ||
173 | %files | |
174 | %defattr(644,root,root,755) | |
9d6e1e82 | 175 | %doc gcc/README* |
fd91e679 ER |
176 | %attr(755,root,root) %{_bindir}/%{target}-cpp |
177 | %attr(755,root,root) %{_bindir}/%{target}-gcc | |
178 | %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver} | |
179 | %attr(755,root,root) %{_bindir}/%{target}-gccbug | |
180 | %attr(755,root,root) %{_bindir}/%{target}-gcov | |
181 | ||
d61b80ce | 182 | %if "%{_lib}" != "lib" |
3aa02591 | 183 | %dir %{_prefix}/lib/gcc |
fd91e679 ER |
184 | %dir %{_prefix}/lib/gcc/%{target} |
185 | %dir %{gccnlib} | |
d61b80ce ER |
186 | %endif |
187 | ||
ebd86527 | 188 | %{gccnlib}/*.[ao] |
56fc8967 ER |
189 | %dir %{gccnlib}/include |
190 | %{gccnlib}/include/*.h | |
fd91e679 ER |
191 | |
192 | %dir %{gccnlib}/32 | |
193 | %{gccnlib}/32/*.[oa] | |
194 | ||
195 | %dir %{_libexecdir} | |
196 | %dir %{_libexecdir}/gcc | |
ebd86527 | 197 | %dir %{_libexecdir}/gcc/%{target} |
fd91e679 ER |
198 | %dir %{gcclib} |
199 | %attr(755,root,root) %{gcclib}/cc1 | |
200 | %attr(755,root,root) %{gcclib}/collect2 | |
201 | ||
d61b80ce ER |
202 | %if "%{_lib}" != "lib" |
203 | # not present on ix86, not needed? | |
fd91e679 ER |
204 | %dir %{gcclib}/install-tools |
205 | %attr(755,root,root) %{gcclib}/install-tools/* | |
d61b80ce | 206 | %endif |
fd91e679 ER |
207 | |
208 | %{_mandir}/man1/%{target}-cpp.* | |
209 | %{_mandir}/man1/%{target}-gcc.* | |
210 | %{_mandir}/man1/%{target}-gcov.* | |
67a2078c ER |
211 | |
212 | %if %{without bootstrap} | |
e0a44550 ER |
213 | %files c++ |
214 | %defattr(644,root,root,755) | |
fd91e679 ER |
215 | %attr(755,root,root) %{_bindir}/%{target}-c++ |
216 | %attr(755,root,root) %{_bindir}/%{target}-g++ | |
56fc8967 | 217 | %attr(755,root,root) %{gcclib}/cc1plus |
fd91e679 | 218 | %{_prefix}/%{target}/include/c++ |
56fc8967 ER |
219 | %dir %{_prefix}/%{target}/lib32 |
220 | %dir %{_prefix}/%{target}/lib64 | |
221 | %{_prefix}/%{target}/lib*/libstdc++.*a | |
222 | %{_prefix}/%{target}/lib*/libsupc++.*a | |
fd91e679 | 223 | %{_mandir}/man1/%{target}-g++.* |
56fc8967 ER |
224 | |
225 | %files objc | |
226 | %defattr(644,root,root,755) | |
227 | %attr(755,root,root) %{gcclib}/cc1obj | |
228 | %{_prefix}/%{target}/lib*/libobjc.*a | |
229 | %{gccnlib}/include/objc | |
67a2078c | 230 | %endif |