Re: Compile Issues

"Peter T. Breuer" <[email protected]>
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
"Also sprach Robert Scussel:"
> case there are any generated files...
> 
> 
> When I try to simply make I get the following error, or similar ones:
>    In file included from /usr/src/linux/include/asm/atomic.h:4,
>                   from /var/tmp/nbd-2.4.31/nbd/enbd-server.c:44:
> /usr/src/linux/include/linux/config.h:6:2: #error including kernel 
> header in userspace; use the glibc headers instead!

Yes, well don't do that then. Compile the userspace stuff against
userspace, and the kernelspace stuff against kernelspace. You have
kernel headers that are rigged to not like being compiled in userspace.

>    Also set the environment variable LINUXDIR to the location of the
>    kernel source directory for your target kernel, because nowadays
>    /usr/src/linux (the classical location) seems to be some fake that
>    points to whatever glibc was compiled against
> 
> This causes various errors and then make of enbd-server.o bombs 

No it doesn't. It causes no errors. It causes what SHOULD happen to
happen. Your kernel headers have been rigged not to work in userspace.
FIne - unrig them. Remove that deliberate error message.

I might add that all one needs is the ioctl definitions from
kernelspace. One has to get them somewhere. Since your distro is rigged
not to get them from kernelspace, why not just get them from userspace.
Set LINUXDIR=/usr !

When you come to compile the modules, THEN you can set LINUXDIR t yoru
intended target kernel.


Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.