📄 stripping.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=gb2312" />
<title>
5.33. Stripping
</title>
<link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
</head>
<body id="lfs" class="6.1">
<div class="navheader">
<div class="headertitles">
<h4>
Linux From Scratch - Version 6.1
</h4>
<h3>
Chapter 5. 构建临时编译环境
</h3>
</div>
<ul class="headerlinks">
<li class="prev">
<a accesskey="p" href="perl.html" title="Perl-5.8.6">后退</a>
<p>
Perl-5.8.6
</p>
</li>
<li class="next">
<a accesskey="n" href="../part3.html" title="Building the LFS System">前进</a>
<p>
Building the LFS System
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter05.html" title="Chapter 5. 构建临时编译环境">上一级</a>.
</li>
<li class="home">
<a accesskey="h" href="../index.html" title="Linux From Scratch - Version 6.1">回首页</a>
</li>
</ul>
</div>
<div class="sect1" lang="zh_cn" xml:lang="zh_cn">
<div class="titlepage">
<h1 class="sect1">
5.33. Stripping (去掉调试符号,清理垃圾)
</h1>
</div>
<p>本节的步骤是可选的,但如果 LFS 分区实在很小则除外;了解哪些东西是不必要的、可以删除的也是有好处的。到目前为止已经安装的可执行程序和库文件包含大约 130 MB 不必要的调试符号,运行下面的命令删除这些符号:
</p>
<pre class="userinput"><kbd class="command">strip --strip-debug /tools/lib/*
strip --strip-unneeded /tools/{,s}bin/*</kbd></pre>
<p>上面的命令会跳过大约 20 个文件,报告不能识别这些文件格式,其中大多数是脚本而不是二进制文件。
</p>
<p>
<span class="emphasis"><em>千万不要</em></span> 在库文件上使用 <em class="parameter"><tt>--strip-unneeded</tt></em> ,否则会破坏其静态版本,这样你不得不又从头开始编译全部的工具链软件包。
</p>
<p>删除文档还可以节省 30 MB 空间:
</p>
<pre class="userinput"><kbd class="command">rm -rf /tools/{info,man}</kbd></pre>
<p>现在 LFS 文件系统上就有至少 850 MB 剩余空间,可以在下一章编译安装 Glibc。如果有足够空间编译安装 Glibc,那编译安装其它的软件包也没有问题。
</p>
</div>
<div class="navfooter">
<ul>
<li class="prev">
<a accesskey="p" href="perl.html" title="Perl-5.8.6">后退</a>
<p>
Perl-5.8.6
</p>
</li>
<li class="next">
<a accesskey="n" href="../part3.html" title="Building the LFS System">前进</a>
<p>
Building the LFS System
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter05.html" title="Chapter 5. 构建临时编译环境">上一级</a>.
</li>
<li class="home">
<a accesskey="h" href="../index.html" title="Linux From Scratch - Version 6.1">回首页</a>.
</li>
</ul>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -