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