1 |
fox2mike 06/02/26 15:17:34 |
2 |
|
3 |
Added: xml/htdocs/doc/en/handbook/draft handbook-mips.xml |
4 |
hb-install-mips-bootloader.xml |
5 |
hb-install-mips-disk.xml hb-install-mips-kernel.xml |
6 |
hb-install-mips-medium.xml |
7 |
hb-install-mips-stage.xml |
8 |
Log: |
9 |
mips stuff for 2006.0 |
10 |
|
11 |
Revision Changes Path |
12 |
1.20 +94 -27 xml/htdocs/doc/en/handbook/draft/handbook-mips.xml |
13 |
|
14 |
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/handbook-mips.xml?rev=1.20&content-type=text/x-cvsweb-markup&cvsroot=gentoo |
15 |
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/handbook-mips.xml?rev=1.20&content-type=text/plain&cvsroot=gentoo |
16 |
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/handbook-mips.xml.diff?r1=1.19&r2=1.20&cvsroot=gentoo |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
1.13 +673 -38 xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml |
22 |
|
23 |
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml?rev=1.13&content-type=text/x-cvsweb-markup&cvsroot=gentoo |
24 |
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml?rev=1.13&content-type=text/plain&cvsroot=gentoo |
25 |
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml.diff?r1=1.12&r2=1.13&cvsroot=gentoo |
26 |
|
27 |
|
28 |
|
29 |
|
30 |
1.10 +304 -32 xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml |
31 |
|
32 |
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=gentoo |
33 |
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml?rev=1.10&content-type=text/plain&cvsroot=gentoo |
34 |
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml.diff?r1=1.9&r2=1.10&cvsroot=gentoo |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
1.10 +245 -263 xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml |
40 |
|
41 |
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=gentoo |
42 |
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml?rev=1.10&content-type=text/plain&cvsroot=gentoo |
43 |
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml.diff?r1=1.9&r2=1.10&cvsroot=gentoo |
44 |
|
45 |
|
46 |
|
47 |
|
48 |
1.10 +844 -184 xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml |
49 |
|
50 |
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=gentoo |
51 |
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml?rev=1.10&content-type=text/plain&cvsroot=gentoo |
52 |
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml.diff?r1=1.9&r2=1.10&cvsroot=gentoo |
53 |
|
54 |
|
55 |
|
56 |
|
57 |
1.1 xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml |
58 |
|
59 |
file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo |
60 |
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo |
61 |
|
62 |
Index: hb-install-mips-stage.xml |
63 |
=================================================================== |
64 |
<?xml version='1.0' encoding='UTF-8'?> |
65 |
<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
66 |
|
67 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
68 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
69 |
|
70 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml,v 1.1 2006/02/26 15:17:34 fox2mike Exp $ --> |
71 |
|
72 |
<sections> |
73 |
|
74 |
<version>2.5</version> |
75 |
<date>2005-11-22</date> |
76 |
|
77 |
<section> |
78 |
<title>Installing a Stage Tarball</title> |
79 |
<subsection> |
80 |
<title>Setting the Date/Time Right</title> |
81 |
<body> |
82 |
|
83 |
<p> |
84 |
Before you continue you need to check your date/time and update it. A |
85 |
misconfigured clock may lead to strange results in the future! |
86 |
</p> |
87 |
|
88 |
<p> |
89 |
To verify the current date/time, run <c>date</c>: |
90 |
</p> |
91 |
|
92 |
<pre caption="Verifying the date/time"> |
93 |
# <i>date</i> |
94 |
Fri Mar 29 16:21:18 CEST 2005 |
95 |
</pre> |
96 |
|
97 |
<p> |
98 |
If the date/time displayed is wrong, update it using the <c>date |
99 |
MMDDhhmmYYYY</c> syntax (<b>M</b>onth, <b>D</b>ay, <b>h</b>our, <b>m</b>inute |
100 |
and <b>Y</b>ear). For instance, to set the date to March 29th, 16:21 in the |
101 |
year 2005: |
102 |
</p> |
103 |
|
104 |
<pre caption="Setting the date/time"> |
105 |
# <i>date 032916212005</i> |
106 |
</pre> |
107 |
|
108 |
</body> |
109 |
</subsection> |
110 |
<subsection> |
111 |
<title>Making your Choice</title> |
112 |
<body> |
113 |
|
114 |
<p> |
115 |
The next step you need to perform is to install the <e>stage</e> tarball of |
116 |
your choice onto your system. |
117 |
<!--You have the option of downloading the required |
118 |
tarball from the Internet or, if you are booted from one of the Gentoo |
119 |
Universal Installation CDs, copy it over from the CD itself. If you have a |
120 |
Universal CD and the stage you want to use is on the CD, downloading it from |
121 |
the Internet is just a waste of bandwidth as the stage files are the same. In |
122 |
most cases, the command <c>uname -m</c> can be used to help you decide which |
123 |
stage file to download. --> |
124 |
</p> |
125 |
|
126 |
<!-- |
127 |
<ul> |
128 |
<li><uri link="#doc_chap2">Default: Using a Stage from the Internet</uri></li> |
129 |
<li> |
130 |
<uri link="#doc_chap3">Alternative: Using a Stage from the Installation CD</uri> |
131 |
</li> |
132 |
</ul>--> |
133 |
|
134 |
</body> |
135 |
</subsection> |
136 |
</section> |
137 |
<section> |
138 |
<title>Using a Stage from the Internet</title> |
139 |
<subsection> |
140 |
<title>Downloading the Stage Tarball</title> |
141 |
<body> |
142 |
|
143 |
<p> |
144 |
Go to the Gentoo mountpoint at which you mounted your filesystems |
145 |
(most likely <path>/gentoo</path>): |
146 |
</p> |
147 |
|
148 |
<pre caption="Going to the Gentoo mountpoint"> |
149 |
# <i>cd /gentoo</i> |
150 |
</pre> |
151 |
|
152 |
<p> |
153 |
The table below specifies exactly which stages you need for your system. |
154 |
Stages may be downloaded |
155 |
off the <uri link="/main/en/mirrors.xml">official Gentoo mirrors</uri> under the |
156 |
<c>releases/mips/current</c> directory. |
157 |
</p> |
158 |
|
159 |
<table> |
160 |
<tr> |
161 |
<th>Endianness</th> |
162 |
<th>CPU</th> |
163 |
<th>Location</th> |
164 |
</tr> |
165 |
<tr> |
166 |
<ti> |
167 |
Big Endian<br /> |
168 |
<e>(SGI Users)</e> |
169 |
</ti> |
170 |
<ti> |
171 |
R4000<br /> |
172 |
R4400<br /> |
173 |
R4600 |
174 |
</ti> |
175 |
<ti><c>mips3/stage#-mips3-RELEASE.tar.bz2</c></ti> |
176 |
</tr> |
177 |
<tr> |
178 |
<ti> |
179 |
Big Endian<br /> |
180 |
<e>(SGI Users)</e> |
181 |
</ti> |
182 |
<ti> |
183 |
R5000<br /> |
184 |
RM5200<br /> |
185 |
RM7000<br /> |
186 |
R10000<br /> |
187 |
R12000<br /> |
188 |
R14000 |
189 |
</ti> |
190 |
<ti><c>mips4/stage#-mips4-RELEASE.tar.bz2</c></ti> |
191 |
</tr> |
192 |
<tr> |
193 |
<ti> |
194 |
Little Endian<br /> |
195 |
<e>(Cobalt Users)</e> |
196 |
</ti> |
197 |
<ti> |
198 |
RM5230<br /> |
199 |
RM5231 |
200 |
</ti> |
201 |
<ti><c>cobalt/stage#-mipsel4-RELEASE.tar.bz2</c></ti> |
202 |
</tr> |
203 |
</table> |
204 |
|
205 |
<p> |
206 |
If you need to go through a proxy, export the <c>http_proxy</c> and |
207 |
<c>ftp_proxy</c> variables: |
208 |
</p> |
209 |
|
210 |
<pre caption="Setting proxy information for wget"> |
211 |
# <i>export http_proxy="http://proxy.server.com:port"</i> |
212 |
# <i>export ftp_proxy="http://proxy.server.com:port"</i> |
213 |
</pre> |
214 |
|
215 |
<p> |
216 |
The Gentoo/MIPS netboot images provide <c>wget</c> as a means of downloading |
217 |
files. Due to space constraints, it is not possible to provide more capable |
218 |
browsers on SGI netboot images. LiveCD users may use <c>elinks</c>. |
219 |
</p> |
220 |
|
221 |
<pre caption="Fetching the tarball via wget"> |
222 |
# <i>wget -c http://distfiles.gentoo.org/releases/mips/mips4/stage3-mips4-2005.1.tar.bz2</i> |
223 |
</pre> |
224 |
|
225 |
<p> |
226 |
If you want to check the integrity of the downloaded stage tarball, use |
227 |
<c>md5sum</c> and compare the output with the MD5 checksum provided on the |
228 |
mirror. For instance, to check the validity of the mips4 stage tarball: |
229 |
</p> |
230 |
|
231 |
<pre caption="Example checking integrity of a stage tarball"> |
232 |
# <i>md5sum -c stage3-mips4-2005.1.tar.bz2.md5</i> |
233 |
stage3-mips4-2005.1.tar.bz2: OK |
234 |
</pre> |
235 |
|
236 |
</body> |
237 |
</subsection> |
238 |
<subsection> |
239 |
<title>Unpacking the Stage Tarball</title> |
240 |
<body> |
241 |
|
242 |
<p> |
243 |
Now unpack your downloaded stage onto your system. We use GNU's <c>tar</c> to |
244 |
proceed as it is the easiest method: |
245 |
</p> |
246 |
|
247 |
<pre caption="Unpacking the stage"> |
248 |
# <i>tar -xjpf stage?-*.tar.bz2</i> |
249 |
</pre> |
250 |
|
251 |
<p> |
252 |
Make sure that you use the same options (<c>-xjpf</c>). The <c>x</c> stands for |
253 |
<e>Extract</e>, the <c>j</c> for <e>Decompress with bzip2</e>, the <c>p</c> for |
254 |
<e>Preserve permissions</e> and the <c>f</c> to denote that we want to extract |
255 |
a file, not standard input. |
256 |
</p> |
257 |
|
258 |
<p> |
259 |
Now that the stage is installed, continue with <uri |
260 |
link="#installing_portage">Installing Portage</uri>. |
261 |
</p> |
262 |
|
263 |
</body> |
264 |
</subsection> |
265 |
</section> |
266 |
<!-- |
267 |
<section> |
268 |
<title>Alternative: Using a Stage from the Installation CD</title> |
269 |
<subsection> |
270 |
<title>Extracting the Stage Tarball</title> |
271 |
<body> |
272 |
|
273 |
<p> |
274 |
The stages on the CD reside in the <path>/mnt/cdrom/stages</path> directory. To |
275 |
see a listing of available stages, use <c>ls</c>: |
276 |
</p> |
277 |
|
278 |
<pre caption="List all available stages"> |
279 |
# <i>ls /mnt/cdrom/stages</i> |
280 |
</pre> |
281 |
|
282 |
<p> |
283 |
If the system replies with an error, you may need to mount the CD-ROM first: |
284 |
</p> |
285 |
|
286 |
<pre caption="Mounting the CD-ROM"> |
287 |
# <i>ls /mnt/cdrom/stages</i> |
288 |
ls: /mnt/cdrom/stages: No such file or directory |
289 |
# <i>mount /dev/cdroms/cdrom0 /mnt/cdrom</i> |
290 |
# <i>ls /mnt/cdrom/stages</i> |
291 |
</pre> |
292 |
|
293 |
<p> |
294 |
Now go into your Gentoo mountpoint (usually <path>/mnt/gentoo</path>): |
295 |
</p> |
296 |
|
297 |
<pre caption="Changing directory to /mnt/gentoo"> |
298 |
# <i>cd /mnt/gentoo</i> |
299 |
</pre> |
300 |
|
301 |
<p> |
302 |
We will now extract the stage tarball of your choice. We will do this with the |
303 |
GNU <c>tar</c> tool. Make sure you use the same options (<c>-xvjpf</c>)! Again, |
304 |
the <c>v</c> argument is optional and not supported in some <c>tar</c> versions. |
305 |
In the next example, we extract the stage tarball |
306 |
<path>stage3-<subarch>-2005.1.tar.bz2</path>. |
307 |
Be sure to substitute the tarball filename with your stage. |
308 |
</p> |
309 |
|
310 |
<pre caption="Extracting the stage tarball"> |
311 |
# <i>tar -xvjpf /mnt/cdrom/stages/stage3-<subarch>-2005.1.tar.bz2</i> |
312 |
</pre> |
313 |
|
314 |
<!- - 2005.1: stage3 for athlon xp, pentium3 and pentium4 are b0rked - -> |
315 |
<warn> |
316 |
The <path>stage3-athlon-xp-2005.1.tar.bz2</path>, |
317 |
<path>stage3-pentium3-2005.1.tar.bz2</path> and |
318 |
<path>stage3-pentium4-2005.1.tar.bz2</path> files have a serious permission |
319 |
error. After extracting any of these, run <c>chmod 0755 /mnt/gentoo</c> to fix |
320 |
the error <e>before</e> continuing with the installation. |
321 |
</warn> |
322 |
|
323 |
<p> |
324 |
Now that the stage is installed, continue with <uri |
325 |
link="#installing_portage">Installing Portage</uri>. |
326 |
</p> |
327 |
|
328 |
</body> |
329 |
</subsection> |
330 |
</section>--> |
331 |
<section id="installing_portage"> |
332 |
<title>Installing Portage</title> |
333 |
<subsection> |
334 |
<title>Unpacking a Portage Snapshot</title> |
335 |
<body> |
336 |
|
337 |
<p> |
338 |
You now have to install a Portage snapshot, a collection of files that inform |
339 |
Portage what software titles you can install, which profiles are available, etc. |
340 |
</p> |
341 |
|
342 |
</body> |
343 |
</subsection> |
344 |
<subsection id="installing_from_Internet"> |
345 |
<title>Download and Install a Portage Snapshot</title> |
346 |
<body> |
347 |
|
348 |
<p> |
349 |
Go to the mountpoint where you mounted your filesystem (most likely |
350 |
<path>/gentoo</path>): |
351 |
</p> |
352 |
|
353 |
<pre caption="Going to the Gentoo mountpoint"> |
354 |
# <i>cd /gentoo</i> |
355 |
</pre> |
356 |
|
357 |
<p> |
358 |
Download a portage snapshot from a <uri |
359 |
link="/main/en/mirrors.xml">local mirror</uri>. |
360 |
You'll find them in the <path>snapshots/</path> directory. Transfer it to the |
361 |
target system in the same manner that you did for the stage tarball. |
362 |
</p> |
363 |
|
364 |
<pre caption="Extracting the Portage snapshot"> |
365 |
# <i>tar -xjf portage-*.tar.bz2 -C /gentoo/usr</i> |
366 |
</pre> |
367 |
|
368 |
</body> |
369 |
</subsection> |
370 |
</section> |
371 |
|
372 |
<section id="compile_options"> |
373 |
<title>Configuring the Compile Options</title> |
374 |
<subsection> |
375 |
<title>Introduction</title> |
376 |
<body> |
377 |
|
378 |
<p> |
379 |
To optimize Gentoo, you can set a couple of variables which impact Portage |
380 |
behaviour. All those variables can be set as environment variables (using |
381 |
<c>export</c>) but that isn't permanent. To keep your settings, Portage provides |
382 |
you with <path>/etc/make.conf</path>, a configuration file for Portage. It is |
383 |
this file we will edit now. |
384 |
</p> |
385 |
|
386 |
<note> |
387 |
A commented listing of all possible variables can be found in |
388 |
<path>/gentoo/etc/make.conf.example</path>. For a successful Gentoo |
389 |
installation you'll only need to set the variables which are mentioned beneath. |
390 |
</note> |
391 |
|
392 |
<p> |
393 |
Fire up a text editor so we can alter the optimization variables we will discuss |
394 |
hereafter. Two editors are provided, <c>vi</c> (part of Busybox) and |
395 |
<c>nano</c>. We will assume you're using <c>nano</c>. |
396 |
</p> |
397 |
|
398 |
<pre caption="Opening /etc/make.conf"> |
399 |
# <i>nano -w /gentoo/etc/make.conf</i> |
400 |
</pre> |
401 |
|
402 |
<p> |
403 |
As you probably noticed, the <path>make.conf.example</path> file is |
404 |
structured in a generic way: commented lines start with "#", other lines define |
405 |
variables using the <c>VARIABLE="content"</c> syntax. The <path>make.conf</path> |
406 |
file uses the same syntax. Several of those variables are discussed next. |
407 |
</p> |
408 |
|
409 |
</body> |
410 |
</subsection> |
411 |
<!--<subsection> |
412 |
<title>CHOST</title> |
413 |
<body> |
414 |
|
415 |
<warn> |
416 |
Although it might be tempting for non-stage1 users, they should <e>not</e> |
417 |
change the <c>CHOST</c> setting in <path>make.conf</path>. Doing so might render |
418 |
their system unusable. Again: only change this variable if you use a |
419 |
<e>stage1</e> installation. |
420 |
</warn> |
421 |
|
422 |
<p> |
423 |
The <c>CHOST</c> variable defines what architecture <c>gcc</c> has to |
424 |
compile programs for, as well as the <c>libc</c> (<c>glibc</c> or <c>µClibc</c>) used |
425 |
for linking. |
426 |
</p> |
427 |
|
428 |
<table> |
429 |
<tr> |
430 |
<th>Endianness</th> |
431 |
<th>Userland/ABI</th> |
432 |
<th>CHOST Setting</th> |
433 |
</tr> |
434 |
<tr> |
435 |
<ti>Big Endian <e>(SGI Users)</e></ti> |
436 |
<ti><c>glibc</c> <c>o32</c></ti> |
437 |
<ti>mips-unknown-linux-gnu</ti> |
438 |
</tr> |
439 |
<tr> |
440 |
<ti>Big Endian <e>(SGI Users)</e></ti> |
441 |
<ti><c>µClibc</c> <c>o32</c></ti> |
442 |
<ti>mips-unknown-linux-uclibc (1)</ti> |
443 |
</tr> |
444 |
<tr> |
445 |
<ti>Big Endian <e>(SGI Users)</e></ti> |
446 |
<ti><c>glibc</c> <c>n32</c> & <c>n64</c></ti> |
447 |
<ti>mips64-unknown-linux-gnu (2)</ti> |
448 |
</tr> |
449 |
<tr> |
450 |
<ti>Little Endian <e>(Cobalt Users)</e></ti> |
451 |
<ti><c>glibc</c> <c>o32</c></ti> |
452 |
<ti>mipsel-unknown-linux-gnu</ti> |
453 |
</tr> |
454 |
<tr> |
455 |
<ti>Little Endian <e>(Cobalt Users)</e></ti> |
456 |
<ti><c>µClibc</c> <c>o32</c></ti> |
457 |
<ti>mipsel-unknown-linux-uclibc (1)</ti> |
458 |
</tr> |
459 |
<tr> |
460 |
<ti>Little Endian <e>(Cobalt Users)</e></ti> |
461 |
<ti><c>glibc</c> <c>n32</c> & <c>n64</c></ti> |
462 |
<ti>mips64el-unknown-linux-gnu (2)</ti> |
463 |
</tr> |
464 |
</table> |
465 |
|
466 |
<warn> |
467 |
(1) µClibc stages are the realm of the |
468 |
<uri link="/proj/en/base/embedded/">Gentoo Embedded</uri> |
469 |
team, and are therefore not officially supported by the |
470 |
Gentoo/MIPS team. This <c>CHOST</c> setting is only mentioned here for |
471 |
completeness. |
472 |
</warn> |
473 |
|
474 |
<warn> |
475 |
(2) Currently we do not provide <c>n64</c> stages, and only provide <c>n32</c> |
476 |
stages on the Big Endian MIPS4 architecture. These are highly experimental |
477 |
stages and are known to be totally broken in places. Users are thus |
478 |
<e>highly</e> recommended to avoid these like the plague. |
479 |
The only reason one would need the <c>mips64(el)</c> <c>CHOST</c>, is to use a |
480 |
64-bit (<c>n32</c> or <c>n64</c>) userland. This <c>CHOST</c> setting is only |
481 |
mentioned here for completeness. |
482 |
</warn> |
483 |
|
484 |
</body> |
485 |
</subsection>--> |
486 |
<subsection> |
487 |
<title>CFLAGS and CXXFLAGS</title> |
488 |
<body> |
489 |
|
490 |
<p> |
491 |
The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags |
492 |
for the <c>gcc</c> C and C++ compiler respectively. Although we define those |
493 |
generally here, you will only have maximum performance if you optimize these |
494 |
flags for each program separately. The reason for this is because every program |
495 |
is different. |
496 |
</p> |
497 |
|
498 |
<p> |
499 |
In <path>make.conf</path> you should define the optimization flags you think |
500 |
will make your system the most responsive <e>generally</e>. Don't place |
501 |
experimental settings in this variable; too much optimization can make |
502 |
programs behave bad (crash, or even worse, malfunction). |
503 |
</p> |
504 |
|
505 |
<p> |
506 |
We will not explain all possible optimization options. If you want to know |
507 |
them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU |
508 |
Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only |
509 |
works on a working Linux system). The <path>make.conf.example</path> file |
510 |
itself also contains lots of examples and information; don't forget to read it |
511 |
too. |
512 |
</p> |
513 |
|
514 |
<p> |
515 |
A first setting is the <c>-march=</c> flag, which specifies the name of the |
516 |
target architecture. Possible options are described in the |
517 |
<path>make.conf.example</path> file (as comments). Examples include ISA levels |
518 |
(<c>mips1</c> ... <c>mips4</c>) and CPU models (<c>r4400</c>, <c>r4600</c> ... |
519 |
etc). For pure ISA level architectures, one can simply specify <c>-mips3</c> |
520 |
rather than <c>-march=mips3</c>. |
521 |
</p> |
522 |
|
523 |
<pre caption="The GCC -march and -mips# settings"> |
524 |
<comment>(For an R4600 system...)</comment> |
525 |
-march=r4600 |
526 |
|
527 |
<comment>(Any MIPS4-class CPU...)</comment> |
528 |
-march=mips4 |
529 |
|
530 |
<comment>(Or just specify the ISA level directly...)</comment> |
531 |
-mips4 |
532 |
</pre> |
533 |
|
534 |
<p> |
535 |
A second one is the <c>-O</c> flag (that is a capital O, not a zero), |
536 |
which specifies the <c>gcc</c> optimization |
537 |
class flag. Possible classes are <c>s</c> (for size-optimized), |
538 |
<c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more |
539 |
speed-optimization flags (every class has the same flags as the one before, plus |
540 |
some extras). For instance, for a class-2 optimization: |
541 |
</p> |
542 |
|
543 |
<pre caption="The GCC O setting"> |
544 |
-O2 |
545 |
</pre> |
546 |
|
547 |
<p> |
548 |
A very important setting in the MIPS world, is the <c>-mabi=</c> flag. MIPS has |
549 |
3 different ABIs; <c>32</c> (pure 32-bit, aka <c>o32</c>), <c>64</c> (full |
550 |
64-bit, aka <c>n64</c>) and <c>n32</c> |
551 |
(a mix of 32-bit data structures with 64-bit instructions). This |
552 |
flag selects which of these you wish to use. Note you need libraries for the |
553 |
ABI you select. In layman's terms, this means, for example, you can't use |
554 |
<c>-mabi=64</c> on a 32-bit userland (or even a <c>n32</c> userland). |
555 |
</p> |
556 |
|
557 |
<p> |
558 |
Another popular optimization flag is <c>-pipe</c> (use pipes rather than |
559 |
temporary files for communication between the various stages of compilation). |
560 |
</p> |
561 |
|
562 |
<p> |
563 |
Mind you that using <c>-fomit-frame-pointer</c> (which doesn't keep the frame |
564 |
pointer in a register for functions that don't need one) might have serious |
565 |
repercussions on the debugging of applications! |
566 |
</p> |
567 |
|
568 |
<p> |
569 |
When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine |
570 |
several optimization flags, like in the following example: |
571 |
</p> |
572 |
|
573 |
<pre caption="Defining the CFLAGS and CXXFLAGS variable"> |
574 |
CFLAGS="-mabi=32 -mips4 -pipe -O2" |
575 |
CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both variables</comment> |
576 |
</pre> |
577 |
|
578 |
</body> |
579 |
</subsection> |
580 |
<subsection> |
581 |
<title>MAKEOPTS</title> |
582 |
<body> |
583 |
|
584 |
<p> |
585 |
With <c>MAKEOPTS</c> you define how many parallel compilations should occur when |
586 |
you install a package. A good choice is the number of CPUs in your system plus |
587 |
one, but this guideline isn't always perfect. |
588 |
</p> |
589 |
|
590 |
<pre caption="MAKEOPTS for a regular, 1-CPU system"> |
591 |
MAKEOPTS="-j2" |
592 |
</pre> |
593 |
|
594 |
</body> |
595 |
</subsection> |
596 |
<subsection> |
597 |
<title>Ready, Set, Go!</title> |
598 |
<body> |
599 |
|
600 |
<p> |
601 |
Update your <path>/gentoo/etc/make.conf</path> to your own preference and |
602 |
save (<c>nano</c> users would hit <c>Ctrl-X</c>). You are now ready to continue |
603 |
with <uri link="?part=1&chap=6">Installing the Gentoo Base System</uri>. |
604 |
</p> |
605 |
|
606 |
</body> |
607 |
</subsection> |
608 |
</section> |
609 |
</sections> |
610 |
|
611 |
|
612 |
|
613 |
-- |
614 |
gentoo-doc-cvs@g.o mailing list |