为什么 INSTALL_MOD_STRIP 默认不开启?

为什么 INSTALL_MOD_STRIP 默认不开启?

我已经有几年没有编译过 Linux 内核了,现在我再次开始编译时,我发现除非INSTALL_MOD_STRIP=1传递给,否则模块默认安装有调试符号make modules_install,这使得它们非常庞大,以至于我的 initrd 映像增长到数百兆字节。

我只是INSTALL_MOD_STRIP在 Google 上搜索了一番之后才找到这个选项,而且即使在那时,也只是在论坛帖子中人们问为什么他们的模块这么大。

所以我想知道,当我使用预编译内核时,这种情况发生改变的原因是什么?现在默认安装模块时会带有调试符号(即使二进制发行版仍然会删除它们),这有什么原因吗?在内核中使用调试符号似乎相当深奥,而且在安装大小方面显然存在很大的缺点。

基本上,我是否应该将其INSTALL_MOD_STRIP视为标准内核编译公式的一部分?从大约 2.6.25 开始,构建过程是否还有其他我应该注意的变化?

答案1

我只是发布相关补丁的日志消息来回答你的问题谁/为什么更改了它:

commit 2ea038917bbdd51a7ae4a898c6a04641324dd033
Author: Sam Ravnborg <[email protected]>
Date:   Wed Jan 14 21:38:20 2009 +0100

Revert "kbuild: strip generated symbols from *.ko"

This reverts commit ad7a953c522ceb496611d127e51e278bfe0ff483.

And commit: ("allow stripping of generated symbols under CONFIG_KALLSYMS_ALL")
            9bb482476c6c9d1ae033306440c51ceac93ea80c

These stripping patches has caused a set of issues:

1) People have reported compatibility issues with binutils due to
   lack of support for `--strip-unneeded-symbols' with objcopy 2.15.92.0.2
   Reported by: Wenji
2) ccache and distcc no longer works as expeced
   Reported by: Ted, Roland, + others
3) The installed modules increased a lot in size
   Reported by: Ted, Davej + others

Reported-by: Wenji Huang <[email protected]>
Reported-by: "Theodore Ts'o" <[email protected]>
Reported-by: Dave Jones <[email protected]>
Reported-by: Roland McGrath <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>

相关内容