LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-23-2010, 06:20 PM   #1
joseph_tsai30
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Rep: Reputation: 0
Compile error in /linux/module.h


I have a driver source which includes linux/module.h.
The following error occurred during compile.
the kernel source is: 2.6.33.6-147.2.4fc13.i686
the compiler is: gcc-4.4.4-2.fc13.i686
Any hint or answer? Thanks!

In file included from /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/arch/x
86/include/asm/cmpxchg_64.h:4,
from /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/arch/x
86/include/asm/cmpxchg.h:4,
from /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/arch/x
86/include/asm/system.h:7,
from /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/arch/x
86/include/asm/processor.h:17,
from /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/includ
e/linux/prefetch.h:14,
from /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/includ
e/linux/list.h:6,
from ../include/linux/module.h:9,
from main.c:19:

/home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/arch/x86/include/asm/alternative.h:46: error: expected specifier-qualifier-list before ‘u8’
 
Old 09-23-2010, 08:20 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
Just out of curiosity do you have kernel-devel and kernel-headers installed?

Regards,

Alunduil
 
Old 09-24-2010, 04:01 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
I have a driver source which includes linux/module.h.
what exact source is this for ?
if it is older than 6 months you might need to build using the slightly older gcc 4.3
if older than a year then gcc 4.1

these are in the fedora "legacy Development tools " software group
Code:
yum grouplist
just keep in mind that fedora is a very fast development R & D distro
and MOST software will need a bit of "tweaking" to build with gcc 4.4

Last edited by John VV; 09-24-2010 at 04:04 AM.
 
Old 09-24-2010, 12:34 PM   #4
joseph_tsai30
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Original Poster
Rep: Reputation: 0
My development environment

Do I need to download kernel-devel and kernel-headers separately or are they included on the
kernel source RPM?

My development comes from:
(1) Installed Linux Fedora 13 from binary RPM, and select to include

software development option.

The kernel version is 2.6.33.3.



(2) Download kernel version 2.6.33.6-147 source RPM, and built locally.It seems OK, and I can boot from this kernel.
There is no change on source before my build.



The main.c has the following include files:
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/kernel.h> /* printk() */
#include <linux/slab.h> /* kmalloc() */
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/types.h> /* size_t */
#include <linux/proc_fs.h>
#include <linux/fcntl.h>
#include <linux/seq_file.h>
#include <linux/cdev.h>

#include <asm/system.h>
#include <asm/uaccess.h>

The partial Makefile to compile main.c is:
objects = main.o ...
KINC = ../include
BKINC = /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/include
BAKINC = /home/joseph/rpmbuild/BUILD/kernel-2.6.33/linux-2.6.33.i686/arch/x86/include

my_driver : $(objects)
cc -o my_driver $(objects)

main.o : main.c
cc -iquote $(BAKINC) -I$(KINC) -I$(BKINC) -I$(BAKINC) -v -nostdinc -c main.c
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me compile linux kernel module _oligarch Programming 1 12-14-2009 03:55 AM
compile error of kernel module i.you Linux - Kernel 0 03-16-2007 02:33 AM
ati (8.16.20) : Module Installing | Error After Kernel Compile dfwcomputer Linux - Newbie 2 05-10-2006 08:03 PM
kernel compile: reiserfs module error geniarse Linux - Software 2 04-04-2004 05:37 PM
How do you compile a Linux module? SparceMatrix Programming 17 09-02-2002 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration