[eepro100] Compile errors under Red Hat 7.0

Keith K Chau keithc@unitechnetworks.com
Wed, 25 Oct 2000 10:06:57 +0800


Hi,

Frankly I was a bit skeptical about this and tried it on my new RH7 box.
Yes!  I got very similar results.  Besides, gcc and kgcc generate very
different output.  Anyway, it fails to compile.  In fact, this applies
to every driver that I've tested, 3c90x, tulip, and eepro100.

On further investigation, it appears that it may be due to the
kernel-headers file that is shipped with RH7, which is 2.4.x based.  I
don't know what this exactly means to us... probably this is the
so-called "2.4-ready system".

Still feeling puzzled.

Thanks,
Keith

> -----Original Message-----
> From: eepro100-admin@scyld.com [mailto:eepro100-admin@scyld.com]On
> Behalf Of Janusz Kolodziejczyk
> Sent: Wednesday, October 25, 2000 6:19 AM
> To: 'eepro100@scyld.com'
> Subject: [eepro100] Compile errors under Red Hat 7.0
>
>
>
> I am trying to recompile the driver included in Red Hat 7.0 (
> kernel 2.2.16
> )
> Please look at the outputs and help me understand what is
> going on in this
> release.
>
> Driver version:
>
> static const char *version =
> "eepro100.c:v1.09j-t 9/29/99 Donald Becker
> http://cesdis.gsfc.nasa.gov/linux/dri
> vers/eepro100.html\n"
> "eepro100.c: $Revision: 1.20.2.10 $ 2000/05/31 Modified by Andrey V.
> Savochkin <
> saw@saw.sw.com.sg> and others\n";
>
> I get the following errors:
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
> [user@vishnu ee120]$ gcc -DMODULE -D__KERNEL__
> -I/usr/src/linux/net/inet
> -Wall -Wstrict-prototypes -O6 -c eepro100.c `[ -f
> /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`
>
> In file included from eepro100.c:107:
> /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 eepro100.c:118:
> /usr/include/asm/spinlock.h:36:28: warning:
> "SPIN_LOCK_UNLOCKED" redefined
> /usr/include/linux/spinlock.h:55:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:38:23: warning: "spin_lock_init" redefined
> /usr/include/linux/spinlock.h:58:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:47:23: warning: "spin_is_locked" redefined
> /usr/include/linux/spinlock.h:60:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:48:25: warning:
> "spin_unlock_wait" redefined
> /usr/include/linux/spinlock.h:62:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:131:26: warning:
> "RW_LOCK_UNLOCKED" redefined
> /usr/include/linux/spinlock.h:118:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:133:20: warning: "rwlock_init" redefined
> /usr/include/linux/spinlock.h:121:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:164:20: warning: "read_unlock" redefined
> /usr/include/linux/spinlock.h:123:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:165:21: warning: "write_unlock" redefined
> /usr/include/linux/spinlock.h:125:1: warning: this is the
> location of the
> previous definition
> [user@vishnu ee120]$
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
>
>
> When I remove the flag -DMODVERSIONS it compiles but with a
> lot of warnings:
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
> [user@vishnu ee120]$ gcc -DMODULE -D__KERNEL__
> -I/usr/src/linux/net/inet
> -Wall -Wstrict-prototypes -O6 -c eepro100.c
>
> In file included from eepro100.c:118:
> /usr/include/asm/spinlock.h:36:28: warning:
> "SPIN_LOCK_UNLOCKED" redefined
> /usr/include/linux/spinlock.h:55:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:38:23: warning: "spin_lock_init" redefined
> /usr/include/linux/spinlock.h:58:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:47:23: warning: "spin_is_locked" redefined
> /usr/include/linux/spinlock.h:60:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:48:25: warning:
> "spin_unlock_wait" redefined
> /usr/include/linux/spinlock.h:62:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:131:26: warning:
> "RW_LOCK_UNLOCKED" redefined
> /usr/include/linux/spinlock.h:118:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:133:20: warning: "rwlock_init" redefined
> /usr/include/linux/spinlock.h:121:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:164:20: warning: "read_unlock" redefined
> /usr/include/linux/spinlock.h:123:1: warning: this is the
> location of the
> previous definition
> /usr/include/asm/spinlock.h:165:21: warning: "write_unlock" redefined
> /usr/include/linux/spinlock.h:125:1: warning: this is the
> location of the
> previous definition
> In file included from eepro100.c:119:
> /usr/include/asm/spinlock.h:26: conflicting types for `spinlock_t'
> /usr/include/linux/spinlock.h:54: previous declaration of `spinlock_t'
> /usr/include/asm/spinlock.h:68: parse error before `{'
> /usr/include/asm/spinlock.h:78: parse error before `void'
> /usr/include/asm/spinlock.h:93: parse error before `do'
> /usr/include/asm/spinlock.h:121: conflicting types for `rwlock_t'
> /usr/include/linux/spinlock.h:117: previous declaration of `rwlock_t'
> /usr/include/asm/spinlock.h:146: parse error before `void'
> /usr/include/asm/spinlock.h:155: parse error before `void'
> eepro100.c:499: field `stats' has incomplete type
> eepro100.c: In function `eepro100_init':
> eepro100.c:605: structure has no member named `base_address'
> eepro100.c:589: warning: `pciaddr' might be used uninitialized in this
> function
> eepro100.c: In function `speedo_found1':
> eepro100.c:668: warning: assignment from incompatible pointer type
> eepro100.c:670: dereferencing pointer to incomplete type
> eepro100.c:671: dereferencing pointer to incomplete type
> eepro100.c:690: structure has no member named `base_address'
> eepro100.c:705: dereferencing pointer to incomplete type
> eepro100.c:706: dereferencing pointer to incomplete type
> eepro100.c:712: dereferencing pointer to incomplete type
> eepro100.c:730: dereferencing pointer to incomplete type
> eepro100.c:733: dereferencing pointer to incomplete type
> eepro100.c:734: dereferencing pointer to incomplete type
> eepro100.c:816: dereferencing pointer to incomplete type
> eepro100.c:817: dereferencing pointer to incomplete type
> eepro100.c:819: dereferencing pointer to incomplete type
> eepro100.c:820: dereferencing pointer to incomplete type
> eepro100.c:822: dereferencing pointer to incomplete type
> eepro100.c:849: dereferencing pointer to incomplete type
> eepro100.c:850: dereferencing pointer to incomplete type
> eepro100.c:855: dereferencing pointer to incomplete type
> eepro100.c:856: dereferencing pointer to incomplete type
> eepro100.c:857: dereferencing pointer to incomplete type
> eepro100.c:858: dereferencing pointer to incomplete type
> eepro100.c:657: warning: `sp' might be used uninitialized in
> this function
> eepro100.c:659: warning: `option' might be used uninitialized in this
> function
> eepro100.c:683: warning: `iobase' might be used uninitialized in this
> function
> eepro100.c: In function `speedo_open':
> eepro100.c:937: dereferencing pointer to incomplete type
> eepro100.c:938: dereferencing pointer to incomplete type
> eepro100.c:941: dereferencing pointer to incomplete type
> eepro100.c:941: dereferencing pointer to incomplete type
> eepro100.c:954: dereferencing pointer to incomplete type
> eepro100.c:954: dereferencing pointer to incomplete type
> eepro100.c:959: dereferencing pointer to incomplete type
> eepro100.c:985: dereferencing pointer to incomplete type
> eepro100.c:986: dereferencing pointer to incomplete type
> eepro100.c:987: dereferencing pointer to incomplete type
> eepro100.c:1000: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_resume':
> eepro100.c:1024: dereferencing pointer to incomplete type
> eepro100.c:1025: dereferencing pointer to incomplete type
> eepro100.c:1047: dereferencing pointer to incomplete type
> eepro100.c:1067: dereferencing pointer to incomplete type
> eepro100.c:1067: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_timer':
> eepro100.c:1084: dereferencing pointer to incomplete type
> eepro100.c:1085: dereferencing pointer to incomplete type
> eepro100.c:1094: dereferencing pointer to incomplete type
> eepro100.c:1096: dereferencing pointer to incomplete type
> eepro100.c:1107: dereferencing pointer to incomplete type
> eepro100.c:1109: dereferencing pointer to incomplete type
> eepro100.c:1114: dereferencing pointer to incomplete type
> eepro100.c:1123: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_show_state':
> eepro100.c:1133: dereferencing pointer to incomplete type
> eepro100.c:1134: dereferencing pointer to incomplete type
> eepro100.c:1141: dereferencing pointer to incomplete type
> eepro100.c:1144: dereferencing pointer to incomplete type
> eepro100.c:1151: dereferencing pointer to incomplete type
> eepro100.c:1154: dereferencing pointer to incomplete type
> eepro100.c:1135: warning: unused variable `phy_num'
> eepro100.c:1134: warning: unused variable `ioaddr'
> eepro100.c: In function `speedo_init_rx_ring':
> eepro100.c:1176: dereferencing pointer to incomplete type
> eepro100.c:1188: warning: assignment from incompatible pointer type
> eepro100.c: In function `speedo_purge_tx':
> eepro100.c:1209: dereferencing pointer to incomplete type
> eepro100.c:1224: dereferencing pointer to incomplete type
> eepro100.c:1231: dereferencing pointer to incomplete type
> eepro100.c:1231: `NET_BH' undeclared (first use in this function)
> eepro100.c:1231: (Each undeclared identifier is reported only once
> eepro100.c:1231: for each function it appears in.)
> eepro100.c: In function `reset_mii':
> eepro100.c:1236: dereferencing pointer to incomplete type
> eepro100.c:1237: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_tx_timeout':
> eepro100.c:1259: dereferencing pointer to incomplete type
> eepro100.c:1260: dereferencing pointer to incomplete type
> eepro100.c:1266: dereferencing pointer to incomplete type
> eepro100.c:1288: warning: implicit declaration of function
> `start_bh_atomic'
> eepro100.c:1291: warning: implicit declaration of function
> `end_bh_atomic'
> eepro100.c:1310: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_start_xmit':
> eepro100.c:1325: dereferencing pointer to incomplete type
> eepro100.c:1326: dereferencing pointer to incomplete type
> eepro100.c:1330: dereferencing pointer to incomplete type
> eepro100.c:1330: dereferencing pointer to incomplete type
> eepro100.c:1331: dereferencing pointer to incomplete type
> eepro100.c:1357: dereferencing pointer to incomplete type
> eepro100.c:1358: dereferencing pointer to incomplete type
> eepro100.c:1392: dereferencing pointer to incomplete type
> eepro100.c:1399: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_tx_buffer_gc':
> eepro100.c:1407: dereferencing pointer to incomplete type
> eepro100.c:1423: dereferencing pointer to incomplete type
> eepro100.c:1447: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_interrupt':
> eepro100.c:1474: dereferencing pointer to incomplete type
> eepro100.c:1475: dereferencing pointer to incomplete type
> eepro100.c:1481: dereferencing pointer to incomplete type
> eepro100.c:1485: dereferencing pointer to incomplete type
> eepro100.c:1497: dereferencing pointer to incomplete type
> eepro100.c:1515: dereferencing pointer to incomplete type
> eepro100.c:1521: dereferencing pointer to incomplete type
> eepro100.c:1527: dereferencing pointer to incomplete type
> eepro100.c:1534: dereferencing pointer to incomplete type
> eepro100.c:1540: dereferencing pointer to incomplete type
> eepro100.c:1546: dereferencing pointer to incomplete type
> eepro100.c:1562: dereferencing pointer to incomplete type
> eepro100.c:1583: dereferencing pointer to incomplete type
> eepro100.c:1583: `NET_BH' undeclared (first use in this function)
> eepro100.c:1590: dereferencing pointer to incomplete type
> eepro100.c:1601: dereferencing pointer to incomplete type
> eepro100.c:1603: dereferencing pointer to incomplete type
> eepro100.c:1463: warning: `sp' might be used uninitialized in
> this function
> eepro100.c:1464: warning: `ioaddr' might be used uninitialized in this
> function
> eepro100.c: In function `speedo_rx_alloc':
> eepro100.c:1610: dereferencing pointer to incomplete type
> eepro100.c:1621: warning: assignment from incompatible pointer type
> eepro100.c: In function `speedo_rx_link':
> eepro100.c:1630: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_refill_rx_buf':
> eepro100.c:1641: dereferencing pointer to incomplete type
> eepro100.c:1653: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_refill_rx_buffers':
> eepro100.c:1683: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_rx':
> eepro100.c:1693: dereferencing pointer to incomplete type
> eepro100.c:1716: dereferencing pointer to incomplete type
> eepro100.c:1727: dereferencing pointer to incomplete type
> eepro100.c:1733: dereferencing pointer to incomplete type
> eepro100.c:1742: warning: assignment from incompatible pointer type
> eepro100.c:1758: dereferencing pointer to incomplete type
> eepro100.c:1765: warning: passing arg 2 of `eth_type_trans' from
> incompatible pointer type
> eepro100.c: In function `speedo_close':
> eepro100.c:1789: dereferencing pointer to incomplete type
> eepro100.c:1790: dereferencing pointer to incomplete type
> eepro100.c:1793: dereferencing pointer to incomplete type
> eepro100.c:1794: dereferencing pointer to incomplete type
> eepro100.c:1798: dereferencing pointer to incomplete type
> eepro100.c:1808: dereferencing pointer to incomplete type
> eepro100.c:1840: dereferencing pointer to incomplete type
> eepro100.c: In function `speedo_get_stats':
> eepro100.c:1862: dereferencing pointer to incomplete type
> eepro100.c:1863: dereferencing pointer to incomplete type
> eepro100.c:1879: dereferencing pointer to incomplete type
> eepro100.c:1890: warning: control reaches end of non-void function
> eepro100.c: In function `speedo_ioctl':
> eepro100.c:1894: dereferencing pointer to incomplete type
> eepro100.c:1895: dereferencing pointer to incomplete type
> eepro100.c: In function `set_rx_mode':
> eepro100.c:1934: dereferencing pointer to incomplete type
> eepro100.c:1935: dereferencing pointer to incomplete type
> eepro100.c:1941: dereferencing pointer to incomplete type
> eepro100.c:1943: dereferencing pointer to incomplete type
> eepro100.c:1944: dereferencing pointer to incomplete type
> eepro100.c:1950: dereferencing pointer to incomplete type
> eepro100.c:1994: dereferencing pointer to incomplete type
> eepro100.c:2000: dereferencing pointer to incomplete type
> eepro100.c:2017: dereferencing pointer to incomplete type
> eepro100.c:2019: dereferencing pointer to incomplete type
> eepro100.c:2019: warning: value computed is not used
> eepro100.c:2019: dereferencing pointer to incomplete type
> eepro100.c:2033: dereferencing pointer to incomplete type
> eepro100.c:2048: dereferencing pointer to incomplete type
> eepro100.c:2058: dereferencing pointer to incomplete type
> eepro100.c:2063: dereferencing pointer to incomplete type
> eepro100.c:2065: dereferencing pointer to incomplete type
> eepro100.c:2065: warning: value computed is not used
> eepro100.c:2065: dereferencing pointer to incomplete type
> eepro100.c:2102: dereferencing pointer to incomplete type
> eepro100.c:2109: dereferencing pointer to incomplete type
> eepro100.c: In function `cleanup_module':
> eepro100.c:2144: dereferencing pointer to incomplete type
> eepro100.c:2145: warning: passing arg 1 of `unregister_netdev' from
> incompatible pointer type
> eepro100.c:2146: dereferencing pointer to incomplete type
> eepro100.c:2148: dereferencing pointer to incomplete type
> [user@vishnu ee120]$
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
>
> I am able to compile when I add the flag -isystem
> /usr/src/linux/include,
> but I get lots of warnings:
>
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
> [user@vishnu ee120]$ gcc -DMODULE -D__KERNEL__ -isystem
> /usr/src/linux/include -I/usr/src/linux/net/inet -Wall
> -Wstrict-prototypes
> -O6 -c eepro100.c `[ -f /usr/include/linux/modversions.h ] && echo
> -DMODVERSIONS`
> In file included from /usr/src/linux/include/linux/sched.h:20,
>                  from /usr/src/linux/include/linux/mm.h:4,
>                  from /usr/src/linux/include/linux/slab.h:14,
>                  from /usr/src/linux/include/linux/malloc.h:4,
>                  from eepro100.c:115:
> /usr/src/linux/include/linux/smp.h:77:49: warning:
> "smp_num_cpus" redefined
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:28:1:
> warning: this is
> the location of the previous definition
> /usr/src/linux/include/linux/smp.h:83:26: warning: "smp_call_function"
> redefined/usr/src/linux/include/linux/modules/i386_ksyms.ver:1
> 18:1: warning:
> this is the location of the previous definition
> In file included from /usr/src/linux/include/linux/sched.h:74,
>                  from /usr/src/linux/include/linux/mm.h:4,
>                  from /usr/src/linux/include/linux/slab.h:14,
>                  from /usr/src/linux/include/linux/malloc.h:4,
>                  from eepro100.c:115:
> /usr/src/linux/include/asm/processor.h:96:18: warning:
> "cpu_data" redefined
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:6:1:
> warning: this is
> the location of the previous definition
> In file included from /usr/src/linux/include/linux/interrupt.h:51,
>                  from eepro100.c:116:
> /usr/src/linux/include/asm/hardirq.h:23:24: warning: "synchronize_irq"
> redefined/usr/src/linux/include/linux/modules/i386_ksyms.ver:1
> 38:1: warning:
> this is the location of the previous definition
> In file included from /usr/src/linux/include/linux/interrupt.h:52,
>                  from eepro100.c:116:
> /usr/src/linux/include/asm/softirq.h:75:23: warning: "synchronize_bh"
> redefined
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:142:1:
> warning: this is
> the location of the previous definition
> eepro100.c: In function `speedo_show_state':
> eepro100.c:1135: warning: unused variable `phy_num'
> eepro100.c:1134: warning: unused variable `ioaddr'
> /tmp/ccol5xYy.s: Assembler messages:
> /tmp/ccol5xYy.s:88: Warning: Ignoring changed section attributes for
> .modinfo
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
>
> The cleanest compile appeared to be with -isystem
> /usr/src/linux/include
> and without -DMODVERSIONS, but still:
>
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
> [user@vishnu ee120]$ gcc -DMODULE -D__KERNEL__ -isystem
> /usr/src/linux/include -I/usr/src/linux/net/inet -Wall
> -Wstrict-prototypes
> -O6 -c eepro100.c
> eepro100.c: In function `speedo_show_state':
> eepro100.c:1135: warning: unused variable `phy_num'
> eepro100.c:1134: warning: unused variable `ioaddr'
> /tmp/cc2BrPTb.s: Assembler messages:
> /tmp/cc2BrPTb.s:88: Warning: Ignoring changed section attributes for
> .modinfo
> [user@vishnu ee120]$
> --------------------------------------------------------------
> --------------
> --------------------------------------------------
>
>
> __________________________________________
> Janusz Kolodziejczyk / SBS Technologies, Modular I/O
> 8371C Central Ave. / Newark, CA 94560
> Phone: 510-742-2500 / Fax: -2501 / EMail: JanuszK@sbs.com
>
>
>
> _______________________________________________
> eepro100 mailing list
> eepro100@scyld.com
> http://www.scyld.com/mailman/listinfo/eepro100
>