[ef2b63b] | 1 | <sect2><title> </title><para> </para></sect2>
|
---|
| 2 |
|
---|
[1987d72] | 3 | <sect2>
|
---|
| 4 | <title>Why we copy the kernel headers and don't symlink them</title>
|
---|
| 5 |
|
---|
[bed61bb] | 6 | <para>In the past it was common practice to symlink the
|
---|
| 7 | <filename class="directory">/usr/include/{linux,asm}</filename> directories
|
---|
| 8 | to <filename class="directory">/usr/src/linux/include/{linux,asm}</filename>.
|
---|
| 9 | This was a <emphasis>bad</emphasis> practice, as the following extract from a
|
---|
| 10 | post by Linus Torvalds to the Linux Kernel Mailing List points out:</para>
|
---|
[1987d72] | 11 |
|
---|
| 12 | <screen>I would suggest that people who compile new kernels should:
|
---|
| 13 |
|
---|
| 14 | - not have a single symbolic link in sight (except the one that the
|
---|
| 15 | kernel build itself sets up, namely the "linux/include/asm" symlink
|
---|
| 16 | that is only used for the internal kernel compile itself)
|
---|
| 17 |
|
---|
| 18 | And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
|
---|
| 19 | header files, even though I haven't run a 2.2.13 kernel in a _loong_
|
---|
| 20 | time. But those headers were what glibc was compiled against, so those
|
---|
| 21 | headers are what matches the library object files.
|
---|
| 22 |
|
---|
| 23 | And this is actually what has been the suggested environment for at
|
---|
| 24 | least the last five years. I don't know why the symlink business keeps
|
---|
| 25 | on living on, like a bad zombie. Pretty much every distribution still
|
---|
| 26 | has that broken symlink, and people still remember that the linux
|
---|
| 27 | sources should go into "/usr/src/linux" even though that hasn't been
|
---|
| 28 | true in a _loong_ time.</screen>
|
---|
| 29 |
|
---|
[bed61bb] | 30 | <para>The essential part is where Linus states that the header files should be
|
---|
[2c094d6] | 31 | <emphasis>the ones which glibc was compiled against</emphasis>. These are
|
---|
[bed61bb] | 32 | the headers that should be used when you later compile other packages, as they
|
---|
| 33 | are the ones that match the object-code library files. By copying the headers,
|
---|
| 34 | we ensure that they remain available if later you upgrade your kernel.</para>
|
---|
| 35 |
|
---|
| 36 | <para>Note, by the way, that it is perfectly all right to have the kernel sources
|
---|
| 37 | in <filename class="directory">/usr/src/linux</filename>, as long as you don't
|
---|
| 38 | have the <filename class="directory">/usr/include/{linux,asm}</filename>
|
---|
| 39 | symlinks.</para>
|
---|
[1987d72] | 40 |
|
---|
| 41 | </sect2>
|
---|
[bed61bb] | 42 |
|
---|