docs/140444: [UPDATE] New Traditional Chinese translation of custom-gcc
Denny Lin
dennylin93 at cnmc32.hs.ntnu.edu.tw
Tue Nov 10 14:10:03 UTC 2009
>Number: 140444
>Category: docs
>Synopsis: [UPDATE] New Traditional Chinese translation of custom-gcc
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Nov 10 14:10:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Denny Lin
>Release: FreeBSD 7.2-RELEASE-p4 amd64
>Organization:
>Environment:
System: FreeBSD cnmc32.hs.ntnu.edu.tw 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #0: Mon Oct 26 19:41:45 CST 2009 root at cnmc32.hs.ntnu.edu.tw:/usr/obj/usr/src/sys/CNMC32 amd64
>Description:
New Traditional Chinese translation of "Using newer version of GCC and binutils with the FreeBSD Ports Collection."
Should be put in doc/zh_TW.Big5/articles/custom-gcc.
The attached files are also available at http://security-hole.info/~dennylin93/doc/zh_TW.Big5/articles/custom-gcc/.
>How-To-Repeat:
>Fix:
--- Makefile begins here ---
#
# $FreeBSD$
#
# Article: Using newer version of GCC and binutils with the FreeBSD Ports Collection
DOC?= article
FORMATS?= html
WITH_ARTICLE_TOC?= YES
INSTALL_COMPRESSED?= gz
INSTALL_ONLY_COMPRESSED?=
SRCS= article.sgml
URL_RELPREFIX?= ../../../..
DOC_PREFIX?= ${.CURDIR}/../../..
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
--- Makefile ends here ---
--- article.sgml begins here ---
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
<!ENTITY % articles.ent PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Articles Entity Set//EN">
%articles.ent;
]>
<article>
<articleinfo>
<title>é
å &os; Ports Collection 使ç¨æ°çæ¬ç <application>GCC</application>
è <application>binutils</application></title>
<author>
<firstname>Martin</firstname>
<surname>Matuska</surname>
<affiliation>
<address><email>mm at FreeBSD.org</email></address>
</affiliation>
</author>
<pubdate>$FreeBSD$</pubdate>
<legalnotice id="trademarks" role="trademarks">
&tm-attrib.freebsd;
&tm-attrib.general;
</legalnotice>
<copyright>
<year>2009</year>
<holder>The &os; Documentation Project</holder>
</copyright>
<abstract>
<para>æ¤ç¯æ件說æäºå¦ä½å¾ &os; ports tree 使ç¨æ°çæ¬ç
<application>GCC</application> ç·¨è¯å¨è
<application>binutils</application>ã
èªè¨ç <application>GCC</application> è¨å®ä¹æ¯æ¬æ件è¨è«ç¯åã</para>
</abstract>
</articleinfo>
<sect1 id="intro">
<title>ç°¡ä»</title>
<para>å¨ &os; 8.0 裡ï¼ç³»çµ±é è¨çç·¨è¯å¨çº <application>GCC</application>
çæ¬ 4.2.1ãé¤æ¤ä¹å¤ï¼ç³»çµ±æ¬èº«ä¹å«æ <application>binutils</application>
çæ¬ 2.15ãéäºçæ¬å·²ç¶åºå¹¾å¹´äºï¼ä¸ä¸æ¯æ´æ°ç CPU æ令éï¼å¦
<acronym>SSSE3</acronym>ã<acronym>SSE4.1</acronym>ã<acronym>SSE4.2</acronym>
çãç¤æ¼è¨±å¯èçéä¿ï¼éäºç¨å¼è¼æ°ççæ¬ä¸¦ä¸æ被移æ¤å°ç³»çµ±å
§ã幸好ï¼ä»ç¶å¯ä»¥éé
&os; ports tree 使ç¨æ°çæ¬ç <application>GCC</application> ç·¨è¯å¨ï¼å¦ï¼çæ¬
4.4ï¼ã</para>
</sect1>
<sect1 id="prerequisites">
<title>åæ</title>
<sect2 id="installing-binutils">
<title>å¾ ports å®è£ binutils</title>
<para>è¥è¦ä½¿ç¨ææ <application>GCC</application>
æ°çæ¬çåè½ï¼å¿
é å®è£ææ°çæ¬ç <application>binutils</application>ã
éç¶å®è£æ°çæ¬ç <application>binutils</application>
éå¿
è¦æ¢ä»¶ï¼ä½è¥æ²æå®è£ï¼å°ç¡æ³ä½¿ç¨æ° <acronym>CPU</acronym>
çæ令éã</para>
<para>è¥è¦å¾ &os; ports tree å®è£ææ°çæ¬ç
<application>binutils</application>ï¼è«ä¸ï¼
<screen>&prompt.root; <userinput>cd /usr/ports/devel/binutils && make install</userinput></screen>
</sect2>
<sect2 id="installing-gcc">
<title>å¾ ports å®è£ GCC</title>
<para>&os; ports tree æä¾äºæ¸ç¨®æ°çæ¬ç
<application>GCC</application>ãä¸é¢çç¯ä¾æ¯ä½¿ç¨ç©©å®ç 4.4
çæ¬ãä½æ¯ï¼å¯ä»¥å®è£ä¹åææ´æ°ççæ¬ï¼å¦ï¼
<filename role="package">lang/gcc43</filename> æ
<filename role="package">lang/gcc45</filename>ï¼ã</para>
<para>è¥è¦å®è£ä¸é¢æå°ç <application>GCC</application>
ports ä¹ä¸ï¼è«ä¸ï¼
<screen>&prompt.root; <userinput>cd /usr/ports/lang/<replaceable>gcc44</replaceable> && make install</userinput></screen>
</sect2>
</sect1>
<sect1 id="configuring-ports-gcc">
<title>è¨å® ports 使ç¨èªè¨çæ¬ç
<application>GCC</application></title>
<para>使ç¨å¾ &os; ports tree å®è£ç <application>GCC</application>
ä¹åï¼å¿
é å
åä¸äºé¡å¤çè¨å®ã<para>
<sect2 id="adjusting-make.conf">
<title>èª¿æ´ <filename>make.conf</filename></title>
<para>å°ä¸åå¹¾è¡å å
¥
<filename>/etc/make.conf</filename>
æªæ¡ï¼è¦æ
æ³èª¿æ´ï¼ï¼</para>
<programlisting>.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc44)
CC=gcc44
CXX=g++44
CPP=cpp44
.endif</programlisting>
<para>æ¤å¤ï¼å¯ä»¥æåè¨è®æ¸
<envar>${CC}</envar> è <envar>${CPP}</envar>ã</para>
<note>
<para>ä¸é¢çç¯è£¡æ¯çµ¦ <application>GCC</application>
çæ¬ 4.4ãè¥è¦ä½¿ç¨ <command>gcc43</command> å°
<literal>ãgcc44ã</literal> æ¿ææ <literal>ãgcc43ã</literal>ã
<literal>ã4.4ã</literal> æ¿ææ <literal>ã4.3ã</literal>ï¼ä»¥æ¤é¡æ¨ã</para>
</note>
</sect2>
<sect2 id="adjusting-libmap.conf">
<title>èª¿æ´ <filename>libmap.conf</filename></title>
<para>è¨±å¤ ports çå·è¡æªè libraries æé£çµå° libgcc_s
æ libstdc++ã系統已æå
§å»ºéäº librariesï¼ä½æ¯æ¯
å°±çæ¬ç <application>GCC</application>ï¼çæ¬ 4.2.1ï¼ã
rtldï¼å lddï¼æ£ç¢ºççæ¬ï¼å°ä¸åå¹¾è¡å å
¥
<filename>/etc/libmap.conf</filename> æªæ¡ï¼è¦æ
æ³èª¿æ´ï¼ï¼</para>
<programlisting>libgcc_s.so.1 gcc44/libgcc_s.so.1
libgomp.so.1 gcc44/libgomp.so.1
libobjc.so.3 gcc44/libobjc.so.2
libssp.so.0 gcc44/libssp.so.0
libstdc++.so.6 gcc44/libstdc++.so.6</programlisting>
<note>
<para>ä¸é¢çç¯ä¾æ¯éå° <application>GCC</application>
çæ¬ 4.4ãè¥è¦ä½¿ç¨ <command>gcc43</command>ï¼å°
<literal>ãgcc44ã</literal> æ¿ææ
<literal>ãgcc43ã</literal>ï¼ä»¥æ¤é¡æ¨ãå¼å¾æ³¨æçæ¯ï¼éäº
libraries é½è系統æ¬èº«ç libraries ç¸å®¹ã</para>
</note>
<warning>
<para>æäº C++ è¥éäº libraries æ²æè¨å®å¥½ï¼å¯ä»¥ç¡æ³å·è¡ã
è¥æ²æ辦æ³å°ææç libraries è¨å®å¥½ï¼å»ºè°è³å° libstdc++.so
è¦æ£ç¢ºã</para>
</warning>
</sect2>
<sect2 id="custom-cflags">
<title>èªè¨ ports tree 使ç¨ç <literal>CFLAGS</literal></title>
<para>è¥è¦éå° ports tree å èªè¨ï¼ç³»çµ±å
§å»ºä¸æ¯æ´ï¼ç
<literal>CFLAGS</literal>ï¼ç
§èç¯ä¾èª¿æ´
<filename>/etc/make.conf</filename>ï¼</para>
<programlisting>.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc44)
CC=gcc44
CXX=g++44
CPP=cpp44
CFLAGS+=-mssse3
.endif</programlisting>
<para>å¯ä»¥å®å
¨å代
<literal>CFLAGS</literal>ï¼ä¹å¯ä»¥è¨å®èªè¨ç
<literal>CPUTYPE</literal>ãæå建è°è¨å®èªè¨ç
<literal>CPUTYPE</literal> å çºè¨±å¤ ports çåªè©±åæ¸ä»¥æ¤è®æ¸çºåºç¤ã</para>
</sect2>
<sect2 id="excluding-unbuildable-ports">
<title>æé¤ç¡æ³ç¨æ°çæ¬ç <application>GCC</application>
ç·¨è¯ç portsã</title>
<para>è¥è¦æé¤ä¸äºè·æ°çæ¬ç
<application>GCC</application> æåé¡ç portsï¼ä¾ç
§ç¯ä¾èª¿æ´
<filename>/etc/make.conf</filename>ï¼</para>
<programlisting>.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc44)
.if empty(.CURDIR:M/usr/ports/net/openldap*)
CC=gcc44
CXX=g++44
CPP=cpp44
.endif
.endif</programlisting>
<para>ä¸é¢çç¯ä¾å®è£
<filename role="package">net/openldap</filename>* ports
æï¼ä¸æä½¿ç¨ <command>gcc</command> 4.4ãå¦å¤ï¼ä¹å¯ä»¥å¨åä¸è¡ä¸è¨æ´å¤
portsï¼</para>
<programlisting>.if empty(.CURDIR:M/usr/ports/net/openldap*) && empty(.CURDIR:M/usr/ports/xxx/yyy) && ...</programlisting>
</sect2>
</sect1>
<sect1 id="performance-imparct">
<title>å°äºé²ä½å·è¡æªä¹å½±é¿</title>
<para>ä½¿ç¨ <application>GCC</application> çæ¬ 4.4 ä¸
<acronym>SSSE3</acronym> æ令éæç¨å°ï¼è¥ <acronym>CPU</acronym>
æ¯æ´ï¼å¹³åä¾è¬ï¼æè½å¯è½æé« 10% ãå¨æäºæ¸¬è©¦ç¶ä¸ï¼çµæ顯示æè½æææè¶
é
20%ï¼å¦ï¼èçå¤åªé«æï¼ã</para>
<para>ä½æ¼<ulink
url="http://people.freebsd.org/~mm/benchmarks/perlbench/"></ulink>
çè¡¨æ ¼é¡¯ç¤ºäº &os; 系統å
§å»ºç <application>GCC</application> çæ¬è
<application>GCC</application> çæ¬ 4.3ã4.4 ä¹æ¯è¼ãè¡¨æ ¼å
å«æå種
<literal>CFLAGS</literal> ççµåï¼ä½¿ç¨çæ¯ perlbench
çæè½æ¸¬è©¦å¥ä»¶ã</para>
</sect1>
</article>
--- article.sgml ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list