Gentoo Archives: gentoo-server

From: Marius Mauch <genone@g.o>
To: gentoo-server@××××××××××××.org
Subject: Re: [gentoo-server] linux-headers: insanity? WAS: linux-headers update?
Date: Wed, 30 Mar 2005 23:11:26
Message-Id: 424B24A4.7020902@gentoo.org
In Reply to: [gentoo-server] linux-headers: insanity? WAS: linux-headers update? by peter.gantner@stud.uni-graz.at
1 peter.gantner@×××××××××××××.at wrote:
2
3 > In a LKML post [1] about the symlinking of /usr/include/linux to
4 > /usr/src/linux/include/ which has been done for quite some time in older
5 > Linux distributions, Linus calls doing this "instanity" and states that
6 > the kernel headers used to compile glibc and friends should always be
7 > taken from the glibc distribution (which includes a patched set of
8 > kernel headers) and one should not use the headers from the kernel.org
9 > tarball.
10
11 You misread what he said (see below).
12
13 > But this is exactly what Gentoos linux-headers package does: get the
14 > kernel tarball and install the required files. The result is in effect
15 > not really different from the old symlinking method.
16
17 It is.
18
19 > Now am I misreading Linus' recommendation?
20 > When he sais:
21 >
22 >> Basically, that symlink should not be a symlink. It's a symlink for
23 >> historical reasons, none of them very good any more (and haven't been
24 >> for a long time), and it's a disaster unless you want to be a C
25 >> library developer. Which not very many people want to be.
26 >
27 >> The fact is, that the header files should match the library you link
28 >> against, not the kernel you run on.
29
30 That's the important sentence.
31
32 > and later:
33 >
34 >> [...] you should not use the kernel headers: You should use the
35 >> headers that glibc came with. It is probably a Red Hat bug that those
36 >> headers were a symbolic link.
37 >
38 >
39 > Does that mean:
40 > a) glibc comes with patched kernel headers that should always be used
41 > when compiling other applications/libs
42 > or
43 > b) it doesn't matter what kernel headers you use to build your glibc
44 > with as long as any apps that use glibc use the very same headers at
45 > compile time.
46
47 b)
48 The point is that all libraries/applications should use the same
49 headers. When you make a symlink the headers are changed on every kernel
50 upgrade, so applications using those headers (in theory only glibc and
51 kernel related applications should directly use those headers, but lets
52 ignore that for now) might have a different idea about data structures
53 than glibc, and that can result in very weird (and possibly serious)
54 problems.
55
56 Marius
57 --
58 gentoo-server@g.o mailing list