[ENBD] compilation problems
De Pelsemaeker Pieter
enbd@lists.community.tummy.com
Thu, 13 Feb 2003 09:41:55 +0100
Peter,
I have redhat 7.2 with kernel 2.4.9-34. :
[root@dwalin3 pdp]# uname -a
Linux dwalin3 2.4.9-34 #1 Sat Jun 1 06:23:33 EDT 2002 i586 unknown
The following packages are installed:
modutils-2.4.13-0.7.1.i386.rpm
kernel-2.4.9-34.i586.rpm
glibc-common-2.2.4-29.i386.rpm
glibc-devel-2.2.4-29.i386.rpm
kernel-source-2.4.9-34.i386.rpm
[root@dwalin2 pdp]# cd /usr/src
[root@dwalin2 src]# ls -l
total 8
lrwxrwxrwx 1 root root 9 Feb 12 10:10 linux ->
linux-2.4
lrwxrwxrwx 1 root root 14 Jan 6 16:26 linux-2.4 ->
linux-2.4.9-34
drwxr-xr-x 16 root root 4096 Nov 7 09:52 linux-2.4.9-34
drwxr-xr-x 7 root root 4096 Aug 21 16:56 redhat
[root@dwalin2 src]#
I do not find a definition for list_for_each_prev :
[root@dwalin2 pdp]# find / -name list.h
/usr/include/linux/list.h
/usr/include/isc/list.h
/usr/include/lwres/list.h
/usr/include/g++-3/list.h
/usr/local/include/isc-dhcp/list.h
/usr/src/linux-2.4.9-34/drivers/char/rio/list.h
/usr/src/linux-2.4.9-34/include/linux/list.h
[root@dwalin2 pdp]# grep "list_for_each_prev" `find / -name list.h`
[root@dwalin2 pdp]#
Pieter
Peter wrote:
"A month of sundays ago De Pelsemaeker Pieter wrote:"
> when I try to compile nbd-2.4.30 I get the following errors:
>
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_S
>
OURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -O2 -D__KERNEL__ -DMODULE -DDEBUG=0 -DC
> ONFIG_ENBD=m -I/home/pdp/nbd-2.4.30/linux/include -I/usr/src/linux/include
> -c -o enbd.o /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c
Your kernel code in /usr/src./linux (surely that can't be correct? Have
you set LINUXDIR?) does not contain the macro for list_for_each_prev
which should be found in list.h. Please fix ...
There is a definition in enbd.c itself:
#undef list_for_each_prev
#define list_for_each_prev(pos, head) \
for (pos = (struct request *)(head)->sem; pos != (head); \
pos = (struct request *)pos->sem)
but it's only activated for kernel code with a version before 2.3.30.
So the natural question to ask is - what kernel code can you be trying
to compile this against? And why! Please reconsider your intention.
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c: In function
`nbd_rollback':
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c:1476: warning: implicit
> declaration of function `list_for_each_prev'
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c:1476: parse error before
`{'
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c:1479: break statement not
> within loop or switch
Let's take a wild guess and say that you are compiling against an old
redhat installation with an early 2.4 kernel source in?
Maybe I should just let the enbd code define the macro unconditionally.
Peter