Re: /usr/include/linux and /usr/include/asm?
On Tue, 29 Jun 1999, Evan Van Dyke wrote: > *SNIP* > > However, I expect I'm the only one who thinks that's the proper > > approach so, how's this for a solution: Give the /usr/include/asm and > > /usr/include/linux directories up as lost causes. Instead, define new > > directories. Say /usr/include/kernel-asm and /usr/include/kernel-linux. > > Make THEM symlinks to the appropriate directories in the kernel source > > tree. I would do this on my own computer, but I don't really get any > > benefit from it unless everyone else, particularly those who develop > > modules and whatnot, decides to use the same convention. > > Therefore, we then attempt to convince people to actually use those > > directories instead of /usr/include/asm and /usr/include/linux for the > > good reasons that we've discussed. > If you havn't read the letter by Linux Torvalds that was referred to under > this thread within the last few days, I suggest that you do so. I read it. In fact, the message that you quote was primarily in response to that message. I UNDERSTAND the problem. I solved similar problems back 15 years ago when I first started debugging clibs. It's the solution that I find lacking. Too bad you didn't quote the part of my message that was really important: Making my life tougher because it's easier for me to deal with it than Joe Random Luser is NOT AN ACCEPTABLE SOLUTION! Yes, I can deal with it Joe Random Luser, but I shouldn't have to. > The obvious choice seems to be /usr/src/linux/include/linux and > /usr/src/linux/include/asmas that is where most people store their > kernel source. Why clutter up /usr/include more with kernel-specific > headers? The entire point is that the /usr/include/* headers should be > kernel-independant after all. Why is that the point? If that's the point, it's a damn stupid one. Look, header files go under /usr/include and /usr/local/include. Since the header files that are kernel specific aren't local to the system, they should be accessible under /usr/include. I should be able to refer to them like that. THAT is what is obvious to me. Why clutter up /usr/include with directories containing kernel-specific headers? Well, why clutter it up with omniORB and ggi and php3? Because /usr/include and the directories underneath are where header files GO, aren't they? Having two sets of files with identical names and nearly identical contents just galls me. What do I care what kernel the glibc maintainer built libc.so.6 on? Why should I keep those files around? The real issue is one that I talked about in my original message: idempotence. While I agree that libc has to know about the kernel calls so that it can wrap them in C-standard functions, it is apparent that glibc, at least, knows far more about the internals of the kernel than is good for it. It is essential that a given version of glibc be able to run on newer kernel versions and on patched kernels. That requires careful design and some foresight, which appears to be lacking in this case. Let's take an example or two from the message from Linus Torvalds: The use of the NR_OPEN constant. The kernel (apparently---I just skimmed over it) uses NR_OPEN to set how many file handles any given task must have. That is, it allocates an array of NR_OPEN "struct file *" for each task that is forked. (The code is in kernel/fork.c, if you have a mind.) Why does glibc refer to this constant anywhere? The number of files that the kernel allows to be opened doesn't necessarily have anything to do with the number of files glibc allows you to open. I suppose that glibc might put an array of size NR_OPEN in order to hold the file handles, but that's dumb. The ISO C standard says that the constant that defines the maximum number of open files is FOPEN_MAX, and it is far smarter to put your file handle in the FILE struct and declare your FILE array to be of size FOPEN_MAX. #define FOPEN_MAX to be the same as NR_OPEN? Use the same sigset_t for both glibc and the Linux kernel? Yes, you COULD do that, but those things don't necessarily have anything to do with each other, and it is poor practice to use the same abstraction to refer to unrelated things even if they happen to be the same at some point. libc abstractions, what most programs use, are NEVER required to be the same as the kernel abstractions. While I agree that you can work around the problem by requiring that /usr/include/asm and /usr/include/linux be the contents of the directories /usr/src/linux/include/asm and /usr/src/linux/include/linux on the system used by the builder of the glibc and by requiring that the kernel source must ALWAYS be in /usr/src/linux, but that is not the correct solution. That is a massive kluge needed because people can't seem to be bothered to do things correctly. The correct solution is to eliminate those instances where constants are used for purposes that they have no business being used for. It's like defining the FO
Re: /usr/include/linux and /usr/include/asm?
In article <[EMAIL PROTECTED]>, Jonathan Guthrie <[EMAIL PROTECTED]> wrote: >Now, this is getting nonsensical. First, you tell me that the reason that [rant deleted] Why can't you simply use -I/usr/src/linux/include if you need those specific kernel includes. Mike. -- Beware of Programmers who carry screwdrivers.
Re: /usr/include/linux and /usr/include/asm?
Jonathan Guthrie wrote: *SNIP* > However, I expect I'm the only one who thinks that's the proper > approach so, how's this for a solution: Give the /usr/include/asm and > /usr/include/linux directories up as lost causes. Instead, define new > directories. Say /usr/include/kernel-asm and /usr/include/kernel-linux. > Make THEM symlinks to the appropriate directories in the kernel source > tree. I would do this on my own computer, but I don't really get any > benefit from it unless everyone else, particularly those who develop > modules and whatnot, decides to use the same convention. > > Therefore, we then attempt to convince people to actually use those > directories instead of /usr/include/asm and /usr/include/linux for the > good reasons that we've discussed. If you havn't read the letter by Linux Torvalds that was referred to under this thread within the last few days, I suggest that you do so. In a quick summary: Yes, /usr/include/linux;/usr/include/asm should include kernel- independant information for a variety of reasons that he spells out. Eventually, the other distributions should do the same thing, as it is a glibc thing. Debian was just the first to jump on the bandwagon. Programs that need to be kernel specific should find the kernel headers elsewhere. The obvious choice seems to be /usr/src/linux/include/linux and /usr/src/linux/include/asmas that is where most people store their kernel source. Why clutter up /usr/include more with kernel-specific headers? The entire point is that the /usr/include/* headers should be kernel-independant after all. --Evan
Re: /usr/include/linux and /usr/include/asm?
On Tue, 29 Jun 1999, Carl Mummert wrote: > >It's not the symlinks, it's the contents of /usr/include/*.h that's the > >problem. > They are the problem, but they cannot be fixed. Since the GNU C library > is portable to various kernels and hardware platforms, it has to get > its information about the underlying system from somewhere. Now, this is getting nonsensical. First, you tell me that the reason that there are no symlinks is because the details of the underlying system can interfere with the operation of the libc. Now, you tell me that the reason that you can't apply a proper fix the first problem is because sometimes libc has to get information about the underlying system. If you delete the symlinks and replace them with directories containing files that don't have anything to do with the kernel that's running you have eliminated any possibility of libc-based programs getting information about the underlying system. That means that the libc itself must not have access to information about the underlying system on those computers with the symlinks removed. This technique works, in most cases, because the libc doesn't have any business knowing what the kernel innards look like. Since most programs talk to libc rather than using kernel-specific interfaces, it works for most people. Unfortunately, I sometimes do kernel-specific programming and I think that this shows poor design and a complete lack of thought. I honestly expected better of you. (Well, them. I mostly mean the glibc maintainers.) Making my life a little tougher based upon the idea that I'm more able to deal with it than Joe Random Luser is NOT ACCEPTABLE to me. It shouldn't be acceptable to you, either. The files in /usr/include/sys (which, as you say, are the bulk of the problem) have no business referring to any files in /usr/include/linux or /usr/include/asm unless they need things that can change if the kernel changes. The proper approach would be to separate out the libc header stuff that's truly system-dependant (they won't kill libc-based programs because otherwise you'd need a new libc for every different kernel version) and put them in new header files that don't have any libc-killer stuff You can do that without changing the meaning of any of the linux include files if you use the approach outlined by Plauger in the C USER'S JOURNAL several years ago. However, I expect I'm the only one who thinks that's the proper approach so, how's this for a solution: Give the /usr/include/asm and /usr/include/linux directories up as lost causes. Instead, define new directories. Say /usr/include/kernel-asm and /usr/include/kernel-linux. Make THEM symlinks to the appropriate directories in the kernel source tree. I would do this on my own computer, but I don't really get any benefit from it unless everyone else, particularly those who develop modules and whatnot, decides to use the same convention. Therefore, we then attempt to convince people to actually use those directories instead of /usr/include/asm and /usr/include/linux for the good reasons that we've discussed. -- Jonathan Guthrie ([EMAIL PROTECTED]) Brokersys +281-895-8101 http://www.brokersys.com/ 12703 Veterans Memorial #106, Houston, TX 77014, USA
Re: /usr/include/linux and /usr/include/asm?
>I would have thought that someone would have figured out by now that >/usr/include/linux (at the very least) should reflect the status of the >kernel so that kernel-specific stuff can be done and that NOTHING in the >library or in the include files associated with that library should depend >upon the kernel-specific files. > >It's not the symlinks, it's the contents of /usr/include/*.h that's the >problem. They are the problem, but they cannot be fixed. Since the GNU C library is portable to various kernels and hardware platforms, it has to get its information about the underlying system from somewhere. Back when we had our very own private C library, we could get away with not separating the user-visible stuff from the kernel-only stuff. But when we start using portable libraries, we have to worry about what is used by normal programmers, and what is used only inside the kernel. find /usr/include -type f | xargs grep 'include.*
Re: (vmware) /usr/include/linux and /usr/include/asm?
My bad. the install.pl, IIRC, suggests unpacking vmnet-only.tar and/or vmmon-only.tar and making the modules by hand if it can't autobuild them. You'll get vmnet-only/Makefile and vmmon-only/Makefile. Again, IIRC. My vmware box is currently in M$ mode so I can play a game. :> On Mon, 28 Jun 1999, Bob Nielsen wrote: > I just looked in vmware-distrib and there ISN'T any Makefile (?). It > looks like install.pl handles it (somehow, it's beyond my grasp of > perl). > > Bob > > On Mon, Jun 28, 1999 at 06:00:50PM -0700, [EMAIL PROTECTED] wrote: > > > > What I've done is put my kernel source's include path in the vmware > > Makefile's include path (FI -I/usr/src/linux-2.3.6/include) and it has > > worked fine for me. > > > > I've also compiled the modules (and my kernel) with egcs (I'm running > > Slink - have had troubles upgrading to Potato; wanted to see what USB > > stuff breaks, if any) and -mpentium, and only have framebuffer conflicts > > so far. > > > > On Mon, 28 Jun 1999, Bob Nielsen wrote: > > > > > On Mon, Jun 28, 1999 at 11:24:55AM -0400, Paul D. Smith wrote: > > > > I tried to install vmware over the weekend and it wanted to compile a > > > > kernel module for my 2.2.10 kernel. It complained because my linux > > > > kernel header version was still 2.2.9. I looked and sure enough, > > > > /usr/include/linux and /usr/include/asm were both real directories with > > > > real files. > > > > > > > > Aren't these typically supposed to be symlinks to /usr/src/linux/...? > > > > > > > > Also, how did the headers there get up to 2.2.9? I haven't done > > > > anything fancy to copy headers into those directories, and I've been > > > > downloading kernel patches from www.linuxhq.com etc, not the Debian > > > > packages. Does the normal kernel build usually install these? I wonder > > > > why it didn't for 2.2.10? > > > > > > In Debian, the headers in /usr/include/linux and /usr/include/asm are > > > not symlinks to the kernel source, but are supplied by libc6-dev. As > > > this is periodically upgraded, they may be based on newer kernels--the > > > current potato version comes from 2.2.9. > > > > > > What I did to compile the vmware modules is to mv /usr/lib/linux to some > > > other location and replace it with a symlink to the headers in my 2.2.10 > > > kernel source. You can probably use symlinks all the time, but you > > > should read /usr/doc/libc6-dev/FAQ.Debian.gz to understand the rationale > > > as to why the headers are packaged this way. > > > > > > Bob > > > > > > -- > > > Bob Nielsen Internet: [EMAIL PROTECTED] > > > Tucson, AZ AMPRnet: [EMAIL PROTECTED] > > > DM42nh http://www.primenet.com/~nielsen > > > > > > > > > -- > > > Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null > > > > > > > -- > Bob Nielsen Internet: [EMAIL PROTECTED] > Tucson, AZ AMPRnet: [EMAIL PROTECTED] > DM42nh http://www.primenet.com/~nielsen >
Re: (vmware) /usr/include/linux and /usr/include/asm?
I just looked in vmware-distrib and there ISN'T any Makefile (?). It looks like install.pl handles it (somehow, it's beyond my grasp of perl). Bob On Mon, Jun 28, 1999 at 06:00:50PM -0700, [EMAIL PROTECTED] wrote: > > What I've done is put my kernel source's include path in the vmware > Makefile's include path (FI -I/usr/src/linux-2.3.6/include) and it has > worked fine for me. > > I've also compiled the modules (and my kernel) with egcs (I'm running > Slink - have had troubles upgrading to Potato; wanted to see what USB > stuff breaks, if any) and -mpentium, and only have framebuffer conflicts > so far. > > On Mon, 28 Jun 1999, Bob Nielsen wrote: > > > On Mon, Jun 28, 1999 at 11:24:55AM -0400, Paul D. Smith wrote: > > > I tried to install vmware over the weekend and it wanted to compile a > > > kernel module for my 2.2.10 kernel. It complained because my linux > > > kernel header version was still 2.2.9. I looked and sure enough, > > > /usr/include/linux and /usr/include/asm were both real directories with > > > real files. > > > > > > Aren't these typically supposed to be symlinks to /usr/src/linux/...? > > > > > > Also, how did the headers there get up to 2.2.9? I haven't done > > > anything fancy to copy headers into those directories, and I've been > > > downloading kernel patches from www.linuxhq.com etc, not the Debian > > > packages. Does the normal kernel build usually install these? I wonder > > > why it didn't for 2.2.10? > > > > In Debian, the headers in /usr/include/linux and /usr/include/asm are > > not symlinks to the kernel source, but are supplied by libc6-dev. As > > this is periodically upgraded, they may be based on newer kernels--the > > current potato version comes from 2.2.9. > > > > What I did to compile the vmware modules is to mv /usr/lib/linux to some > > other location and replace it with a symlink to the headers in my 2.2.10 > > kernel source. You can probably use symlinks all the time, but you > > should read /usr/doc/libc6-dev/FAQ.Debian.gz to understand the rationale > > as to why the headers are packaged this way. > > > > Bob > > > > -- > > Bob Nielsen Internet: [EMAIL PROTECTED] > > Tucson, AZ AMPRnet: [EMAIL PROTECTED] > > DM42nh http://www.primenet.com/~nielsen > > > > > > -- > > Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null > > > -- Bob Nielsen Internet: [EMAIL PROTECTED] Tucson, AZ AMPRnet: [EMAIL PROTECTED] DM42nh http://www.primenet.com/~nielsen
Re: (vmware) /usr/include/linux and /usr/include/asm?
What I've done is put my kernel source's include path in the vmware Makefile's include path (FI -I/usr/src/linux-2.3.6/include) and it has worked fine for me. I've also compiled the modules (and my kernel) with egcs (I'm running Slink - have had troubles upgrading to Potato; wanted to see what USB stuff breaks, if any) and -mpentium, and only have framebuffer conflicts so far. On Mon, 28 Jun 1999, Bob Nielsen wrote: > On Mon, Jun 28, 1999 at 11:24:55AM -0400, Paul D. Smith wrote: > > I tried to install vmware over the weekend and it wanted to compile a > > kernel module for my 2.2.10 kernel. It complained because my linux > > kernel header version was still 2.2.9. I looked and sure enough, > > /usr/include/linux and /usr/include/asm were both real directories with > > real files. > > > > Aren't these typically supposed to be symlinks to /usr/src/linux/...? > > > > Also, how did the headers there get up to 2.2.9? I haven't done > > anything fancy to copy headers into those directories, and I've been > > downloading kernel patches from www.linuxhq.com etc, not the Debian > > packages. Does the normal kernel build usually install these? I wonder > > why it didn't for 2.2.10? > > In Debian, the headers in /usr/include/linux and /usr/include/asm are > not symlinks to the kernel source, but are supplied by libc6-dev. As > this is periodically upgraded, they may be based on newer kernels--the > current potato version comes from 2.2.9. > > What I did to compile the vmware modules is to mv /usr/lib/linux to some > other location and replace it with a symlink to the headers in my 2.2.10 > kernel source. You can probably use symlinks all the time, but you > should read /usr/doc/libc6-dev/FAQ.Debian.gz to understand the rationale > as to why the headers are packaged this way. > > Bob > > -- > Bob Nielsen Internet: [EMAIL PROTECTED] > Tucson, AZ AMPRnet: [EMAIL PROTECTED] > DM42nh http://www.primenet.com/~nielsen > > > -- > Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null >
Re: /usr/include/linux and /usr/include/asm?
Look in the archives here: http://www.debian.org/Lists-Archives/debian-user-9702/msg00686.html for a note from linus about why things are the way they are. Carl
Re: /usr/include/linux and /usr/include/asm?
%% Bob Nielsen <[EMAIL PROTECTED]> writes: bn> In Debian, the headers in /usr/include/linux and /usr/include/asm are bn> not symlinks to the kernel source, but are supplied by libc6-dev. As bn> this is periodically upgraded, they may be based on newer kernels--the bn> current potato version comes from 2.2.9. Uhmm... bn> What I did to compile the vmware modules is to mv /usr/lib/linux to some bn> other location and replace it with a symlink to the headers in my 2.2.10 bn> kernel source. That's what I did, too. Didn't stop me, I was just curious. bn> You can probably use symlinks all the time, but you should read bn> /usr/doc/libc6-dev/FAQ.Debian.gz to understand the rationale as to bn> why the headers are packaged this way. 'Kay, I will when I get home. PS. I must say, without have read the rationale, that this seems _very_ drain bamaged to me (shipping the kernel headers with the libc package, I mean). Maybe I will be enlighted by the FAQ :) -- --- Paul D. Smith <[EMAIL PROTECTED]> Network Management Development "Please remain calm...I may be mad, but I am a professional." --Mad Scientist --- These are my opinions---Nortel Networks takes no responsibility for them.
Re: /usr/include/linux and /usr/include/asm?
On Mon, Jun 28, 1999 at 11:24:55AM -0400, Paul D. Smith wrote: > I tried to install vmware over the weekend and it wanted to compile a > kernel module for my 2.2.10 kernel. It complained because my linux > kernel header version was still 2.2.9. I looked and sure enough, > /usr/include/linux and /usr/include/asm were both real directories with > real files. > > Aren't these typically supposed to be symlinks to /usr/src/linux/...? > > Also, how did the headers there get up to 2.2.9? I haven't done > anything fancy to copy headers into those directories, and I've been > downloading kernel patches from www.linuxhq.com etc, not the Debian > packages. Does the normal kernel build usually install these? I wonder > why it didn't for 2.2.10? In Debian, the headers in /usr/include/linux and /usr/include/asm are not symlinks to the kernel source, but are supplied by libc6-dev. As this is periodically upgraded, they may be based on newer kernels--the current potato version comes from 2.2.9. What I did to compile the vmware modules is to mv /usr/lib/linux to some other location and replace it with a symlink to the headers in my 2.2.10 kernel source. You can probably use symlinks all the time, but you should read /usr/doc/libc6-dev/FAQ.Debian.gz to understand the rationale as to why the headers are packaged this way. Bob -- Bob Nielsen Internet: [EMAIL PROTECTED] Tucson, AZ AMPRnet: [EMAIL PROTECTED] DM42nh http://www.primenet.com/~nielsen
Re: /usr/include/linux and /usr/include/asm?
> > Also, how did the headers there get up to 2.2.9? I haven't done > > anything fancy to copy headers into those directories, and I've been > > downloading kernel patches from www.linuxhq.com etc, not the Debian > > packages. Does the normal kernel build usually install these? I wonder > > why it didn't for 2.2.10? > > This seems strange. How did you upgrade your kernel to 2.2.9? I believe the headers are in the libc6-dev package in potato... they're certianly in one of the libc6-* packages. you can always: dpkg -S /usr/include/linux/ to find out for sure. --Evan
Re: /usr/include/linux and /usr/include/asm?
[EMAIL PROTECTED] (Paul D. Smith) writes: > I tried to install vmware over the weekend and it wanted to compile a > kernel module for my 2.2.10 kernel. It complained because my linux > kernel header version was still 2.2.9. I looked and sure enough, > /usr/include/linux and /usr/include/asm were both real directories with > real files. > > Aren't these typically supposed to be symlinks to /usr/src/linux/...? With Debian it's different. There is an oppinion that the symlinks may not work in some cases, ans so Debian installs the headers in real directories. If you use Debian's way of building and installing a new kernel, then probably it would do this for you. I come from Slackware and I am used to upgrading the kernel old-fashioned way. I installed the symlinks ever since I installed Debian, and have had no problems with this all through kernels 2.0.36 - 2.2.10. > Also, how did the headers there get up to 2.2.9? I haven't done > anything fancy to copy headers into those directories, and I've been > downloading kernel patches from www.linuxhq.com etc, not the Debian > packages. Does the normal kernel build usually install these? I wonder > why it didn't for 2.2.10? This seems strange. How did you upgrade your kernel to 2.2.9? -- Arcady Genkin "... without money one gets nothing in this world, not even a certificate of eternal blessedness in the other world..." (S. Kierkegaard)
/usr/include/linux and /usr/include/asm?
I tried to install vmware over the weekend and it wanted to compile a kernel module for my 2.2.10 kernel. It complained because my linux kernel header version was still 2.2.9. I looked and sure enough, /usr/include/linux and /usr/include/asm were both real directories with real files. Aren't these typically supposed to be symlinks to /usr/src/linux/...? Also, how did the headers there get up to 2.2.9? I haven't done anything fancy to copy headers into those directories, and I've been downloading kernel patches from www.linuxhq.com etc, not the Debian packages. Does the normal kernel build usually install these? I wonder why it didn't for 2.2.10? -- --- Paul D. Smith <[EMAIL PROTECTED]> Network Management Development "Please remain calm...I may be mad, but I am a professional." --Mad Scientist --- These are my opinions---Nortel Networks takes no responsibility for them.