kernel-exp-headers.xml 1.7 KB

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