[OpenAFS-devel] linux kernel module and gcc4

Pascal Terjan pterjan@mandriva.com
Mon, 30 May 2005 12:40:09 +0200


--=-YIT9uZUlQxtUxcNULqVS
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello,
I got the following error when building the kernel module with gcc4 :

  CC
[M]  /var/lib/dkms/libafs/1.3.82/build/src/libafs/MODLOAD-2.6.11-9mdk-i686-up-4GB-SP/rx_kmutex.o
In file included
from /var/lib/dkms/libafs/1.3.82/build/src/rx/rx_kcommon.h:140,

from /var/lib/dkms/libafs/1.3.82/build/src/libafs/MODLOAD-2.6.11-9mdk-i686-up-4GB-SP/rx_kmutex.c:22:
/var/lib/dkms/libafs/1.3.82/build/src/afs/sysincludes.h:79: error:
redefinition of 'struct coda_inode_info'
/var/lib/dkms/libafs/1.3.82/build/src/afs/sysincludes.h:82: error:
redefinition of 'struct xfs_inode_info'
make[4]: ***
[/var/lib/dkms/libafs/1.3.82/build/src/libafs/MODLOAD-2.6.11-9mdk-i686-up-4GB-SP/rx_kmutex.o] Erreur 1

I could build with the attached patch but I can't understand the goal of
some of the defines so I can be totally wrong on the fix.

In rx_kcommon.h I see :

#ifdef AFS_LINUX22_ENV
#ifndef _LINUX_CODA_FS_I
#define _LINUX_CODA_FS_I 1
#endif
#define _CODA_HEADER_ 1
struct coda_inode_info {
};
#endif

and then 

#ifdef KERNEL
#include "afs/sysincludes.h"
#include "afsincludes.h"
#endif

And currently in sysincludes.h there is no #ifdef before defining
coda_inode_info again. So, when AFS_LINUX22_ENV and KERNEL are defined,
coda_inode_info is defined 2 times.

regarding xfs_inode_info it's the same problem with afs/afs_osi.h

Regards,
-- 
Pascal Terjan
Professional Services Engineer
Mandriva (formerly Mandrakesoft)
Tel +33 (0) 1 40 41 17 51 - Fax +33 (0) 1 40 41 92 00

--=-YIT9uZUlQxtUxcNULqVS
Content-Disposition: attachment; filename=libafs-gcc4.patch
Content-Type: text/x-patch; name=libafs-gcc4.patch; charset=us-ascii
Content-Transfer-Encoding: 7bit

--- /var/lib/dkms/libafs/1.3.82/build/src/afs/sysincludes.h	2005-05-30 12:09:06.000000000 +0200
+++ /root/sysincludes.h	2005-05-30 11:59:38.000000000 +0200
@@ -74,13 +74,15 @@
  */
 #ifndef _LINUX_CODA_FS_I
 #define _LINUX_CODA_FS_I
-#endif
 #define _CFS_HEADER_
 struct coda_inode_info {
 };
+#endif
+#ifndef _LINUX_XFS_FS_I
 #define _LINUX_XFS_FS_I
 struct xfs_inode_info {
 };
+#endif
 #include <asm/uaccess.h>
 #include <linux/list.h>
 #include <linux/dcache.h>

--=-YIT9uZUlQxtUxcNULqVS--