[94f49159] | 1 | <sect2>
|
---|
| 2 | <title>Why we copy the kernel headers and don't symlink them</title>
|
---|
| 3 |
|
---|
[18b6e01e] | 4 | <para>In the past, it was common practice for people to symlink the
|
---|
[94f49159] | 5 | /usr/include/linux and asm directories to /usr/src/linux/include/linux
|
---|
| 6 | and asm respectively. This is a <emphasis>bad</emphasis> idea as
|
---|
| 7 | this extract from a post by Linus Torvalds to the Linux Kernel
|
---|
| 8 | Mailing List points out:</para>
|
---|
| 9 |
|
---|
| 10 | <screen>I would suggest that people who compile new kernels should:
|
---|
| 11 |
|
---|
| 12 | - not have a single symbolic link in sight (except the one that the
|
---|
| 13 | kernel build itself sets up, namely the "linux/include/asm" symlink
|
---|
| 14 | that is only used for the internal kernel compile itself)
|
---|
| 15 |
|
---|
| 16 | And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
|
---|
| 17 | header files, even though I haven't run a 2.2.13 kernel in a _loong_
|
---|
| 18 | time. But those headers were what glibc was compiled against, so those
|
---|
| 19 | headers are what matches the library object files.
|
---|
| 20 |
|
---|
| 21 | And this is actually what has been the suggested environment for at
|
---|
| 22 | least the last five years. I don't know why the symlink business keeps
|
---|
| 23 | on living on, like a bad zombie. Pretty much every distribution still
|
---|
| 24 | has that broken symlink, and people still remember that the linux
|
---|
| 25 | sources should go into "/usr/src/linux" even though that hasn't been
|
---|
| 26 | true in a _loong_ time.</screen>
|
---|
| 27 |
|
---|
| 28 | <para>The relevant part here is where he states that the headers should
|
---|
| 29 | be the ones which <emphasis>glibc was compiled against</emphasis>. These are
|
---|
[ef94a94] | 30 | the headers which should remain accessible and so by copying them, we ensure
|
---|
[94f49159] | 31 | that we follow these guidelines. Also note that as long as you don't have
|
---|
[b57edf0] | 32 | those symlinks, it is perfectly fine to have the kernel sources
|
---|
[94f49159] | 33 | in <filename>/usr/src/linux</filename>.</para>
|
---|
| 34 |
|
---|
| 35 | </sect2>
|
---|