Skip to contentSkip to conversation

Problem compiling LVM 1.0.5

linux-lvm Anders Widman 5 participants 5 messages Jul 31, 2002

lore
Share & tools
lore
#0 lore raw

I have a problem with compiling LVM 1.0.5.

Configure works fine. but when I run make I get this message:

[root@server 1.0.5]# make
make[1]: Entering directory `/usr/src/LVM/1.0.5/tools'
make[2]: Entering directory `/usr/src/LVM/1.0.5/tools/lib'
make[3]: Entering directory `/usr/src/LVM/1.0.5/tools/lib'
gcc -c -pipe -g -O0 -Wall -DDEBUG -I../../tools/lib -I../../tools -I/usr/src/LVM/1.0.5/tools/lib -o basename.o basename.c In file included from ../../tools/lib/liblvm.h:59,

                 from basename.c:34:

/usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
make[3]: *** [basename.o] Error 1
make[3]: Leaving directory `/usr/src/LVM/1.0.5/tools/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/LVM/1.0.5/tools/lib'
make[2]: Entering directory `/usr/src/LVM/1.0.5/tools/man8'
make[3]: Entering directory `/usr/src/LVM/1.0.5/tools/man8'
make[3]: Leaving directory `/usr/src/LVM/1.0.5/tools/man8'
make[2]: Leaving directory `/usr/src/LVM/1.0.5/tools/man8'
make[2]: Entering directory `/usr/src/LVM/1.0.5/tools'
gcc -c -pipe -g -O0 -Wall -DDEBUG -I../tools/lib -I../tools -I/usr/src/LVM/1.0.5/tools/lib -o e2fsadm.o e2fsadm.c In file included from ../tools/lib/liblvm.h:59,

                 from ../tools/lvm_user.h:43,
                 from e2fsadm.c:55:

/usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace make[2]: *** [e2fsadm.o] Error 1
make[2]: Leaving directory `/usr/src/LVM/1.0.5/tools'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/LVM/1.0.5/tools'
make[1]: Entering directory `/usr/src/LVM/1.0.5'

**********************************
There were errors in your compile.
**********************************

make[1]: *** [.touchbuilt] Error 1
make[1]: Leaving directory `/usr/src/LVM/1.0.5'
make: *** [all] Error 2

I am running Red Hat 7.3 with GCC 3.1.1 (and tried with the 2.96 that came with Red Hat..)

Thanks for any help.

//Anders

#1 lore raw
Quoted 2 lines · Anders Widman

/usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace

Try removing the line in tools/lib/liblvm.h that includes <linux/autoconf.h>.

Alasdair

Signature · 1 line
[email protected]
#2 lore raw
Quoted 7 lines · Alasdair G Kergon
Quoted 2 lines · Anders Widman

/usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace

Try removing the line in tools/lib/liblvm.h that includes <linux/autoconf.h>.

why don't you just do this in CVS?
it has been discussed before, see the list archives.

L.

Signature · 6 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
#3 lore raw
In reply to Anders Widman

Hello Anders,

it's a very simple solution.

in the new RH, glibc-devel and the INCLUDE policy/tactics is to DO NOT INCLUDE kernel header files to user space program.

you get this error:
#error Invalid kernel header included in userspace

this is only preprocessor directive-it's only to break make.

you can simple use the files from kernel include tree.

change the include path or overwrite the old one.

[root@gis2 root]# more /usr/include/linux/autoconf.h #error Invalid kernel header included in userspace [root@gis2 root]#
[root@gis2 root]# more /usr/src/linux/include/linux/autoconf.h
.....

it's save??????

for now yes, all programers need to change INCLUDE files for
COMPATIBLE INCLUDE TACTICS. this same problem has a lot of software. if you want know all about it read some articles on the web! :))

have a nice day!

Martin

Wednesday, July 31, 2002, 1:26:06 PM, you wrote:

AW> I have a problem with compiling LVM 1.0.5.

AW> Configure works fine. but when I run make I get this message:

AW> [root@server 1.0.5]# make
AW> make[1]: Entering directory `/usr/src/LVM/1.0.5/tools'
AW> make[2]: Entering directory `/usr/src/LVM/1.0.5/tools/lib'
AW> make[3]: Entering directory `/usr/src/LVM/1.0.5/tools/lib'
AW> gcc -c -pipe -g -O0 -Wall -DDEBUG -I../../tools/lib -I../../tools -I/usr/src/LVM/1.0.5/tools/lib -o basename.o basename.c AW> In file included from ../../tools/lib/liblvm.h:59,
AW> from basename.c:34:
AW> /usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
AW> make[3]: *** [basename.o] Error 1
AW> make[3]: Leaving directory `/usr/src/LVM/1.0.5/tools/lib'
AW> make[2]: *** [all] Error 2
AW> make[2]: Leaving directory `/usr/src/LVM/1.0.5/tools/lib'
AW> make[2]: Entering directory `/usr/src/LVM/1.0.5/tools/man8'
AW> make[3]: Entering directory `/usr/src/LVM/1.0.5/tools/man8'
AW> make[3]: Leaving directory `/usr/src/LVM/1.0.5/tools/man8'
AW> make[2]: Leaving directory `/usr/src/LVM/1.0.5/tools/man8'
AW> make[2]: Entering directory `/usr/src/LVM/1.0.5/tools'
AW> gcc -c -pipe -g -O0 -Wall -DDEBUG -I../tools/lib -I../tools -I/usr/src/LVM/1.0.5/tools/lib -o e2fsadm.o e2fsadm.c AW> In file included from ../tools/lib/liblvm.h:59,
AW> from ../tools/lvm_user.h:43,
AW> from e2fsadm.c:55:
AW> /usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
AW> make[2]: *** [e2fsadm.o] Error 1
AW> make[2]: Leaving directory `/usr/src/LVM/1.0.5/tools'
AW> make[1]: *** [all] Error 2
AW> make[1]: Leaving directory `/usr/src/LVM/1.0.5/tools'
AW> make[1]: Entering directory `/usr/src/LVM/1.0.5'

AW> **********************************
AW> There were errors in your compile.
AW> **********************************

AW> make[1]: *** [.touchbuilt] Error 1
AW> make[1]: Leaving directory `/usr/src/LVM/1.0.5' AW> make: *** [all] Error 2

AW> I am running Red Hat 7.3 with GCC 3.1.1 (and tried with the 2.96 that AW> came with Red Hat..)

AW> Thanks for any help.

AW> //Anders

AW> _______________________________________________
AW> linux-lvm mailing list
AW> [email protected]
AW> http://lists.sistina.com/mailman/listinfo/linux-lvm
AW> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

#4 lore raw
Quoted 2 lines · PosTel a.s.

in the new RH, glibc-devel and the INCLUDE policy/tactics is to DO NOT INCLUDE kernel header files to user space program.

Linus has been trying to get people to do this for years.

Basically, the Linus policy is that userland programs should *NEVER*
directly include kernel headers. That includes the C library itself. Kernel headers are decreed to be Not For Userland Consumption. The kernel provides a binary interface. If you want to use said binary interface, you are supposed to write your own headers, either from scratch, or via cut-and-paste from the kernel headers.

Whether or not this is the Right Thing to do is immaterial; this is what
the kernel hackers expect you to do.

Signature · 4 lines
Ben Scott <[email protected]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |