Bug 59313 - Cannot compile kernel module which defines MODVERSIONS and includes <asm/io.h>
Cannot compile kernel module which defines MODVERSIONS and includes <asm/io.h>
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-04 20:04 EST by Need Real Name
Modified: 2007-04-18 12:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-02-05 03:00:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-02-04 20:04:28 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901

Description of problem:
I get the following error:

In file included from /lib/modules/2.4.7-10/build/include/asm/io.h:110,
                 from test.c:13:
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h: In function `vmalloc':
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h:35:
`boot_cpu_data_R65dda927' undeclared (first use in this function)


Version-Release number of selected component (if applicable):
2.4.7-10

How reproducible:
Always

Steps to Reproduce:
1. Compile module test.c in "additional information":
gcc -D__KERNEL__ -I/lib/modules/2.4.7-10/build/include -DMODULE -Wall -O2  -c -o
test.o test.c


Actual Results:  
In file included from /lib/modules/2.4.7-10/build/include/linux/fs.h:19,
                 from /lib/modules/2.4.7-10/build/include/linux/capability.h:17,
                 from /lib/modules/2.4.7-10/build/include/linux/binfmts.h:5,
                 from /lib/modules/2.4.7-10/build/include/linux/sched.h:9,
                 from /lib/modules/2.4.7-10/build/include/linux/vmalloc.h:4,
                 from /lib/modules/2.4.7-10/build/include/asm/io.h:110,
                 from test.c:13:
/lib/modules/2.4.7-10/build/include/linux/dcache.h: In function `dget':
/lib/modules/2.4.7-10/build/include/linux/dcache.h:246: warning: implicit
declaration of function `do_BUG_R577f4bff'
In file included from /lib/modules/2.4.7-10/build/include/asm/io.h:110,
                 from test.c:13:
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h: In function `vmalloc':
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h:35:
`boot_cpu_data_R65dda927' undeclared (first use in this function)
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h:35: (Each undeclared
identifier is reported only once
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h:35: for each function it
appears in.)
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h: In function `vmalloc_dma':
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h:44:
`boot_cpu_data_R65dda927' undeclared (first use in this function)
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h: In function `vmalloc_32':
/lib/modules/2.4.7-10/build/include/linux/vmalloc.h:53:
`boot_cpu_data_R65dda927' undeclared (first use in this function)


Expected Results:  Clean compile - no warnings or errors.

Additional info:

Note that this is a complete clean install of RH 7.2 with no updates.
The same module compiles OK on a clean install of RH 7.1.

Also note that if I comment out the lines regarding MODVERSIONS, then
it compiles OK.

// test.c

#include <linux/module.h>

#if defined(CONFIG_SMP)
#define __SMP__
#endif

#if defined(CONFIG_MODVERSIONS)
#define MODVERSIONS
#include <linux/modversions.h>
#endif

#include <linux/kernel.h>
#include <asm/io.h>

int init_module(void)      { printk("<7>INIT - Test\n"); return 0; }
void cleanup_module(void)  { printk("<7>CLEANUP - Test\n"); }
Comment 1 Arjan van de Ven 2002-02-05 03:00:12 EST
3 things: 
1) Your code is buggy in 2 ways. You NEVER EVER include modversions.h directly.
   Esp not in the way you do.
   Also do not use __SMP__ but just CONFIG_SMP. If you need 2.0 compatibility
do    it the other way around

2) Please download http://people.redhat.com/arjanv/xircom_cb/Makefile
   and edit to change the filename. That will make it work.

3) If this is for a binary only module, please don't and consider making it GPL.
Red Hat will be more than willing to work with you to get the hardware supported
for the next release and updated kernels.

Note You need to log in before you can comment on or make changes to this bug.