Bug 52412 - module.h bug when compiling soundcore.c
Summary: module.h bug when compiling soundcore.c
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-23 16:52 UTC by Need Real Name
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-12-16 04:22:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2001-08-23 16:52:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
Using the kernel source shipped with RH 7.1, I had to add a #include to
include/linux/module.h in order to compile drivers/sound/soundcore.c. 
Dunno if this is the optimal solution.

I'm surprised a file called "rhconfig.h" has to exist -- I would hope that
all distributions would share identical kernel source.

Below are the first few lines of module.h, showing the #include added:

/*
 * Dynamic loading of modules into the kernel.
 *
 * Rewritten by Richard Henderson <rth> Dec 1996
 */

#ifndef _LINUX_MODULE_H
#define _LINUX_MODULE_H

/* new addition */
#include <linux/rhconfig.h>
/* end new addition */
#include <linux/config.h>
#include <linux/spinlock.h>
#include <linux/list.h>

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


How reproducible:
Always

Steps to Reproduce:
1. in /usr/src/linux, choose sound support as a module
2. run "make clean; make dep; make; make modules"
3. notice that soundcore.c failed to compile
	

Actual Results:  make[2]: Entering directory
`/usr/src/linux-2.4.2/drivers/sound'
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -pipe
-mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include
/usr/src/linux/include/linux/modversions.h   -DEXPORT_SYMTAB -c
sound_core.c
In file included from sound_core.c:38:
/usr/src/linux/include/linux/module.h:173: nondigits in number and not
hexadecimal
/usr/src/linux/include/linux/module.h:173: nondigits in number and not
hexadecimal
/usr/src/linux/include/linux/module.h:173: nondigits in number and not
hexadecimal
/usr/src/linux/include/linux/module.h:173: nondigits in number and not
hexadecimal
/usr/src/linux/include/linux/module.h:173: parse error before `62dada05'
/usr/src/linux/include/linux/module.h:173:
`inter_module_register_R_ver_str' declared as function returning a function

Expected Results:  no error messages

Additional info:

Here's the cpp output showing why rhconfig.h has to be included before line
173 of module.h.  (rhconfig.h does get included on line 256 of module.h, by
way of version.h.)

# 173 "/usr/src/linux/include/linux/module.h"
extern void inter_module_register_R_ver_str(62dada05)(const char *, struct
module *, const void *);

Comment 1 Need Real Name 2001-09-06 23:43:32 UTC
Including "rhconfig.h" into "module.h" may solve only this particular problem. 
But some modules include "modversions.h" and not "module.h" and compiler 
generates simiar error. Better workaround is to place "#include 
<linux/rhconfig.h>" into "modsetver.h".
Other solutions are:
* redesign of "make dep" so, that it will include
  "rhconfig.h" into "modversions.h"
* redesign of "make dep" so, that it will append
  version "number" to exported symbils in another
  way (more straight and clear!).


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