[vortex] Compile problems with 3c90x.c module
Eric Lee
elee@ptloma.edu
Fri, 01 Dec 2000 12:14:46 -0800
--=====================_1442191==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hi,
I have RedHat 7.0, and I have been having problems compiling the 3c90x
module. I keep getting a ton of errors at compile time. I've scoured the
archives, and people seem to be saying that I need to add
"-I/usr/src/linux/include" to my compile path. I made sure that the
appropriate directories were in place, and then added that to my compile
line, like this:
[root@elee-1 3c90x-1.0.0]# gcc -Wall -Wstrict-prototypes -O2
-I/usr/src/linux/include -c 3c90x.c -DMODVERSIONS -DMODULE -D__KERNEL__ -pipe
and these are the errors that I got:
In file included from 3c90x.h:23,
from 3c90x.c:1:
/usr/include/linux/modversions.h:1:2: #error Modules should never use
kernel-headers system headers,
/usr/include/linux/modversions.h:2:2: #error but headers from an
appropriate kernel-source
In file included from /usr/src/linux/include/linux/sched.h:18,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/include/asm/semaphore.h:41: parse error before `wait_queue_head_t'
/usr/include/asm/semaphore.h:41: warning: no semicolon at end of struct or
union
/usr/include/asm/semaphore.h: In function `sema_init':
/usr/include/asm/semaphore.h:75: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h:76: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h:77: warning: implicit declaration of function
`init_waitqueue_head'
/usr/include/asm/semaphore.h:77: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h: At top level:
/usr/include/asm/semaphore.h:228: parse error before `wait_queue_head_t'
/usr/include/asm/semaphore.h:228: warning: no semicolon at end of struct or
union
/usr/include/asm/semaphore.h:229: warning: data definition has no type or
storage class
/usr/include/asm/semaphore.h: In function `init_rwsem':
/usr/include/asm/semaphore.h:257: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h:258: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h:259: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h:260: dereferencing pointer to incomplete type
/usr/include/asm/semaphore.h:261: dereferencing pointer to incomplete type
In file included from /usr/src/linux/include/linux/fs.h:334,
from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/mount.h: At top level:
/usr/src/linux/include/linux/mount.h:20: field `dqio_sem' has incomplete type
/usr/src/linux/include/linux/mount.h:21: field `dqoff_sem' has incomplete type
In file included from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/fs.h:356: field `i_sem' has incomplete type
/usr/src/linux/include/linux/fs.h:357: field `i_atomic_write' has
incomplete type
In file included from /usr/src/linux/include/linux/fs.h:514,
from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/smb_fs_sb.h:36: field `sem' has incomplete type
In file included from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/fs.h:566: field `s_vfs_rename_sem' has
incomplete type
In file included from /usr/src/linux/include/linux/tty.h:24,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/tqueue.h: In function `queue_task':
/usr/src/linux/include/linux/tqueue.h:88: warning: implicit declaration of
function `spin_lock_irqsave'
/usr/src/linux/include/linux/tqueue.h:91: warning: implicit declaration of
function `spin_unlock_irqrestore'
In file included from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/tty.h: At top level:
/usr/src/linux/include/linux/tty.h:140: field `pty_sem' has incomplete type
/usr/src/linux/include/linux/tty.h:306: field `atomic_read' has incomplete type
/usr/src/linux/include/linux/tty.h:307: field `atomic_write' has incomplete
type
In file included from /usr/src/linux/include/linux/string.h:38,
from /usr/include/asm/siginfo.h:218,
from /usr/src/linux/include/linux/signal.h:6,
from /usr/src/linux/include/linux/sched.h:24,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/include/asm/string.h:48: warning: static declaration for `strncpy'
follows non-static
/usr/include/asm/string.h:67: warning: static declaration for `strcat'
follows non-static
/usr/include/asm/string.h:84: warning: static declaration for `strncat'
follows non-static
/usr/include/asm/string.h:128: warning: static declaration for `strncmp'
follows non-static
/usr/include/asm/string.h:151: warning: static declaration for `strchr'
follows non-static
/usr/include/asm/string.h:170: warning: static declaration for `strrchr'
follows non-static
/usr/include/asm/string.h:353: warning: static declaration for `memmove'
follows non-static
In file included from /usr/src/linux/include/linux/resource.h:58,
from /usr/src/linux/include/linux/sched.h:71,
from 3c90x.h:37,
from 3c90x.c:1:
/usr/include/asm/resource.h:25:25: warning: "RLIM_INFINITY" redefined
/usr/src/linux/include/linux/resource.h:40:1: warning: this is the location
of the previous definition
/usr/include/asm/string.h:436: warning: static declaration for `strnlen'
follows non-static
/usr/include/asm/string.h:457: warning: static declaration for `strstr'
follows non-static
/usr/include/asm/string.h:549: warning: static declaration for `memscan'
follows non-static
In file included from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/sched.h:182: field `mmap_sem' has incomplete type
In file included from /usr/include/linux/irq.h:5,
from /usr/include/asm/hardirq.h:6,
from /usr/src/linux/include/linux/interrupt.h:51,
from 3c90x.h:44,
from 3c90x.c:1:
/usr/include/linux/spinlock.h:55:30: warning: "SPIN_LOCK_UNLOCKED" redefined
/usr/include/asm/spinlock.h:36:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:58:23: warning: "spin_lock_init" redefined
/usr/include/asm/spinlock.h:38:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:60:23: warning: "spin_is_locked" redefined
/usr/include/asm/spinlock.h:47:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:62:25: warning: "spin_unlock_wait" redefined
/usr/include/asm/spinlock.h:48:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:118:28: warning: "RW_LOCK_UNLOCKED" redefined
/usr/include/asm/spinlock.h:131:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:121:20: warning: "rwlock_init" redefined
/usr/include/asm/spinlock.h:133:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:123:20: warning: "read_unlock" redefined
/usr/include/asm/spinlock.h:164:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:125:21: warning: "write_unlock" redefined
/usr/include/asm/spinlock.h:165:1: warning: this is the location of the
previous definition
In file included from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/sched.h: In function `add_wait_queue':
/usr/src/linux/include/linux/sched.h:712: warning: implicit declaration of
function `write_lock_irqsave'
/usr/src/linux/include/linux/sched.h:714: warning: implicit declaration of
function `write_unlock_irqrestore'
In file included from /usr/include/linux/irq.h:6,
from /usr/include/asm/hardirq.h:7,
from /usr/src/linux/include/linux/interrupt.h:52,
from 3c90x.h:45,
from 3c90x.c:2:
/usr/include/linux/spinlock.h: At top level:
/usr/include/linux/spinlock.h:54: conflicting types for `spinlock_t'
/usr/include/asm/spinlock.h:26: previous declaration of `spinlock_t'
/usr/include/linux/spinlock.h:117: conflicting types for `rwlock_t'
/usr/include/asm/spinlock.h:121: previous declaration of `rwlock_t'
In file included from /usr/src/linux/include/linux/vmalloc.h:8,
from /usr/include/asm/io.h:109,
from 3c90x.h:51,
from 3c90x.c:2:
/usr/include/asm/pgtable.h:21: conflicting types for `paging_init'
/usr/src/linux/include/linux/mm.h:301: previous declaration of `paging_init'
{standard input}: Assembler messages:
{standard input}:21: Warning: Ignoring changed section attributes for .modinfo
3c90x.c: In function `tc90x_HostErrorEvent':
/usr/src/linux/include/linux/tqueue.h:87: warning: `flags' might be used
uninitialized in this function
3c90x.c: In function `tc90x_CountDownTimerEvent':
3c90x.c:5520: warning: implicit declaration of function `mark_bh'
****************************************************
any ideas on what to do?
thanks,
Eric Lee
--=====================_1442191==_.ALT
Content-Type: text/html; charset="us-ascii"
Hi,
I have RedHat 7.0, and I have been having problems compiling the
3c90x module. I keep getting a ton of errors at compile time.
I've scoured the archives, and people seem to be saying that I need to
add "-I/usr/src/linux/include" to my compile path. I made
sure that the appropriate directories were in place, and then added that
to my compile line, like this:
[root@elee-1 3c90x-1.0.0]# gcc -Wall
-Wstrict-prototypes -O2 -I/usr/src/linux/include -c 3c90x.c -DMODVERSIONS
-DMODULE -D__KERNEL__ -pipe
and these are the errors that I got:
In file included from 3c90x.h:23,
from 3c90x.c:1:
/usr/include/linux/modversions.h:1:2: #error Modules should never use
kernel-headers system headers,
/usr/include/linux/modversions.h:2:2: #error but headers from an
appropriate kernel-source
In file included from /usr/src/linux/include/linux/sched.h:18,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/include/asm/semaphore.h:41: parse error before
`wait_queue_head_t'
/usr/include/asm/semaphore.h:41: warning: no semicolon at end of struct
or union
/usr/include/asm/semaphore.h: In function `sema_init':
/usr/include/asm/semaphore.h:75: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h:76: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h:77: warning: implicit declaration of
function `init_waitqueue_head'
/usr/include/asm/semaphore.h:77: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h: At top level:
/usr/include/asm/semaphore.h:228: parse error before
`wait_queue_head_t'
/usr/include/asm/semaphore.h:228: warning: no semicolon at end of struct
or union
/usr/include/asm/semaphore.h:229: warning: data definition has no type or
storage class
/usr/include/asm/semaphore.h: In function `init_rwsem':
/usr/include/asm/semaphore.h:257: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h:258: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h:259: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h:260: dereferencing pointer to incomplete
type
/usr/include/asm/semaphore.h:261: dereferencing pointer to incomplete
type
In file included from /usr/src/linux/include/linux/fs.h:334,
from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/mount.h: At top level:
/usr/src/linux/include/linux/mount.h:20: field `dqio_sem' has incomplete
type
/usr/src/linux/include/linux/mount.h:21: field `dqoff_sem' has incomplete
type
In file included from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/fs.h:356: field `i_sem' has incomplete
type
/usr/src/linux/include/linux/fs.h:357: field `i_atomic_write' has
incomplete type
In file included from /usr/src/linux/include/linux/fs.h:514,
from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/smb_fs_sb.h:36: field `sem' has incomplete
type
In file included from /usr/src/linux/include/linux/tty.h:21,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/fs.h:566: field `s_vfs_rename_sem' has
incomplete type
In file included from /usr/src/linux/include/linux/tty.h:24,
from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/tqueue.h: In function `queue_task':
/usr/src/linux/include/linux/tqueue.h:88: warning: implicit declaration
of function `spin_lock_irqsave'
/usr/src/linux/include/linux/tqueue.h:91: warning: implicit declaration
of function `spin_unlock_irqrestore'
In file included from /usr/src/linux/include/linux/sched.h:22,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/tty.h: At top level:
/usr/src/linux/include/linux/tty.h:140: field `pty_sem' has incomplete
type
/usr/src/linux/include/linux/tty.h:306: field `atomic_read' has
incomplete type
/usr/src/linux/include/linux/tty.h:307: field `atomic_write' has
incomplete type
In file included from /usr/src/linux/include/linux/string.h:38,
from /usr/include/asm/siginfo.h:218,
from /usr/src/linux/include/linux/signal.h:6,
from /usr/src/linux/include/linux/sched.h:24,
from 3c90x.h:38,
from 3c90x.c:2:
/usr/include/asm/string.h:48: warning: static declaration for `strncpy'
follows non-static
/usr/include/asm/string.h:67: warning: static declaration for `strcat'
follows non-static
/usr/include/asm/string.h:84: warning: static declaration for `strncat'
follows non-static
/usr/include/asm/string.h:128: warning: static declaration for `strncmp'
follows non-static
/usr/include/asm/string.h:151: warning: static declaration for `strchr'
follows non-static
/usr/include/asm/string.h:170: warning: static declaration for `strrchr'
follows non-static
/usr/include/asm/string.h:353: warning: static declaration for `memmove'
follows non-static
In file included from /usr/src/linux/include/linux/resource.h:58,
from /usr/src/linux/include/linux/sched.h:71,
from 3c90x.h:37,
from 3c90x.c:1:
/usr/include/asm/resource.h:25:25: warning: "RLIM_INFINITY"
redefined
/usr/src/linux/include/linux/resource.h:40:1: warning: this is the
location of the previous definition
/usr/include/asm/string.h:436: warning: static declaration for `strnlen'
follows non-static
/usr/include/asm/string.h:457: warning: static declaration for `strstr'
follows non-static
/usr/include/asm/string.h:549: warning: static declaration for `memscan'
follows non-static
In file included from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/sched.h:182: field `mmap_sem' has incomplete
type
In file included from /usr/include/linux/irq.h:5,
from /usr/include/asm/hardirq.h:6,
from /usr/src/linux/include/linux/interrupt.h:51,
from 3c90x.h:44,
from 3c90x.c:1:
/usr/include/linux/spinlock.h:55:30: warning:
"SPIN_LOCK_UNLOCKED" redefined
/usr/include/asm/spinlock.h:36:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:58:23: warning: "spin_lock_init"
redefined
/usr/include/asm/spinlock.h:38:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:60:23: warning: "spin_is_locked"
redefined
/usr/include/asm/spinlock.h:47:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:62:25: warning:
"spin_unlock_wait" redefined
/usr/include/asm/spinlock.h:48:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:118:28: warning:
"RW_LOCK_UNLOCKED" redefined
/usr/include/asm/spinlock.h:131:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:121:20: warning: "rwlock_init"
redefined
/usr/include/asm/spinlock.h:133:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:123:20: warning: "read_unlock"
redefined
/usr/include/asm/spinlock.h:164:1: warning: this is the location of the
previous definition
/usr/include/linux/spinlock.h:125:21: warning: "write_unlock"
redefined
/usr/include/asm/spinlock.h:165:1: warning: this is the location of the
previous definition
In file included from 3c90x.h:38,
from 3c90x.c:2:
/usr/src/linux/include/linux/sched.h: In function `add_wait_queue':
/usr/src/linux/include/linux/sched.h:712: warning: implicit declaration
of function `write_lock_irqsave'
/usr/src/linux/include/linux/sched.h:714: warning: implicit declaration
of function `write_unlock_irqrestore'
In file included from /usr/include/linux/irq.h:6,
from /usr/include/asm/hardirq.h:7,
from /usr/src/linux/include/linux/interrupt.h:52,
from 3c90x.h:45,
from 3c90x.c:2:
/usr/include/linux/spinlock.h: At top level:
/usr/include/linux/spinlock.h:54: conflicting types for
`spinlock_t'
/usr/include/asm/spinlock.h:26: previous declaration of
`spinlock_t'
/usr/include/linux/spinlock.h:117: conflicting types for `rwlock_t'
/usr/include/asm/spinlock.h:121: previous declaration of `rwlock_t'
In file included from /usr/src/linux/include/linux/vmalloc.h:8,
from /usr/include/asm/io.h:109,
from 3c90x.h:51,
from 3c90x.c:2:
/usr/include/asm/pgtable.h:21: conflicting types for `paging_init'
/usr/src/linux/include/linux/mm.h:301: previous declaration of
`paging_init'
{standard input}: Assembler messages:
{standard input}:21: Warning: Ignoring changed section attributes for
.modinfo
3c90x.c: In function `tc90x_HostErrorEvent':
/usr/src/linux/include/linux/tqueue.h:87: warning: `flags' might be used
uninitialized in this function
3c90x.c: In function `tc90x_CountDownTimerEvent':
3c90x.c:5520: warning:
implicit declaration of function `mark_bh'
****************************************************
any ideas on what to do?
thanks,
Eric Lee