<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>编译点滴 &#187; gentoo</title>
	<atom:link href="http://www.lingcc.com/tag/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lingcc.com</link>
	<description>编译器、虚拟机、程序设计语言、体系结构、软件调试、操作系统等等</description>
	<lastBuildDate>Sat, 04 Feb 2012 06:56:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</title>
		<link>http://www.lingcc.com/2011/06/21/11673/</link>
		<comments>http://www.lingcc.com/2011/06/21/11673/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 02:42:10 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[IT职业和生活]]></category>
		<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[ibus]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=11673</guid>
		<description><![CDATA[系统复杂了，什么毛病都会出，最近在使用Gentoo和Debian的过程中，都出现了其他程序能正常使用ibus输入法，偏偏Emacs不能的情况。 不过最终都被征服了。解决方案放在这里，备查。 英文系统中使用ibus。中文系统请无视。英文系统emacs需要设置locale的支持。 不管是Gentoo还是Debian，如果无法正确调出ibus输入法，即ibus不能将emacs识别为输入窗口，请检查环境变量LC_CTYPE是否为zh_CN.utf8. 可以使用如下命令，执行emacs。至少经过这一步，ibus就能将emacs识别为输入窗口了。 $LC_CTYPE=zh_CN.utf8 emacs ##或者直接增加一个小脚本启动emacs #!/bin/sh export LC_CTYPE=zh_CN.utf8 /usr/bin/emacs $* 在emacs中，ibus有输入框，能显式备选汉字，但无法输入到emacs界面中。我在Gentoo和Debian中都遇到了这个问题。 Gentoo: 当时按照参考1，稀里糊涂的安装了几个字体之后问题解决。 [ebuild N ] media-fonts/font-adobe-75dpi-1.0.0 USE="X nls" 0 kB [ebuild N ] x11-apps/bdftopcf-1.0.2 USE="-debug" 0 kB [ebuild N ] media-fonts/font-alias-1.0.1 USE="-debug" 0 kB [ebuild N ] media-fonts/font-util-1.1.1 USE="-debug" 0 kB Debian: 若在Debian上采用英文系统，多半不能自动增加中文的locale，就是因为没有中文的locale。执行如下命令，增加对zh_CN.utf8 locale的支持即可。 $ sudo dpkg-reconfigure locales 若以上方案都不能解决你的问题，那推荐你试试Ibus Mode 。 <a href='http://www.lingcc.com/2011/06/21/11673/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2009%2F11%2F20%2F10065%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gcc和Open64中的-fPIC选项</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2009/12/24/10451/' rel='bookmark' title='拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)'>拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)</a></li>
<li><a href='http://www.lingcc.com/2008/02/27/9904/' rel='bookmark' title='gentoo的相关配置-make.conf'>gentoo的相关配置-make.conf</a></li>
<li><a href='http://www.lingcc.com/2010/04/09/10732/' rel='bookmark' title='Gentoo上安装Texlive2009'>Gentoo上安装Texlive2009</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2009/11/20/10065/' rel='bookmark' title='Gcc和Open64中的-fPIC选项'>Gcc和Open64中的-fPIC选项</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>系统复杂了，什么毛病都会出，最近在使用Gentoo和Debian的过程中，都出现了其他程序能正常使用ibus输入法，偏偏Emacs不能的情况。<br />
不过最终都被征服了。解决方案放在这里，备查。</p>
<ul>
<li> 英文系统中使用ibus。中文系统请无视。英文系统emacs需要设置locale的支持。<br />
不管是Gentoo还是Debian，如果无法正确调出ibus输入法，即ibus不能将emacs识别为输入窗口，请检查环境变量LC_CTYPE是否为zh_CN.utf8.<br />
可以使用如下命令，执行emacs。至少经过这一步，ibus就能将emacs识别为输入窗口了。</li>
</ul>
<pre class="src src-sh">$<span style="color: #eedd82;">LC_CTYPE</span>=zh_CN.utf8 emacs

<span style="color: #ff7f24;">##</span><span style="color: #ff7f24;">或者直接增加一个小脚本启动emacs
</span>
<span style="color: #ff7f24;">#</span><span style="color: #ff7f24;">!/bin/sh
</span><span style="color: #b0c4de;">export</span> <span style="color: #eedd82;">LC_CTYPE</span>=zh_CN.utf8
/usr/bin/emacs $<span style="color: #eedd82;">*</span></pre>
<ul>
<li> 在emacs中，ibus有输入框，能显式备选汉字，但无法输入到emacs界面中。我在Gentoo和Debian中都遇到了这个问题。</li>
</ul>
<p>Gentoo: 当时按照参考1，稀里糊涂的安装了几个字体之后问题解决。</p>
<pre class="src src-sh">[ebuild  N    ] media-fonts/font-adobe-75dpi-1.0.0  <span style="color: #eedd82;">USE</span>=<span style="color: #ffa07a;">"X nls"</span> 0 kB
[ebuild  N    ]  x11-apps/bdftopcf-1.0.2  <span style="color: #eedd82;">USE</span>=<span style="color: #ffa07a;">"-debug"</span> 0 kB
[ebuild  N    ]  media-fonts/font-alias-1.0.1  <span style="color: #eedd82;">USE</span>=<span style="color: #ffa07a;">"-debug"</span> 0 kB
[ebuild  N    ]  media-fonts/font-util-1.1.1  <span style="color: #eedd82;">USE</span>=<span style="color: #ffa07a;">"-debug"</span> 0 kB</pre>
<p>Debian: 若在Debian上采用英文系统，多半不能自动增加中文的locale，就是因为没有中文的locale。执行如下命令，增加对zh_CN.utf8 locale的支持即可。</p>
<pre class="src src-sh">$ sudo dpkg-reconfigure locales</pre>
<ul>
<li> 若以上方案都不能解决你的问题，那推荐你试试<a href="http://www.emacswiki.org/emacs/IBusMode">Ibus Mode</a> 。</li>
</ul>
<p>&nbsp;</p>
<ul>
<li> 参考
<ul>
<li><a href="http://blog.163.com/vic_kk/blog/static/49470524201061610134498/">http://blog.163.com/vic_kk/blog/static/49470524201061610134498/</a></li>
<li><a href="http://blog.pluskid.org/?p=328">http://blog.pluskid.org/?p=328</a></li>
<li><a href="http://www.emacswiki.org/emacs/IBusMode">http://www.emacswiki.org/emacs/IBusMode</a></li>
</ul>
</li>
</ul>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2009%2F11%2F20%2F10065%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gcc和Open64中的-fPIC选项</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2009/12/24/10451/' rel='bookmark' title='拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)'>拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)</a></li>
<li><a href='http://www.lingcc.com/2008/02/27/9904/' rel='bookmark' title='gentoo的相关配置-make.conf'>gentoo的相关配置-make.conf</a></li>
<li><a href='http://www.lingcc.com/2010/04/09/10732/' rel='bookmark' title='Gentoo上安装Texlive2009'>Gentoo上安装Texlive2009</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2009/11/20/10065/' rel='bookmark' title='Gcc和Open64中的-fPIC选项'>Gcc和Open64中的-fPIC选项</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2011/06/21/11673/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>走进Debian和Gentoo中的系统初始化过程</title>
		<link>http://www.lingcc.com/2010/05/19/10892/</link>
		<comments>http://www.lingcc.com/2010/05/19/10892/#comments</comments>
		<pubDate>Wed, 19 May 2010 12:04:30 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysinit]]></category>
		<category><![CDATA[启动项]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10892</guid>
		<description><![CDATA[介绍Linux系统的头号进程init和启动过程，以及Gentoo，Debian系统下，如何配置启动项。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/05/05/10894/' rel='bookmark' title='龙芯电脑常见问题'>龙芯电脑常见问题</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2009/11/20/10065/' rel='bookmark' title='Gcc和Open64中的-fPIC选项'>Gcc和Open64中的-fPIC选项</a></li>
<li><a href='http://www.lingcc.com/2011/11/26/11814/' rel='bookmark' title='How start_kernel get start?'>How start_kernel get start?</a></li>
<li><a href='http://www.lingcc.com/2010/04/21/10761/' rel='bookmark' title='Gentoo安装texlive2009&#8211;字体'>Gentoo安装texlive2009&#8211;字体</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>今天需要对Debian中的默认启动程序做配置，就顺便重新认识一下Linux下的启动过程，并总结对比Debian和Gentoo。</p>
<h4>Init创世纪！</h4>
<p>再来回顾一下Linux PC的启动过程</p>
<ol>
<li>BIOS检测硬件，并查找硬盘MBR(Master Boor Record)上的指令</li>
<li>MBR指向GRUB，LILO之类的boot loader</li>
<li>Grub查询载入操作系统内核的位置，并载入指定的内核</li>
<li>内核载入之后启动init进程。</li>
<li>init启动脚本/etc/rc.d/rc.sysinit, 接着根据运行级别不同，启动指定的进程。</li>
</ol>
<p>init是系统中所有进程的父进程，它确保所有的文件系统(/etc/fstab中指定的)都已经正确挂在，接着就执行/etc/init.d下的一系列脚本来启动服务。接着init就会激活终端，并将进程agetty和他绑定。agetty确保用户能在终端登录。</p>
<p>实际上init会根据不同的运行级别来启动不同的进程。这个运行级别的控制在/etc/inittab中。<span id="more-10892"></span></p>
<h4>Debian</h4>
<p>Debian通过执行init程序启动，配置文件为/etc/inittab,这个文件会指定init执行/etc/init.d/rcS脚本，该脚本又通过子进程执行/etc/rcS.d/目录下的脚本，如检测挂载文件系统，转载内核模块，启动网络服务，设置时钟还有其他初始化工作。接着，为了兼容性，会执行/etc/rc.boot/目录下，所有文件名不含”.”的文件。</p>
<p>启动过程之后，init程序执行默认运行级别中的起动机脚本，运行级别会在/etc/inittab文件中指定。Linux有7个运行级别.分别是</p>
<ul>
<li>0 系统挂起</li>
<li>1 单用户模式</li>
<li>2-5 各种多用户模式</li>
<li>6 系统重启</li>
</ul>
<p>Debian系统默认运行级别的id=2,也就说/etc/rc2.d下的脚本会在多用户状态下运行。事实上，在任一个/etc/rcN.d/目录下的文件都是一个到/etc/init.d/的符号链接。rcN.d/目录下文件命名方式决定了哪个脚本将会运行，”K”开头的在进入该运行级别时默认在执行，执行相应的脚本，会杀掉该服务。而所有S开头的，则在进入运行级别时，会被执行。字母之后的两位数字指定启动的顺序，较小的数字将先被执行。</p>
<h4>Gentoo</h4>
<p>Gentoo的init配置文件也是/etc/inittab,在该文件中前三行：<br />
<code><br />
id:3:initdefault:<br />
si::sysinit:/sbin/rc sysinit<br />
rc::bootwait:/sbin/rc boot</code></p>
<p>第一行:指定gentoo的默认运行级别是3，接下来两行表明gentoo的runlevel首先开始于sysinit，接着是boot。Gentoo使用字符串，而非简单的数字标记运行级，有sysinit, boot, default, nonetwork, single, shutdown六个runlevel，简单明了。</p>
<p>这些runlevel对应于/etc/runlevels/下的文件夹，每个文件夹中都是一些符号链接，指向/etc/init.d/下的脚本。系统启动的时候就是通过执行这些软连接启动相应的进程。</p>
<p>如果想在开机时启动哪个进程，只需要将该进程的软连接添加到对应的/etc/runlevels/文件夹下即可。</p>
<p>Gentoo提供了一个程序rc-update，可以很方便的管理启动项：<br />
<code><br />
#rc-update add xxx default<br />
#rc-update del xxx default<br />
#rc-update show</code></p>
<p>第一行将xxx启动项添加到default运行级，第二行从default runlevel中删除xxx，第三行查看现在的启动项。</p>
<p>参考:<br />
<a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=4">http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=4</a><br />
<a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=4">http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html</a><br />
<a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=4">http://en.wikipedia.org/wiki/Linux_startup_process</a><br />
<a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=4">http://www.debian-administration.org/article/An_introduction_to_run-levels</a></p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/05/05/10894/' rel='bookmark' title='龙芯电脑常见问题'>龙芯电脑常见问题</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2009/11/20/10065/' rel='bookmark' title='Gcc和Open64中的-fPIC选项'>Gcc和Open64中的-fPIC选项</a></li>
<li><a href='http://www.lingcc.com/2011/11/26/11814/' rel='bookmark' title='How start_kernel get start?'>How start_kernel get start?</a></li>
<li><a href='http://www.lingcc.com/2010/04/21/10761/' rel='bookmark' title='Gentoo安装texlive2009&#8211;字体'>Gentoo安装texlive2009&#8211;字体</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/05/19/10892/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>前瞻-主流处理器中的数据并行支持(SIMD)</title>
		<link>http://www.lingcc.com/2010/05/04/10878/</link>
		<comments>http://www.lingcc.com/2010/05/04/10878/#comments</comments>
		<pubDate>Tue, 04 May 2010 12:46:15 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[后端优化与处理器]]></category>
		<category><![CDATA[编译技术]]></category>
		<category><![CDATA[3dnow]]></category>
		<category><![CDATA[amd]]></category>
		<category><![CDATA[avx]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mmx]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[SIMD]]></category>
		<category><![CDATA[sse]]></category>
		<category><![CDATA[sse2]]></category>
		<category><![CDATA[sse3]]></category>
		<category><![CDATA[sse4]]></category>
		<category><![CDATA[sse5]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[多媒体处理]]></category>
		<category><![CDATA[并行]]></category>
		<category><![CDATA[开源]]></category>
		<category><![CDATA[性能]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[整点]]></category>
		<category><![CDATA[科学计算]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10878</guid>
		<description><![CDATA[引言部分： 多媒体处理算法应用在很多媒体处理环境中，如对文本，手写数据，2D/3D图形和音频对象的捕捉、制造、存储和传输等。过去 都是使用昂贵的多媒体处理硬件协同工作来加速。现在，通用处理器通过在体系结构上增加媒体处理支持来减少使用协同处理器分配和返回带来的开销。在通用处理 器上一个基本的操作能同时作用多个元素的支持成为SIMD并行处理。通过SIMD扩展，通用护理器通过捕捉多媒体算法中潜在的并行特性来加速应用。 自 Intel在Pentium II和Pentium 处理器引入了MMX技术以来，IA-32架构已经引入了许多SIMD扩展，分别是：MMX，流SIMD扩展(SSE), 流SIMD扩展(SSE2)和流SIMD扩展(SSE3)，SSSE3，SSE4和高级向量扩展(AVX).这些扩展都提供了一组指令，能够为封装好的整点或浮点数据提供SIMD类型的操作。其他结构也 有自己的SIMD扩展。如AMD的3DNow！，Cell和PowerPC的AltiVec等等。 可惜的是，和CPU提供的其他技术一样，多媒体 指令系统扩展的潜能并没有完全的发挥出来。目前，已经有一些论文在倡导科学家，软件开发人员使用这些指令加速程序。 这篇评论试图更深入的介绍 Intel的SIMD扩展，回顾努力使用这些扩展的一些研究，讨论阻碍多媒体扩展广泛应用的问题，并试图给出一些针对行的解决方法，和潜在的性能提升点。 SIMD 技术： SIMD是最早提出的并行处理模式之一，也是最简单最普遍的并行方法，试图用一个指令对数据集合中的每个数据作相同的操作。如下 图所示： 虽然SIMD技术还没有广泛应用，但也没有完全小时。因为SIMD扩 展对于特定的应用仍然很有意义，这些应用的特点是本身有并行的任务，需要大量的独立数据运算，包括3D图形运算，图像处理，语音识别，科学计算，数据库查 询等。 MMX技术： MMX是在第五代奔腾处理器中作为附加扩展引入的，最早用在提升图像生成，加密，视频编解码和I/O处理 上，相对于无MMX技术的处理器，通常能带来1.5到2倍的加速.MMX能处理64位封装的整型，引入了8个64位寄存器来实现、四种MMX数据类型(封 装的字节，半字，字，双字）和57条MMX指令. 8个MMX寄存器是通用寄存器，是浮点寄存器(ST0-ST7)的低64位的重用.MMX的数据 类型可以是8个字节整型元素的数组，4个半字整型元素的数组，2个字整型元素的数组或者1个双字整数.做SIMD运算时，SIMD指令取两个MMX寄存器 中的操作数，作相应的SIMD运算，并将结果存入结果寄存器中。MMX的指令系统由57条指令构成.包括基本算术操作、比较操作、转换操作、逻辑操作、移 位操作、访存及寄存器间移动操作和状态指令。因为MMX寄存器复用浮点寄存器，必要时，需要对MMX寄存器清空以便正常的浮点运算可以进行。 MMX 引入了一种新的溢出方式：饱和溢出(Saturation overflow).传统的溢出很多都是反转溢出(wraparound overflow).对于反转溢出，即溢出高位。但对于图像处理，这样做就不合适，比如两个白色的像素点相加，因为溢出，取低位，可能会是一个黑色的点， 显然和实际不符。饱和移除就是为解决这个问题，即若溢出则保留最值，而不是简单的取最低的几位。MMX提供有符号和无符号两种饱和溢出。 流 SIMD扩展技术(SSE) SSE在Intel 奔腾III中引入，作MMX技术的升级，并保持向后兼容。SSE扩展包括增加对128位寄存器內封装的或者普通的单精度浮点值的操作。SSE扩展引入了一 个新数据类型：128位封装单精度浮点类型，有4个IEEE标准的32位单精度浮点类型组成.该单精度数可以在XMM寄存器內或者主存中。SSE引入5类 新寄存器：XMM寄存器：8个128位寄存器支持单精度运算(XMM0-XMM7),能被x87 FPU，MMX寄存器或通用寄存器访问；MXCSR寄存器：32位寄存器包含SIMD浮点操作的控制和状态信息；MMX寄存器：用于64位封装整型，或者 为某些在MMX和XMM寄存器之间运算的操作提供操作数；通用寄存器：因为MMX和XMM寄存器不能用于存地址，8个32位的通用寄存器就被引入用于保存 SSE模式下的操作数的存储地址；EFLAGS寄存器：用于记录某些比较结果的32位寄存器. SSE也引入了70条新指令，可以分为4 类：SIMD单精度浮点运算；MXCSR状态管理指令；64位SIMD整点指令(扩展原MMX指令集);cache控制，预取和取值指令。 目前很 多的图形软件采用了这项技术，如Adobe Photoshop会在有SSE扩展的机器上用SSE加速，微软也在DirectX 6.1和之后的音/视频驱动中加入了SSE，这些都已经包含在Windows 98,Me,2000,NT和XP。 流SIMD扩展技术 2(SSE2) SSE2在奔四和Xeon处理器中引入，SSE2允许更多的计算并行，并扩展了MMX和SSE中的指令，而且引入了两个双精度浮 点数据类型。具体引入特性如下：六中数据类型、支持新数据类型的指令和对已有SIMD整型操作的扩展、修改已有指令以便支持SSE2. 双精度 <a href='http://www.lingcc.com/2010/05/04/10878/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F02%2F11605%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">SIMD硬件的发展</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F01%2F11600%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">通用微处理中的SIMD指令扩展</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F09%2F17%2F11227%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">向量处理器VS标量处理器中的向量扩展</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F03%2F11619%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">自动向量化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F14%2F11639%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Intel 的AVX2指令集解读</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/05/12/10931/' rel='bookmark' title='前瞻-拿起SIMD的武器II'>前瞻-拿起SIMD的武器II</a></li>
<li><a href='http://www.lingcc.com/2011/06/01/11600/' rel='bookmark' title='通用微处理中的SIMD指令扩展'>通用微处理中的SIMD指令扩展</a></li>
<li><a href='http://www.lingcc.com/2010/05/10/10928/' rel='bookmark' title='前瞻-拿起SIMD的武器I'>前瞻-拿起SIMD的武器I</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/21/10663/' rel='bookmark' title='小例子&#8211;回眸一笑百媚生'>小例子&#8211;回眸一笑百媚生</a></li>
<li><a href='http://www.lingcc.com/2010/04/14/10736/' rel='bookmark' title='探秘CPU性能测试：Spec CPU2000之整点篇'>探秘CPU性能测试：Spec CPU2000之整点篇</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<h4>引言部分：</h4>
<p>多媒体处理算法应用在很多媒体处理环境中，如对文本，手写数据，2D/3D图形和音频对象的捕捉、制造、存储和传输等。过去 都是使用昂贵的多媒体处理硬件协同工作来加速。现在，通用处理器通过在体系结构上增加媒体处理支持来减少使用协同处理器分配和返回带来的开销。在通用处理 器上一个基本的操作能同时作用多个元素的支持成为SIMD并行处理。通过SIMD扩展，通用护理器通过捕捉多媒体算法中潜在的并行特性来加速应用。</p>
<div>自 Intel在Pentium II和Pentium 处理器引入了MMX技术以来，IA-32架构已经引入了许多SIMD扩展，分别是：MMX，流SIMD扩展(SSE),  流SIMD扩展(SSE2)和流SIMD扩展(SSE3)，SSSE3，SSE4和高级向量扩展(AVX).这些扩展都提供了一组指令，能够为封装好的整点或浮点数据提供SIMD类型的操作。其他结构也 有自己的SIMD扩展。如AMD的3DNow！，Cell和PowerPC的AltiVec等等。<span id="more-10878"></span><br />
可惜的是，和CPU提供的其他技术一样，多媒体 指令系统扩展的潜能并没有完全的发挥出来。目前，已经有一些论文在倡导科学家，软件开发人员使用这些指令加速程序。<br />
这篇评论试图更深入的介绍 Intel的SIMD扩展，回顾努力使用这些扩展的一些研究，讨论阻碍多媒体扩展广泛应用的问题，并试图给出一些针对行的解决方法，和潜在的性能提升点。</p>
<h4>SIMD 技术：</h4>
<p>SIMD是最早提出的并行处理模式之一，也是最简单最普遍的并行方法，试图用一个指令对数据集合中的每个数据作相同的操作。如下 图所示：</p>
</div>
<div id="attachment_10879" class="wp-caption alignnone" style="width: 310px"><a href="http://www.lingcc.com/wp-content/uploads/2010/05/simd-model.jpg"><img class="size-medium wp-image-10879" title="simd-model" src="http://www.lingcc.com/wp-content/uploads/2010/05/simd-model-300x140.jpg" alt="" width="300" height="140" /></a><p class="wp-caption-text">单指令流多数据流模型</p></div>
<p>虽然SIMD技术还没有广泛应用，但也没有完全小时。因为SIMD扩 展对于特定的应用仍然很有意义，这些应用的特点是本身有并行的任务，需要大量的独立数据运算，包括3D图形运算，图像处理，语音识别，科学计算，数据库查 询等。</p>
<h5>MMX技术：</h5>
<p>MMX是在第五代奔腾处理器中作为附加扩展引入的，最早用在提升图像生成，加密，视频编解码和I/O处理 上，相对于无MMX技术的处理器，通常能带来1.5到2倍的加速.MMX能处理64位封装的整型，引入了8个64位寄存器来实现、四种MMX数据类型(封 装的字节，半字，字，双字）和57条MMX指令.<br />
8个MMX寄存器是通用寄存器，是浮点寄存器(ST0-ST7)的低64位的重用.MMX的数据 类型可以是8个字节整型元素的数组，4个半字整型元素的数组，2个字整型元素的数组或者1个双字整数.做SIMD运算时，SIMD指令取两个MMX寄存器 中的操作数，作相应的SIMD运算，并将结果存入结果寄存器中。MMX的指令系统由57条指令构成.包括基本算术操作、比较操作、转换操作、逻辑操作、移 位操作、访存及寄存器间移动操作和状态指令。因为MMX寄存器复用浮点寄存器，必要时，需要对MMX寄存器清空以便正常的浮点运算可以进行。<br />
MMX 引入了一种新的溢出方式：饱和溢出(Saturation overflow).传统的溢出很多都是反转溢出(wraparound  overflow).对于反转溢出，即溢出高位。但对于图像处理，这样做就不合适，比如两个白色的像素点相加，因为溢出，取低位，可能会是一个黑色的点， 显然和实际不符。饱和移除就是为解决这个问题，即若溢出则保留最值，而不是简单的取最低的几位。MMX提供有符号和无符号两种饱和溢出。</p>
<h5>流 SIMD扩展技术(SSE)</h5>
<p>SSE在Intel  奔腾III中引入，作MMX技术的升级，并保持向后兼容。SSE扩展包括增加对128位寄存器內封装的或者普通的单精度浮点值的操作。SSE扩展引入了一 个新数据类型：128位封装单精度浮点类型，有4个IEEE标准的32位单精度浮点类型组成.该单精度数可以在XMM寄存器內或者主存中。SSE引入5类 新寄存器：XMM寄存器：8个128位寄存器支持单精度运算(XMM0-XMM7),能被x87  FPU，MMX寄存器或通用寄存器访问；MXCSR寄存器：32位寄存器包含SIMD浮点操作的控制和状态信息；MMX寄存器：用于64位封装整型，或者 为某些在MMX和XMM寄存器之间运算的操作提供操作数；通用寄存器：因为MMX和XMM寄存器不能用于存地址，8个32位的通用寄存器就被引入用于保存 SSE模式下的操作数的存储地址；EFLAGS寄存器：用于记录某些比较结果的32位寄存器.<br />
SSE也引入了70条新指令，可以分为4 类：SIMD单精度浮点运算；MXCSR状态管理指令；64位SIMD整点指令(扩展原MMX指令集);cache控制，预取和取值指令。<br />
目前很 多的图形软件采用了这项技术，如Adobe Photoshop会在有SSE扩展的机器上用SSE加速，微软也在DirectX  6.1和之后的音/视频驱动中加入了SSE，这些都已经包含在Windows 98,Me,2000,NT和XP。</p>
<h5>流SIMD扩展技术 2(SSE2)</h5>
<p>SSE2在奔四和Xeon处理器中引入，SSE2允许更多的计算并行，并扩展了MMX和SSE中的指令，而且引入了两个双精度浮 点数据类型。具体引入特性如下：六中数据类型、支持新数据类型的指令和对已有SIMD整型操作的扩展、修改已有指令以便支持SSE2.<br />
双精度 SIMD运算的支持增强了在XMM寄存器上作高精度计算的能力。SSE2也让XMM寄存器可以作128封装整型的运算。现在程序员可以使用完备的SIMD 寄存器、数据类型和指令来开发混合单/双精度浮点，64位/128位整点的数据.SSE2并没有引入新的寄存器，只是做了功能扩展。</p>
<h5>流 SIMD扩展技术3(SSE3,SSSE3)</h5>
<p>SSE3在奔腾四为了支持超线程而引入。SSE3扩展包括13条新指令.SSE3并没有引入新的数据类型和寄存 器.</p>
<p>SSSE3在Intel Core架构中引入，增加了16条指令，每条指令都能在64位的MMX寄存器或128位的XMMS寄存器上运算</p>
<h5>流 SIMD扩展技术4(SSE4)</h5>
<p>SSE4 2006年9月发布，AMD k10和Intel Core中有使用，包括54条新指令。SSE4中增加了并非特定于多媒体应用的指令，如STTNI指令可以加速文本和字 符串处理；ATA能加速冗余校验。</p>
<h5>流 SIMD扩展技5(SSE5)</h5>
<p>SSE5是AMD 2007年8月发布的，作为AMD64结构在128 SSE基础上的补充。</p>
<h5>高级向量扩展 (AVX)</h5>
<p>Intel  2008年3月发布的SIMD扩展.寄存器从128位扩展为256位，并使用新的寄存器名YMM0-YMM15，已有的128位指令使用256位寄存器的 低128位.使用无副作用指令格式，即所有形如a=a+b的操作都会会被替换为c=a+b，这样操作数计算的结构不会污染原操作数，所有的有两个操作数的 XMM指令都会用这种方式扩展为3个操作数的形式.访存中对SIMD数据对齐的要求放宽。<br />
AVX中指令的编码方式也有改变，通过 修改前缀使得无副作用指令格式得意实现。AVX扩展适用于多媒体、科学计算和经济方面的应用，能有效增加并行性和浮点SIMD运算的吞吐率，降低寄存器载 入开销。目前Linux 2.6.30、Windows 7 SP1和Windows Server 2008 R2 SP1都有AVX增强.</p>
<h5>3DNow!技术</h5>
<p>3DNow！是AMD在MMX的基础上作的扩展，和SSE对MMX的扩展相似。最早用在 AMD-K6-2处理器上，之后在AMD-K6-III和AMD  Athlon处理器上实现。3DNow！是一组指令，有效缓解了传统多浮点运算和多媒体应用的瓶颈。3DNow！使用MMX寄存器但增加了45条浮点指 令，能同时对1个或2个单精度浮点值作运算.3DNow！支持加、减、乘、除、和整点之间的转换、比较、绝对值、数据预取等操作。根据AMD提供的资 料，3DNow！的带来，如同SSE为MMX带来的同等提升，但指令和复杂度降低。但SSE和3DNow！不兼容。目前微软的Windows  9X，NT和所有最新系统，DirectX 6.x可以使用3DNow！加速，<a href="http://www.amd.com/us-en/Corporate/VirtualPressRoom/0,,51_104_557_560,00.html" target="_blank">OpenGL也可以使用3DNow！加速.</a><br />
3DNow！为高分辨率的显示提高了帧频率，更接近 现场的高保真音频等等。</p>
<h5>小小结：</h5>
<p>操作系统对某个体系结构的支持，已经远远不是单纯的某个指令集能解决的问题。为了用户体验和应用性能提升，需要更多的软/硬件协同的设计。软件设计中需要哪条指令更高效的运行，哪些指令用不到，都可以给硬件设计作参考。这也是Wintel联盟如此紧密的原因。与CPU架构密切相关的SIMD指令，作为改进普通中端用户多媒体体验的关键，更是在Windows系统中占据不可替代的作用。</p>
<p>在Gentoo portage中做了个简单的调研，发现现在使用SIMD加速的包很少，如mplayer，ffmpeg，gimp，大多数都为多媒体应用程序，支持最多的也只有sse，sse2,3DNow和mmx，再新的根本没有。而且Intel等芯片设计厂商也有一些未公开的特殊指令，只提供给某些合作伙伴使用，再加上开源爱好者们没有那么多的时间和精力去根据已有的程序和算法，按照某个芯片独特的SIMD支持，设计并验证针对它的软件修改。那很多开源软都难用到这些特性。性能也就没办法和Windows下的相比。</p>
<p>这小小结，只是愤青的一点感慨而已。既得利益集团是不会在乎这些的。</p>
<p>敬请期待SIMD系列下文《前瞻-拿起SIMD的武器!》</p>
<p>PS：原文根据ayaya的评论做了很多更正，谢谢ayaya：）</p>
<p>参考：<br />
<a href="http://comjnl.oxfordjournals.org/cgi/content/abstract/bxm099">A Review of SIMD Multimedia Extensions and their Usage in Scientific and Engineering Applications.</a></p>
<p>http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions</p>
<p>http://en.wikipedia.org/wiki/SSSE3</p>
<p>http://en.wikipedia.org/wiki/SSE4</p>
<p>http://en.wikipedia.org/wiki/SSE5</p>
<p>http://en.wikipedia.org/wiki/Advanced_Vector_Extensions</p>
<p>http://en.wikipedia.org/wiki/CVT16_instruction_set</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F02%2F11605%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">SIMD硬件的发展</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F01%2F11600%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">通用微处理中的SIMD指令扩展</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F09%2F17%2F11227%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">向量处理器VS标量处理器中的向量扩展</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F03%2F11619%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">自动向量化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F14%2F11639%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F04%2F10878%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Intel 的AVX2指令集解读</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/05/12/10931/' rel='bookmark' title='前瞻-拿起SIMD的武器II'>前瞻-拿起SIMD的武器II</a></li>
<li><a href='http://www.lingcc.com/2011/06/01/11600/' rel='bookmark' title='通用微处理中的SIMD指令扩展'>通用微处理中的SIMD指令扩展</a></li>
<li><a href='http://www.lingcc.com/2010/05/10/10928/' rel='bookmark' title='前瞻-拿起SIMD的武器I'>前瞻-拿起SIMD的武器I</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/21/10663/' rel='bookmark' title='小例子&#8211;回眸一笑百媚生'>小例子&#8211;回眸一笑百媚生</a></li>
<li><a href='http://www.lingcc.com/2010/04/14/10736/' rel='bookmark' title='探秘CPU性能测试：Spec CPU2000之整点篇'>探秘CPU性能测试：Spec CPU2000之整点篇</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/05/04/10878/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Gentoo安装texlive2009&#8211;字体</title>
		<link>http://www.lingcc.com/2010/04/21/10761/</link>
		<comments>http://www.lingcc.com/2010/04/21/10761/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 04:50:33 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[编译技术]]></category>
		<category><![CDATA[ctex]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[texlive]]></category>
		<category><![CDATA[texlive 2009]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[字体]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10761</guid>
		<description><![CDATA[texlive毕竟是老外写的，不过很幸运我们有ctex.org社区。Windows下的支持，在他们的努力下，非常方便。两年前用的时候，直接下载安装包。编译tex文件时，自动下载缺的宏包。 但可惜linux下就不容易了。再加上字体的版权问题，实在头疼！不过幸好texlive2009增强了对字体的支持，所以简单了很多：）下面介绍本博在折腾中易字体时的经验，包括youyuan,simfang,simsun,lishu,simhei,simkai六种字体。 首先，到windows/fonts/目录下找，看是否可以直接拷贝这几款字体，如果没有，可以从这里下载。拷贝到目录~/texmf/fonts/truetype/sim下。 拷贝字体之后，还需要做个格式转换，把windows字体转换为texlive可用的字体，请参考Linuxsir.org的帖子 然后，下载ctex-kit. cd ~/texmf/tex/latex svn checkout http://ctex-kit.googlecode.com/svn/trunk/ctex 日后更新 cd ~/texmf/tex/latex/ctex svn update ok，接下来就能使用了：） 不过需要提醒的是，使用模板时可能存在编码问题，比如xelatex使用utf8编码比较好。那就需要将gbk编码的模板转换为utf8.请使用下面的命令: find default -type d -exec mkdir -p utf/{} \; find default -type f -exec iconv -f GBK -t UTF-8 {} -o utf/{} \; 这两行命令将default目录下的文件由GBK编码 转换为UTF-8编码，目录结构不变，转码后的文件保存在utf/default目录下。 http://code.google.com/p/ctex-kit/wiki/CTeXPackage http://code.google.com/p/ctex-kit/wiki/SimpleChineseTemplates http://www.xiaojb.com/archives/it/convert-gbk-utf-8.shtml 相关文章： Gentoo上安装Texlive2009 最近用hg的一点记录 走进Debian和Gentoo中的系统初始化过程 GCC初窥 Google 与 Clang WebKit和Firefox的JavaScript性能对比<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/04/09/10732/' rel='bookmark' title='Gentoo上安装Texlive2009'>Gentoo上安装Texlive2009</a></li>
<li><a href='http://www.lingcc.com/2009/12/24/10414/' rel='bookmark' title='最近用hg的一点记录'>最近用hg的一点记录</a></li>
<li><a href='http://www.lingcc.com/2010/05/19/10892/' rel='bookmark' title='走进Debian和Gentoo中的系统初始化过程'>走进Debian和Gentoo中的系统初始化过程</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2011/06/05/11625/' rel='bookmark' title='Google 与 Clang'>Google 与 Clang</a></li>
<li><a href='http://www.lingcc.com/2010/01/22/10668/' rel='bookmark' title='WebKit和Firefox的JavaScript性能对比'>WebKit和Firefox的JavaScript性能对比</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>texlive毕竟是老外写的，不过很幸运我们有ctex.org社区。Windows下的支持，在他们的努力下，非常方便。两年前用的时候，直接下载安装包。编译tex文件时，自动下载缺的宏包。</p>
<p>但可惜linux下就不容易了。再加上字体的版权问题，实在头疼！不过幸好texlive2009增强了对字体的支持，所以简单了很多：）下面介绍本博在折腾中易字体时的经验，包括youyuan,simfang,simsun,lishu,simhei,simkai六种字体。</p>
<p>首先，到windows/fonts/目录下找，看是否可以直接拷贝这几款字体，如果没有，可以从<a href="http://www.52font.com/Sorting/Catalog56/Sorting_Indate_Desc_1.html" target="_blank">这里</a>下载。拷贝到目录~/texmf/fonts/truetype/sim下。</p>
<p>拷贝字体之后，还需要做个格式转换，把windows字体转换为texlive可用的字体，请参考<a href="http://www.linuxsir.org/bbs/thread337571.html" target="_blank">Linuxsir.org的帖子</a></p>
<p>然后，下载ctex-kit.</p>
<pre><a name="下载安装">cd ~/texmf/tex/latex
svn checkout http://ctex-kit.googlecode.com/svn/trunk/ctex</a></pre>
<p><span id="more-10761"></span><br />
日后更新</p>
<pre><a name="更新">cd ~/texmf/tex/latex/ctex
svn update</a>
</pre>
<p>ok，接下来就能使用了：）<br />
不过需要提醒的是，使用模板时可能存在编码问题，比如xelatex使用utf8编码比较好。那就需要将gbk编码的模板转换为utf8.请使用下面的命令:<br />
<code>find default -type d -exec mkdir -p utf/{} \;<br />
find default -type f  -exec iconv -f GBK -t UTF-8 {} -o utf/{} \;</code><br />
这两行命令将default目录下的文件由GBK编码 转换为UTF-8编码，目录结构不变，转码后的文件保存在utf/default目录下。</p>
<p>http://code.google.com/p/ctex-kit/wiki/CTeXPackage</p>
<p>http://code.google.com/p/ctex-kit/wiki/SimpleChineseTemplates</p>
<p>http://www.xiaojb.com/archives/it/convert-gbk-utf-8.shtml</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/04/09/10732/' rel='bookmark' title='Gentoo上安装Texlive2009'>Gentoo上安装Texlive2009</a></li>
<li><a href='http://www.lingcc.com/2009/12/24/10414/' rel='bookmark' title='最近用hg的一点记录'>最近用hg的一点记录</a></li>
<li><a href='http://www.lingcc.com/2010/05/19/10892/' rel='bookmark' title='走进Debian和Gentoo中的系统初始化过程'>走进Debian和Gentoo中的系统初始化过程</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2011/06/05/11625/' rel='bookmark' title='Google 与 Clang'>Google 与 Clang</a></li>
<li><a href='http://www.lingcc.com/2010/01/22/10668/' rel='bookmark' title='WebKit和Firefox的JavaScript性能对比'>WebKit和Firefox的JavaScript性能对比</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/04/21/10761/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>来仔细看看GCC 4.5.0</title>
		<link>http://www.lingcc.com/2010/04/16/10746/</link>
		<comments>http://www.lingcc.com/2010/04/16/10746/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 04:39:51 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[GCC]]></category>
		<category><![CDATA[编译技术]]></category>
		<category><![CDATA[amd]]></category>
		<category><![CDATA[builtin]]></category>
		<category><![CDATA[compiler infrastructure]]></category>
		<category><![CDATA[elf]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[USE]]></category>
		<category><![CDATA[x86]]></category>
		<category><![CDATA[内建函数]]></category>
		<category><![CDATA[并行]]></category>
		<category><![CDATA[性能]]></category>
		<category><![CDATA[编程技术]]></category>
		<category><![CDATA[编译器]]></category>
		<category><![CDATA[过程间优化]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10746</guid>
		<description><![CDATA[距离GCC 4.4的发布一年之久，GNU终于发布GCC 4.5了。新版本带来了很多新特性，包括使用MPC库在编译时完成复杂的算术计算，C++0x支持增强，使用部分Graphite完成自动并行化，支持新的ARM处理器，Intel Atom优化和调优支持，以及AMD Orochi优化支持等。今年稍晚发布的Fedora 14,Ubuntu 10.10,OpenSUSE 11.3，都将有GCC4.5，估计Gentoo马上就会有支持了，磨拳擦掌准备试用喽：）详细支持如下： 总体说明： 编译GCC需要MPC库 故纸堆里的旧系统和很久没有更新和测试的系统在GCC4.5中被标记为待放弃，包括IRIX, Solaris 7, Tru64 UNIX V5.1. GCC4.4中标记为待放弃的支持被放弃 移除Itanium 1变种支持，但Itanium2编译的程序能在Itanium1上正确执行 GCC生成的调试信息包括了更多DWARF 3的特性，甚至包含了DWARF4的一些特性.GDB7.0之前的版本将无法使用这些特性.所以调试GCC4.5编译的程序需要使用GDB7.0及以上版本.也可以使用选项 -gdwarf-s  -gstrict-dwarf来禁止生成DWARF4信息，或者-gdwarf-2 -gstrict-dwarf让GCC严格执行DWARF2标准. X86上，浮点运算在GCC4.5上使用严格C99语法编译时，可能会运行变慢。这是为了和标准一致，可以通过选项-fexcess-precision=fast来避免严格的标准限制。 noinline属性不再能阻止整个函数拷贝。但可以通过新的属性noclone做到。 改进： -save-temps可以增加参数，该功能让用户可以在并行编译的时候得到编译器的中间文件，但不会在不同的文件夹中使用相同的文件名从而干扰比起。 调试信息目标文件也都被放在了同个文件夹下，而不是当前工作目录，这样用户可以在并行编译的时候得到调试信息。 集成了MPC库，这样可以让GCC在编译时更精确的评估复杂的算术运算。GCC也可以通过它，对于常数作参数的数学运算类内建函数调用，直接在编译时使用相等的返回值来代替之。包括下列内建函数：cacos, cacosh, casin, casinh, catan, catanh, ccos, ccosh, cexp, clog, cpow, csin, csinh, csqrt, ctan和ctanh。 新的链接时优化器(-flto),打开此选项后，GCC会针对每个输入文件，产生bytecode的表示形式，并将其写入每个目标文件的特定ELF区內。链接时，从这些ELF区內读取函数体，并将其实体化为转换单元。这样就可以使得过程间优化能在不同的文件间进行(甚至不同语言间),进而可能提升性能。使用此功能需要在编译时和链接时都增加-flto选项。如果不需要程序输出任何符号，可以联合-fwhopr和-fwhole-program来让过程间优化器执行更加激进的优化。 增强自动并行化，现在支持外层循环的并行化。 自动并行化能作为Graphite的一部分来打开。在选项-ftree-parallelize-loops=的基础上增加-floop-parallelize-all能打开基于Graphite的优化。(注:Graphite是GCC中使用多面体模型做循环优化的部分) 重写基于严格指针的优化架构，会提高生成代码的效率。基于严格指针的优化在打开-fno-strict-aliasing后可用。 增加关于函数传参的新优化。试图改变函数原型，避免无用传递，仅传递结构体中特定部分，并将引用传参改为值传参。-O2，-Os及以上级别默认开启此优化。 优化异常控制代码。 新语言支持和特定语言改进 所有语言：-fshow-colum选项默认打开，错误信息现在有列信息。 C类语言：若#include的文件未找到，编译器会立即退出；增加一个新内建函数__builtin_unreachable()；增加-Wlogical-op选项，对可能存在的逻辑错误，报警告；嵌入式汇编增加goto特性，允许汇编中的语句直接跳到C中的标号处；C++0x原始strings(raw string)支持；deprecatd树形现在可以增加可选字符串参数,如__attribute__((deprecated(“text string”))),这样，deprecation警告会和字符串一同打印。 <a href='http://www.lingcc.com/2010/04/16/10746/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F27%2F11679%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC几个选项学习</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2012%2F01%2F15%2F11963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Open64、LLVM、GCC源代码行数对比</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F11%2F29%2F11859%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC如何进出GIMPLE中间表示</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F03%2F28%2F11567%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">仔细端详GCC 4.6的新特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F09%2F16%2F11210%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC Internal 中文文档上线</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/22/10668/' rel='bookmark' title='WebKit和Firefox的JavaScript性能对比'>WebKit和Firefox的JavaScript性能对比</a></li>
<li><a href='http://www.lingcc.com/2009/12/16/10317/' rel='bookmark' title='Open64课程&#8212;代码生成(CG)'>Open64课程&#8212;代码生成(CG)</a></li>
<li><a href='http://www.lingcc.com/2009/11/18/10000/' rel='bookmark' title='Open64课程-简介，概述和中间表示'>Open64课程-简介，概述和中间表示</a></li>
<li><a href='http://www.lingcc.com/2010/01/08/10609/' rel='bookmark' title='GCC中的pie和fpie选项'>GCC中的pie和fpie选项</a></li>
<li><a href='http://www.lingcc.com/2009/12/14/10295/' rel='bookmark' title='open64课程&#8211;过程间分析优化(IPA)'>open64课程&#8211;过程间分析优化(IPA)</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>距离GCC 4.4的发布一年之久，GNU终于发布GCC 4.5了。新版本带来了很多新特性，包括使用MPC库在编译时完成复杂的算术计算，C++0x支持增强，使用部分Graphite完成自动并行化，支持新的ARM处理器，Intel Atom优化和调优支持，以及AMD Orochi优化支持等。今年稍晚发布的Fedora 14,Ubuntu 10.10,OpenSUSE 11.3，都将有GCC4.5，估计Gentoo马上就会有支持了，磨拳擦掌准备试用喽：）详细支持如下：</p>
<h4>总体说明：</h4>
<ul>
<li>编译GCC需要MPC库</li>
<li>故纸堆里的旧系统和很久没有更新和测试的系统在GCC4.5中被标记为待放弃，包括IRIX, Solaris 7, Tru64 UNIX V5.1.</li>
<li>GCC4.4中标记为待放弃的支持被放弃</li>
<li>移除Itanium 1变种支持，但Itanium2编译的程序能在Itanium1上正确执行</li>
<li>GCC生成的调试信息包括了更多DWARF 3的特性，甚至包含了DWARF4的一些特性.GDB7.0之前的版本将无法使用这些特性.所以调试GCC4.5编译的程序需要使用GDB7.0及以上版本.也可以使用选项 -gdwarf-s  -gstrict-dwarf来禁止生成DWARF4信息，或者-gdwarf-2 -gstrict-dwarf让GCC严格执行DWARF2标准.</li>
<li>X86上，浮点运算在GCC4.5上使用严格C99语法编译时，可能会运行变慢。这是为了和标准一致，可以通过选项-fexcess-precision=fast来避免严格的标准限制。</li>
<li>noinline属性不再能阻止整个函数拷贝。但可以通过新的属性noclone做到。</li>
</ul>
<p><span id="more-10746"></span></p>
<h4>改进：</h4>
<ul>
<li>-save-temps可以增加参数，该功能让用户可以在并行编译的时候得到编译器的中间文件，但不会在不同的文件夹中使用相同的文件名从而干扰比起。</li>
<li>调试信息目标文件也都被放在了同个文件夹下，而不是当前工作目录，这样用户可以在并行编译的时候得到调试信息。</li>
<li>集成了MPC库，这样可以让GCC在编译时更精确的评估复杂的算术运算。GCC也可以通过它，对于常数作参数的数学运算类内建函数调用，直接在编译时使用相等的返回值来代替之。包括下列内建函数：cacos, cacosh, casin, casinh, catan, catanh, ccos, ccosh, cexp, clog, cpow, csin, csinh, csqrt, ctan和ctanh。</li>
<li>新的链接时优化器(-flto),打开此选项后，GCC会针对每个输入文件，产生bytecode的表示形式，并将其写入每个目标文件的特定ELF区內。链接时，从这些ELF区內读取函数体，并将其实体化为转换单元。这样就可以使得过程间优化能在不同的文件间进行(甚至不同语言间),进而可能提升性能。使用此功能需要在编译时和链接时都增加-flto选项。如果不需要程序输出任何符号，可以联合-fwhopr和-fwhole-program来让过程间优化器执行更加激进的优化。</li>
<li>增强自动并行化，现在支持外层循环的并行化。</li>
<li>自动并行化能作为Graphite的一部分来打开。在选项-ftree-parallelize-loops=的基础上增加-floop-parallelize-all能打开基于Graphite的优化。(注:Graphite是GCC中使用多面体模型做循环优化的部分)</li>
<li>重写基于严格指针的优化架构，会提高生成代码的效率。基于严格指针的优化在打开-fno-strict-aliasing后可用。</li>
<li>增加关于函数传参的新优化。试图改变函数原型，避免无用传递，仅传递结构体中特定部分，并将引用传参改为值传参。-O2，-Os及以上级别默认开启此优化。</li>
<li>优化异常控制代码。</li>
</ul>
<h4>新语言支持和特定语言改进</h4>
<ul>
<li>所有语言：-fshow-colum选项默认打开，错误信息现在有列信息。</li>
<li>C类语言：若#include的文件未找到，编译器会立即退出；增加一个新内建函数__builtin_unreachable()；增加-Wlogical-op选项，对可能存在的逻辑错误，报警告；嵌入式汇编增加goto特性，允许汇编中的语句直接跳到C中的标号处；C++0x原始strings(raw string)支持；deprecatd树形现在可以增加可选字符串参数,如__attribute__((deprecated(“text string”))),这样，deprecation警告会和字符串一同打印。</li>
<li>其他针对各个语言的详细细节请参考官方release。</li>
</ul>
<h4>其他改进：</h4>
<ul>
<li>插件支持：可以不通过改变编译器代码来扩展编译器功能。-fplugin=file.so能指定GCC载入动态链接文件file.so，并将其作为编译器的一部分执行。更多的细节请参考相关文档。</li>
<li>安装文件夹稍有变动。</li>
</ul>
<p>参考：</p>
<p>http://gcc.gnu.org/gcc-4.5/changes.html</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F27%2F11679%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC几个选项学习</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2012%2F01%2F15%2F11963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Open64、LLVM、GCC源代码行数对比</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F11%2F29%2F11859%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC如何进出GIMPLE中间表示</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F03%2F28%2F11567%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">仔细端详GCC 4.6的新特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F09%2F16%2F11210%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F16%2F10746%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC Internal 中文文档上线</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/22/10668/' rel='bookmark' title='WebKit和Firefox的JavaScript性能对比'>WebKit和Firefox的JavaScript性能对比</a></li>
<li><a href='http://www.lingcc.com/2009/12/16/10317/' rel='bookmark' title='Open64课程&#8212;代码生成(CG)'>Open64课程&#8212;代码生成(CG)</a></li>
<li><a href='http://www.lingcc.com/2009/11/18/10000/' rel='bookmark' title='Open64课程-简介，概述和中间表示'>Open64课程-简介，概述和中间表示</a></li>
<li><a href='http://www.lingcc.com/2010/01/08/10609/' rel='bookmark' title='GCC中的pie和fpie选项'>GCC中的pie和fpie选项</a></li>
<li><a href='http://www.lingcc.com/2009/12/14/10295/' rel='bookmark' title='open64课程&#8211;过程间分析优化(IPA)'>open64课程&#8211;过程间分析优化(IPA)</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/04/16/10746/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Gentoo上安装Texlive2009</title>
		<link>http://www.lingcc.com/2010/04/09/10732/</link>
		<comments>http://www.lingcc.com/2010/04/09/10732/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 14:33:38 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[编译技术]]></category>
		<category><![CDATA[ctex]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[latex 中文]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[texlive]]></category>
		<category><![CDATA[USE]]></category>
		<category><![CDATA[x86]]></category>
		<category><![CDATA[写论文]]></category>
		<category><![CDATA[字体]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10732</guid>
		<description><![CDATA[最近想折腾用texlive写点东西，而且要支持中文。就冲着texlive-2009了。大学毕业论文就是用latex写的，不过那是在Windoews下，用CTEX包，很是方便，Gentoo就有点不一样了。虽然texlive有自己的iso镜像，有自己的安装工具和包管理工具，但Gentoo还是将它拆分成了很多的packge来装。这样也好，比较灵活。 下面就开始吧。 首先是keywords和use，因为现在2009还不稳定，而我用的是x86就要增加一堆的keyword，如下： app-text/texlive ~x86 app-text/texlive-core ~x86 dev-texlive/texlive-documentation-english ~x86 dev-texlive/texlive-documentation-base ~x86 dev-texlive/texlive-basic ~x86 dev-texlive/texlive-bibtexextra ~x86 dev-texlive/texlive-context ~x86 dev-texlive/texlive-xetex ~x86 dev-texlive/texlive-genericrecommended ~x86 dev-texlive/texlive-genericextra ~x86 dev-texlive/texlive-htmlxml ~x86 media-libs/silgraphite ~x86 app-text/teckit ~x86 dev-texlive/texlive-latexrecommended ~x86 dev-texlive/texlive-latex ~x86 app-text/ptex ~x86 dev-texlive/texlive-texinfo ~x86 dev-texlive/texlive-formatsextra ~x86 dev-texlive/texlive-metapost ~x86 dev-texlive/texlive-mathextra ~x86 dev-texlive/texlive-fontsextra ~x86 dev-texlive/texlive-langcjk ~x86 dev-texlive/texlive-fontsrecommended ~x86 dev-texlive/texlive-fontutils ~x86 app-text/xdvik ~x86 dev-texlive/texlive-music ~x86 <a href='http://www.lingcc.com/2010/04/09/10732/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/04/21/10761/' rel='bookmark' title='Gentoo安装texlive2009&#8211;字体'>Gentoo安装texlive2009&#8211;字体</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2010/04/16/10746/' rel='bookmark' title='来仔细看看GCC 4.5.0'>来仔细看看GCC 4.5.0</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>最近想折腾用texlive写点东西，而且要支持中文。就冲着texlive-2009了。大学毕业论文就是用latex写的，不过那是在Windoews下，用CTEX包，很是方便，Gentoo就有点不一样了。虽然texlive有自己的iso镜像，有自己的安装工具和包管理工具，但Gentoo还是将它拆分成了很多的packge来装。这样也好，比较灵活。</p>
<p>下面就开始吧。</p>
<p>首先是keywords和use，因为现在2009还不稳定，而我用的是x86就要增加一堆的keyword，如下：</p>
<div id="_mcePaste">app-text/texlive ~x86</div>
<div id="_mcePaste">app-text/texlive-core ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-documentation-english ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-documentation-base ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-basic ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-bibtexextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-context ~x86<span id="more-10732"></span></div>
<div id="_mcePaste">dev-texlive/texlive-xetex ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-genericrecommended ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-genericextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-htmlxml ~x86</div>
<div id="_mcePaste">media-libs/silgraphite ~x86</div>
<div id="_mcePaste">app-text/teckit ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latexrecommended ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latex ~x86</div>
<div id="_mcePaste">app-text/ptex ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-texinfo ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-formatsextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-metapost ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-mathextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-fontsextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-langcjk ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-fontsrecommended ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-fontutils ~x86</div>
<div id="_mcePaste">app-text/xdvik ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-music ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-omega ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-games ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-publishers ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-humanities ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-science ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latexextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latexextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-langcyrillic ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-plainextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-documentation-chinese ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-pstricks ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-pictures ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-luatex ~x86</div>
<div id="_mcePaste">dev-lisp/clisp ~x86</div>
<div>至于use，别忘了cjk就行。</div>
<div>然后就能emerge -av  texlive 开始安装了。安装过程中出了几个小问题，有的可能解决方法比较笨，呵呵。如下：</div>
<div>
<ul>
<li>(&#8216;ebuild&#8217;, &#8216;/&#8217;,  &#8216;app-text/texlive-core-2009-r1&#8242;, &#8216;merge&#8217;) pulled in by app-text/texlive-core required by (&#8216;installed&#8217;, &#8216;/&#8217;,  &#8216;virtual/tex-base-0&#8242;, &#8216;nomerge&#8217;) (&#8216;ebuild&#8217;, &#8216;/&#8217;,  &#8216;app-text/ptex-3.1.10_p20090610-r1&#8242;, &#8216;merge&#8217;) pulled in by app-text/ptex required by (&#8216;installed&#8217;, &#8216;/&#8217;, &#8216;virtual/latex-base-1.0&#8242;,  &#8216;nomerge&#8217;)  just emerge -c  all texlive package /卸载所有texlive相关的包</li>
<li> ptex and   dev-texlive/texlive-fontutils Detected file collision(s)   /usr/bin/epstopdf， emerge -C  app-text/ptex</li>
<li>xindy-2.3 build fail. <a class="externalLink" title="External link to http://bugs.gentoo.org/show_bug.cgi?id=281271" href="http://bugs.gentoo.org/show_bug.cgi?id=281271" target="_blank">http://bugs.gentoo.org/show_bug.cgi?id=281271</a>.  add the patch. make pass</li>
</ul>
</div>
<p>如果一切顺利的话，接下来就能用了。别忘了看看自己系统支持的中文字体，使用这个命令<br />
$ fc-list :lang=zh-cn<br />
本博用来测试各个字体的test-fonts.tex文件，其他问题日后遇到了再详谈，enjoy it :)<br />
<code><br />
\documentclass[12pt,a4paper]{article}<br />
\usepackage{fontspec}<br />
\setromanfont{AR PL UMing CN}<br />
\begin{document}<br />
{\setromanfont{WenQuanYi Micro Hei Mono}<br />
不需要安装字体，文泉驿等宽微米黑,文泉驛等寬微米黑,WenQuanYi Micro Hei Mono  \\}<br />
{\setromanfont{WenQuanYi Zen Hei}<br />
不需要安装字体，文泉驿 正黑 \\}<br />
{\setromanfont{WenQuanYi Zen Hei Mono}<br />
不需要安装字体，文泉驿 正黑 Mono \\}<br />
{\setromanfont{WenQuanYi Zen Hei Sharp}<br />
不需要安装字体，文泉驿 正黑 Sharp \\}<br />
{\setromanfont{AR PL UMing TW}<br />
不需要安装字体, AR PL UMing TW \\}<br />
{\setromanfont{AR PL UMing TW MBE}<br />
不需要安装字体, UMing TW MBE \\}<br />
{\setromanfont{AR PL UMing HK}<br />
不需要安装字体, AR PL UMing HK \\}<br />
{\setromanfont{AR PL UMing CN}<br />
不需要安装字体, UMing CN\\}<br />
{\setromanfont{AR PL UKai CN}<br />
不需要安装字体, UKai CN \\}<br />
{\setromanfont{AR PL UKai HK}<br />
不需要安装字体, UKai HK \\}<br />
{\setromanfont{AR PL UKai TW}<br />
不需要安装字体, UKai TW \\}<br />
{\setromanfont{AR PL UKai TW MBE}<br />
不需要安装字体, UKai TW MBE \\}<br />
{\setromanfont{AR PL KaitiM GB}<br />
不需要安装字体, AR PL KaitiM GB \\}<br />
\end{document}</code></p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/04/21/10761/' rel='bookmark' title='Gentoo安装texlive2009&#8211;字体'>Gentoo安装texlive2009&#8211;字体</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2010/04/16/10746/' rel='bookmark' title='来仔细看看GCC 4.5.0'>来仔细看看GCC 4.5.0</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/04/09/10732/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为龙芯电脑安装操作系统常见问题</title>
		<link>http://www.lingcc.com/2010/03/25/10717/</link>
		<comments>http://www.lingcc.com/2010/03/25/10717/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 13:20:49 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[编译技术]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MIPS]]></category>
		<category><![CDATA[N32]]></category>
		<category><![CDATA[N64]]></category>
		<category><![CDATA[O32]]></category>
		<category><![CDATA[pmon]]></category>
		<category><![CDATA[rescue]]></category>
		<category><![CDATA[成功]]></category>
		<category><![CDATA[操作系统 Operating system]]></category>
		<category><![CDATA[链接]]></category>
		<category><![CDATA[龙芯]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10717</guid>
		<description><![CDATA[本博在实际工作中，曾经安装过不少龙芯电脑的系统，可谓稍有经验，这里略微介绍一些常见问题。 内核通用吗？一般龙芯2F使用MIPSIII的指令级，内核格式都为64位的文件。所以不管时O32系统还是N32系统，只要硬件相同都是通用的，不过别忘了连同/lib/modules 和/lib/firmware一起使用：） 龙芯到底有多少种系统？很多，按照ABI分为3类：O32，N32，N64.O32是出厂时自带的系统，一般龙芯盒子中的华镭，龙芯本中的loonux、红旗和龙芯一体机中的共创都是O32系统。这类系统基本都是在debian的基础上做做山寨化。当然也有英文版的debian系统，这个比较干净一些。对于O32的系统，源的问题最头疼，因为各个公司画地为牢，大家都努力维护自己的源，又都缺人手，所以都不完美，试了几个都不太好，装着装着就会出依赖问题，除非一直跟着升级，不然一次apt-get dist-upgrade，那简直是噩梦。N32的系统，zhllg基于Gentoo的已经有了，龙芯论坛里就能找到下载链接。因为Gentoo是自己直接编译，问题相对少些。debian的还没有。N64的系统，有憨牛LFS的，没有试过。至于为啥会有这么多系统，得问问MIPS，因为有不少改进，就产生了不少问题。请参考本博&#60;好大一筐梅普斯&#62;.N32系统据说比O32快20%-30%。因为龙芯本身是64位处理器，所以64位系统也没问题. 龙芯系统好装吗？好装！虽然咱们做的系统很山寨，但咱们的易用性很牛。官方提供了很多中安装和还原方式，硬盘，U盘和网络样样都行，很简单。只要下载一个rescue的内核，就能启动一个迷你的linux系统，有些小命令可以跑，接着再找你想要的系统，下载，解压到龙芯电脑的硬盘上即可。方便快捷，想装N32 就去下gentoo系统，想装O32就去下debian. Android都能装了。北京龙芯俱乐部的FTP里有各种OS，找最新的下就行了。文后有链接地址：） 为啥我的U盘识别不了？呵呵，问题不大，如果你已经确定按照相关步骤执行，并且U盘确实已经插进USB口，还有问题的话，那就换个U盘。因为PMON可能对部分U盘不识别，而且最好把U盘格式化成ext3格式的.pmon的时候可以执行devls，看看有没有usb设备。 装龙芯系统要几步？基本是三四步的样子，load内核，g+内核启动参数启动系统，再解压新系统。龙梦出厂的很多电脑都自带了还原功能，如果你还没有把它折腾坏的话，那就用还原吧。 fdisk对龙芯电脑上的硬盘做了分区，无法启动了咋办？这是我遇到的一个问题。龙芯电脑上本地的系统中对不用的几个分区用fdisk操作，之后重启，发现直接找不到wd0.很可能是硬盘分区表没有写对。这时候最好的方式是想办法再正确的执行一次fdisk。我的解决方法是，找了一个正常系统的内核，启动之，给内核的参数中指定根目录，系统成功启动，再执行了一次fdisk，做了几个小修改，保存，再重启就没问题了。至于为啥换个内核，指定根目录就能启动了，呵呵我也不太清除。 N32的Gentoo系统下载的是带x版本的，但是启动时报错：Warning:unable to open an initial console，然后就卡住了，怎么办？这是因为linux系统中有文件没办法做到压缩包中，需要手动mknod创建。执行下列命令就ok了。 mknod -m 600 dev/console c 5 1 mknod -m 666 dev/null c 1 3 cp -a dev/{console,null} lib/udev/devices/ 请参考一下网址： ftp://www.bjlx.org.cn/  （北京龙芯的ftp，所有的系统都能在这里下载到) http://bbs.lemote.com/redirect.php?tid=25756&#38;goto=lastpost （Gentoo N32系统讨论贴) http://bbs.lemote.com/viewthread.php?tid=4237&#38;extra=page%3D2 (憨牛N64系统讨论贴) http://dev.lemote.com/drupal/book/export/html/62  （操作系统安装方法) 相关文章： WebKit和Firefox的JavaScript性能对比 拥有Nanojit龙芯后端的firefox发布(10年1月14日更新) GCC初窥 用crossdev装龙芯的n32 gnu交叉工具链 使用crossdev安装龙芯的O32 gnu交叉工具链 小例子&#8211;回眸一笑百媚生<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F05%2F10894%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯电脑常见问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F09%2F19%2F11208%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC即将支持龙芯3A</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F08%2F15%2F11127%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于龙芯公司的小道消息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F06%2F28%2F10983%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯N32系统上的Squirrelfish性能</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F07%2F09%2F11055%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯中科公司招聘JAVA虚拟机开发工程师</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/22/10668/' rel='bookmark' title='WebKit和Firefox的JavaScript性能对比'>WebKit和Firefox的JavaScript性能对比</a></li>
<li><a href='http://www.lingcc.com/2009/12/24/10451/' rel='bookmark' title='拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)'>拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/21/10663/' rel='bookmark' title='小例子&#8211;回眸一笑百媚生'>小例子&#8211;回眸一笑百媚生</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>本博在实际工作中，曾经安装过不少龙芯电脑的系统，可谓稍有经验，这里略微介绍一些常见问题。</p>
<ol>
<li>内核通用吗？一般龙芯2F使用MIPSIII的指令级，内核格式都为64位的文件。所以不管时O32系统还是N32系统，只要硬件相同都是通用的，不过别忘了连同/lib/modules 和/lib/firmware一起使用：）</li>
<li>龙芯到底有多少种系统？很多，按照ABI分为3类：O32，N32，N64.O32是出厂时自带的系统，一般龙芯盒子中的华镭，龙芯本中的loonux、红旗和龙芯一体机中的共创都是O32系统。这类系统基本都是在debian的基础上做做山寨化。当然也有英文版的debian系统，这个比较干净一些。对于O32的系统，源的问题最头疼，因为各个公司画地为牢，大家都努力维护自己的源，又都缺人手，所以都不完美，试了几个都不太好，装着装着就会出依赖问题，除非一直跟着升级，不然一次apt-get dist-upgrade，那简直是噩梦。N32的系统，zhllg基于Gentoo的已经有了，龙芯论坛里就能找到下载链接。因为Gentoo是自己直接编译，问题相对少些。debian的还没有。N64的系统，有憨牛LFS的，没有试过。至于为啥会有这么多系统，得问问MIPS，因为有不少改进，就产生了不少问题。请参考本博<a href="../../../02/25/10698/" target="_blank">&lt;好大一筐梅普斯&gt;</a>.N32系统据说比O32快20%-30%。因为龙芯本身是64位处理器，所以64位系统也没问题.</li>
<p><span id="more-10717"></span></p>
<li>龙芯系统好装吗？好装！虽然咱们做的系统很山寨，但咱们的易用性很牛。官方提供了很多中安装和还原方式，硬盘，U盘和网络样样都行，很简单。只要下载一个rescue的内核，就能启动一个迷你的linux系统，有些小命令可以跑，接着再找你想要的系统，下载，解压到龙芯电脑的硬盘上即可。方便快捷，想装N32 就去下gentoo系统，想装O32就去下debian. Android都能装了。北京龙芯俱乐部的FTP里有各种OS，找最新的下就行了。文后有链接地址：）</li>
<li>为啥我的U盘识别不了？呵呵，问题不大，如果你已经确定按照相关步骤执行，并且U盘确实已经插进USB口，还有问题的话，那就换个U盘。因为PMON可能对部分U盘不识别，而且最好把U盘格式化成ext3格式的.pmon的时候可以执行devls，看看有没有usb设备。</li>
<li>装龙芯系统要几步？基本是三四步的样子，load内核，g+内核启动参数启动系统，再解压新系统。龙梦出厂的很多电脑都自带了还原功能，如果你还没有把它折腾坏的话，那就用还原吧。</li>
<li>fdisk对龙芯电脑上的硬盘做了分区，无法启动了咋办？这是我遇到的一个问题。龙芯电脑上本地的系统中对不用的几个分区用fdisk操作，之后重启，发现直接找不到wd0.很可能是硬盘分区表没有写对。这时候最好的方式是想办法再正确的执行一次fdisk。我的解决方法是，找了一个正常系统的内核，启动之，给内核的参数中指定根目录，系统成功启动，再执行了一次fdisk，做了几个小修改，保存，再重启就没问题了。至于为啥换个内核，指定根目录就能启动了，呵呵我也不太清除。</li>
<li>N32的Gentoo系统下载的是带x版本的，但是启动时报错：Warning:unable to open an initial console，然后就卡住了，怎么办？这是因为linux系统中有文件没办法做到压缩包中，需要手动mknod创建。执行下列命令就ok了。</li>
<p><strong>mknod -m 600 dev/console c 5 1<br />
mknod -m 666 dev/null c 1 3<br />
cp -a dev/{console,null} lib/udev/devices/</strong></ol>
<div><strong>请参考一下网址：</strong></div>
<div><strong>ftp://www.bjlx.org.cn/  （北京龙芯的ftp，所有的系统都能在这里下载到)</strong></div>
<div><strong>http://bbs.lemote.com/redirect.php?tid=25756&amp;goto=lastpost （Gentoo N32系统讨论贴)</strong></div>
<div><strong>http://bbs.lemote.com/viewthread.php?tid=4237&amp;extra=page%3D2 (憨牛N64系统讨论贴)</strong></div>
<div><strong>http://dev.lemote.com/drupal/book/export/html/62  （操作系统安装方法)</strong></div>
<div><strong><br />
</strong></div>
<div><strong><br />
</strong></div>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F05%2F10894%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯电脑常见问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F09%2F19%2F11208%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC即将支持龙芯3A</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F08%2F15%2F11127%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于龙芯公司的小道消息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F06%2F28%2F10983%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯N32系统上的Squirrelfish性能</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F07%2F09%2F11055%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F25%2F10717%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯中科公司招聘JAVA虚拟机开发工程师</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/22/10668/' rel='bookmark' title='WebKit和Firefox的JavaScript性能对比'>WebKit和Firefox的JavaScript性能对比</a></li>
<li><a href='http://www.lingcc.com/2009/12/24/10451/' rel='bookmark' title='拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)'>拥有Nanojit龙芯后端的firefox发布(10年1月14日更新)</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/21/10663/' rel='bookmark' title='小例子&#8211;回眸一笑百媚生'>小例子&#8211;回眸一笑百媚生</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/03/25/10717/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>GNU工具链学习笔记</title>
		<link>http://www.lingcc.com/2010/03/08/10709/</link>
		<comments>http://www.lingcc.com/2010/03/08/10709/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 12:43:40 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[GCC]]></category>
		<category><![CDATA[编译技术]]></category>
		<category><![CDATA[编译理论实践和应用]]></category>
		<category><![CDATA[elf]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[glibc]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[objdump]]></category>
		<category><![CDATA[工具链]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10709</guid>
		<description><![CDATA[1..so为动态链接库，.a为静态连接库。他们在Linux下按照ELF格式存储。ELF有四种文件类型。可重定位文件(Relocatable file,*.o，*.a),包含代码和数据，可用来连接成可执行文件或共享目标文件;可执行文件(Executable File),ELF可执行文件；共享目标文件(Shared Object File,*.so),包含代码和数据；核心转储文件(Core Dump File),进程意外终止时，系统将该进程的地址空间内容和其他信息保存到该文件中。 file命令可以查看。 2，Objdump程序，来自binutils，可以查看Object file内的结构。-h：打印各个段基本信息；-s所有段内容以16进制打印;-d:将所有包含指令的段反汇编。 3, ar -t libc.a；查看libc.a压缩了那些.o文件。 4, collect2 是ld连接器的包装，它调用ld链接目标文件，并对结果做处理，包括收集所有与程序初始化相关的信息并构造初始化结构。 5，readelf：查看ELF文件。 -s:打印符号信息； 6, size *.o : 用于查看ELF文件代码段，数据段和BSS(Block Started by Symbol,为未初始化的全局变量和局部静态变量预留位置)段的长度。 7, nm：查看目标文件的符号信息。 8，C运行时库GlibC,由两部分组成，头文件和二进制库，前者多在/usr/include下，后者主要是C语言的标准库，有静态(/usr/lib/libc.a)和动态(/lib/libc.so.6)两个.另外还有/usr/lib/crt1.o(含程序入口函数_start,负责初始化libc和调用main),/usr/lib/crti.o(负责main函数执行前全局和静态对象的构造)和/usr/lib/crtn.o(负责main函数执行后，全局和静态对象的析构)三个辅助程序运行的库。链接器会收集所有输入目标文件中对全局和静态对象的构造/析构操作，合并到输出文件的构造和析构操作中。 9.GCC中的几个库文件，这些库文件都在GCC的安装目录下，Gentoo系统中的目录为/usr/lib/gcc/i686-pc-linux-gnu/4.4.3/。crtbeginT.o和crtend.o,负责C++全局构造和析构的目标文件，因为glibc只是C语言运行库，GCC实现C++语言，所以C++中构造和析构需要glibc中的C语言构造/析构和GCC中相应的构造/析构。libgcc.a用来对付GCC在多平台上运行时的差异问题；libgcc_eh.a包含了支持C++异常处理的平台相关函数。libgcc_s.so是libgcc.a的动态链接版本。 10.ldd 打印共享库依赖关系。 以上内容摘抄自《程序员的自我修养 &#8211;链接，装载与库》 相关文章： GCC初窥 GCC中的pie和fpie选项 Gentoo中的交叉编译利器&#8211;crossdev zz Linux下的段错误的原因及调试 使用crossdev安装龙芯的O32 gnu交叉工具链 用crossdev装龙芯的n32 gnu交叉工具链<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F08%2F10609%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC中的pie和fpie选项</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F08%2F27%2F9982%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">zz Linux下的段错误的原因及调试</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2009%2F11%2F20%2F10065%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gcc和Open64中的-fPIC选项</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F25%2F10951%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">认识静态链接库</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/08/10609/' rel='bookmark' title='GCC中的pie和fpie选项'>GCC中的pie和fpie选项</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2008/08/27/9982/' rel='bookmark' title='zz Linux下的段错误的原因及调试'>zz Linux下的段错误的原因及调试</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>1..so为动态链接库，.a为静态连接库。他们在Linux下按照ELF格式存储。ELF有四种文件类型。可重定位文件(Relocatable file,*.o，*.a),包含代码和数据，可用来连接成可执行文件或共享目标文件;可执行文件(Executable File),ELF可执行文件；共享目标文件(Shared Object File,*.so),包含代码和数据；核心转储文件(Core Dump File),进程意外终止时，系统将该进程的地址空间内容和其他信息保存到该文件中。<br />
file命令可以查看。<br />
2，Objdump程序，来自binutils，可以查看Object file内的结构。-h：打印各个段基本信息；-s所有段内容以16进制打印;-d:将所有包含指令的段反汇编。<br />
3, ar -t libc.a；查看libc.a压缩了那些.o文件。<br />
4, collect2 是ld连接器的包装，它调用ld链接目标文件，并对结果做处理，包括收集所有与程序初始化相关的信息并构造初始化结构。<br />
5，readelf：查看ELF文件。 -s:打印符号信息；<br />
<span id="more-10709"></span><br />
6, size *.o : 用于查看ELF文件代码段，数据段和BSS(Block Started by Symbol,为未初始化的全局变量和局部静态变量预留位置)段的长度。<br />
7, nm：查看目标文件的符号信息。<br />
8，C运行时库GlibC,由两部分组成，头文件和二进制库，前者多在/usr/include下，后者主要是C语言的标准库，有静态(/usr/lib/libc.a)和动态(/lib/libc.so.6)两个.另外还有/usr/lib/crt1.o(含程序入口函数_start,负责初始化libc和调用main),/usr/lib/crti.o(负责main函数执行前全局和静态对象的构造)和/usr/lib/crtn.o(负责main函数执行后，全局和静态对象的析构)三个辅助程序运行的库。链接器会收集所有输入目标文件中对全局和静态对象的构造/析构操作，合并到输出文件的构造和析构操作中。<br />
9.GCC中的几个库文件，这些库文件都在GCC的安装目录下，Gentoo系统中的目录为/usr/lib/gcc/i686-pc-linux-gnu/4.4.3/。crtbeginT.o和crtend.o,负责C++全局构造和析构的目标文件，因为glibc只是C语言运行库，GCC实现C++语言，所以C++中构造和析构需要glibc中的C语言构造/析构和GCC中相应的构造/析构。libgcc.a用来对付GCC在多平台上运行时的差异问题；libgcc_eh.a包含了支持C++异常处理的平台相关函数。libgcc_s.so是libgcc.a的动态链接版本。<br />
10.ldd 打印共享库依赖关系。</p>
<p>以上内容摘抄自《程序员的自我修养 &#8211;链接，装载与库》</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F08%2F10609%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">GCC中的pie和fpie选项</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F08%2F27%2F9982%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">zz Linux下的段错误的原因及调试</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2009%2F11%2F20%2F10065%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gcc和Open64中的-fPIC选项</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F25%2F10951%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">认识静态链接库</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F08%2F10709%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/08/10609/' rel='bookmark' title='GCC中的pie和fpie选项'>GCC中的pie和fpie选项</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2008/08/27/9982/' rel='bookmark' title='zz Linux下的段错误的原因及调试'>zz Linux下的段错误的原因及调试</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/03/08/10709/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

