Skip to contentSkip to conversation

cyclades.h in 2.6.9 use __iomem but don't include compiler.h

DISCUSSION Andrei A. Voropaev 2 participants 3 messages Oct 25, 2004 – Oct 26, 2004 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi!

I'm not sure if this is a bug or a feature. But in 2.6.9 cyclades.h have different definition for struct cyclades_card. This definition uses __iomem attribute which is defined in linux/compiler.h. This is not included in cyclades.h, which leads to compilation problems for util-linux package.

Andrei

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 9 lines · Marcelo Tosatti
Quoted 7 lines · Andrei A. Voropaev

Hi!

I'm not sure if this is a bug or a feature. But in 2.6.9 cyclades.h have different definition for struct cyclades_card. This definition uses __iomem attribute which is defined in linux/compiler.h. This is not included in cyclades.h, which leads to compilation problems for util-linux package.

Quoted 6 lines

Hi Andrei,

cyclades.h should not do business with util-linux, only the driver itself (cyclades.c) and the userspace configuration utility (which now includes should linux/compiler.h accordingly to define __iomem to NULL).

Well. All I know is that util-linux has cytune utility that does not compile with 2.6.9 kernel headers. But compiles with older ones.

Quoted 4 lines

What is the complete error message, and why is util-linux including cyclades.h?

Here's the error message.

cc -O2 -fomit-frame-pointer -I../lib -Wall -Wstrict-prototypes -DNCH=1 -D_FILE_OFFSET_BITS=64 -DSBINDIR=\"/sbin\" -DUSRSBINDIR=\"/usr/sbin\" -DLOGDIR=\"/var/log\" -DVARPATH=\"/var\" -DLOCALEDIR=\"/usr/share/locale\" -O2 -c cytune.c -o cytune.o
cytune.c:58:86: linux/tqueue.h: No such file or directory
In file included from cytune.c:61:
/usr/include/linux/cyclades.h:514: error: variable or field `__iomem' declared void /usr/include/linux/cyclades.h:514: error: parse error before '*' token /usr/include/linux/cyclades.h:515: error: parse error before '*' token /usr/include/linux/cyclades.h:528: error: parse error before '}' token make[1]: *** [cytune.o] Error 1
make[1]: Leaving directory `/tools/src/util-linux-2.12b/sys-utils'
make: *** [all] Error 1

The first problem with linux/tqueue.h happens because during config it tries to do it with only cyclades.h and fails on __iomem. So it decides to include tqueue.h. Only to make things worse.

Here's the patch that I had to apply.

configure 2004-10-25 19:43:29.259856848 +0200 renamed from configure 2004-08-25 02:32:19.000000000 +0200 +1 -0
diff -ur util-linux-2.12b/configure util-linux-2.12b-adj/configure
@@ -367,6 +367,7 @@
 #
 echo "
 #include <sys/types.h>
+#include <linux/compiler.h>
 #include <linux/cyclades.h>
 int main(){ exit(0); }
 " > conftest.c
sys-utils/cytune.c 2004-10-25 19:44:27.892943264 +0200 renamed from sys-utils/cytune.c 2002-03-09 00:04:30.000000000 +0100 +1 -0
diff -ur util-linux-2.12b/sys-utils/cytune.c util-linux-2.12b-adj/sys-utils/cytune.c
@@ -58,6 +58,7 @@
 #include <linux/tqueue.h>      /* required for old kernels (for struct tq_struct) */
                                /* compilation errors on other kernels */
 #endif
+#include <linux/compiler.h>
 #include <linux/cyclades.h>
 
 #if 0
#3 lore raw
Quoted 12 lines · Andrei A. Voropaev
Quoted 11 lines · Marcelo Tosatti
Quoted 7 lines · Andrei A. Voropaev

Hi!

I'm not sure if this is a bug or a feature. But in 2.6.9 cyclades.h have different definition for struct cyclades_card. This definition uses __iomem attribute which is defined in linux/compiler.h. This is not included in cyclades.h, which leads to compilation problems for util-linux package.

Hi Andrei,

Quoted 7 lines
Quoted 4 lines

cyclades.h should not do business with util-linux, only the driver itself (cyclades.c) and the userspace configuration utility (which now includes should linux/compiler.h accordingly to define __iomem to NULL).

Well. All I know is that util-linux has cytune utility that does not compile with 2.6.9 kernel headers. But compiles with older ones.

Ah, that was news to me!

I didnt knew the existant of such tool. Pardon me.

Quoted 17 lines
Quoted 3 lines

What is the complete error message, and why is util-linux including cyclades.h?

Here's the error message.

cc -O2 -fomit-frame-pointer -I../lib -Wall -Wstrict-prototypes -DNCH=1 -D_FILE_OFFSET_BITS=64 -DSBINDIR=\"/sbin\" -DUSRSBINDIR=\"/usr/sbin\" -DLOGDIR=\"/var/log\" -DVARPATH=\"/var\" -DLOCALEDIR=\"/usr/share/locale\" -O2 -c cytune.c -o cytune.o
cytune.c:58:86: linux/tqueue.h: No such file or directory
In file included from cytune.c:61:
/usr/include/linux/cyclades.h:514: error: variable or field `__iomem' declared void /usr/include/linux/cyclades.h:514: error: parse error before '*' token /usr/include/linux/cyclades.h:515: error: parse error before '*' token /usr/include/linux/cyclades.h:528: error: parse error before '}' token make[1]: *** [cytune.o] Error 1
make[1]: Leaving directory `/tools/src/util-linux-2.12b/sys-utils'
make: *** [all] Error 1

Quoted 5 lines

The first problem with linux/tqueue.h happens because during config it tries to do it with only cyclades.h and fails on __iomem. So it decides to include tqueue.h. Only to make things worse.

Here's the patch that I had to apply.

That works.

Can you send this patch to the util-linux maintainer?

Quoted 22 lines

diff -ur util-linux-2.12b/configure util-linux-2.12b-adj/configure

configure 2004-10-25 19:43:29.259856848 +0200 renamed from configure 2004-08-25 02:32:19.000000000 +0200 +1 -0
@@ -367,6 +367,7 @@
 #
 echo "
 #include <sys/types.h>
+#include <linux/compiler.h>
 #include <linux/cyclades.h>
 int main(){ exit(0); }
 " > conftest.c

diff -ur util-linux-2.12b/sys-utils/cytune.c util-linux-2.12b-adj/sys-utils/cytune.c

sys-utils/cytune.c 2004-10-25 19:44:27.892943264 +0200 renamed from sys-utils/cytune.c 2002-03-09 00:04:30.000000000 +0100 +1 -0
@@ -58,6 +58,7 @@
 #include <linux/tqueue.h>      /* required for old kernels (for struct tq_struct) */
                                /* compilation errors on other kernels */
 #endif
+#include <linux/compiler.h>
 #include <linux/cyclades.h>
 
 #if 0