|
发表于 2002-12-3 19:49:43
|
显示全部楼层
下面是LFS书里对这个问题的解释:
为什么我们不是创建这些目录的链接而是拷贝它们
过去人们通常是创建从 /usr/include/{linux,asm} 目录到 /usr/src/linux/include/{linux,asm} 的符号链接。这是一种不好的行为,在下面 Linus Torvalds (Linux之父)写到 Linux Kernel Mailing List 信的节选中说:
I would suggest that people who compile new kernels should:
- not have a single symbolic link in sight (except the one that the
kernel build itself sets up, namely the "linux/include/asm" symlink
that is only used for the internal kernel compile itself)
And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
header files, even though I haven't run a 2.2.13 kernel in a _loong_
time. But those headers were what glibc was compiled against, so those
headers are what matches the library object files.
And this is actually what has been the suggested environment for at
least the last five years. I don't know why the symlink business keeps
on living on, like a bad zombie. Pretty much every distribution still
has that broken symlink, and people still remember that the linux
sources should go into "/usr/src/linux" even though that hasn't been
true in a _loong_ time.
Linus 所说的精华部份是头文件应该是 glibc 编译时链接到的. 我们这里的头文件是你后面编译其它包时要用到的,因为它们是与对象(object-code)库文件相匹配的。通过拷贝头文件,我们保证它们在你以后升级内核后能继续使用它们。
注意,附带着说一句,内核代码在 /usr/src/linux 目录里是能正确使用的,只要你没有创建 /usr/include/{linux,asm} 的符号链接。 |
|