LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-12-2011, 02:07 AM   #1
vdx
Member
 
Registered: Aug 2007
Location: The Greate INDIA
Distribution: CentOS, RHEL, Fedora
Posts: 102

Rep: Reputation: 24
Unhappy kernel makefile help


Dear friends,

I am trying to compile the linux kernel 2.6.33. I need to incorporate a patch into this. The patch creates a directory and 3 src files as below,

Code:
~/linux-2.6.33/net/core/netchannel

~/linux-2.6.33/net/core/netchannel/netchannel.c
~/linux-2.6.33/net/core/netchannel/storage.c
~/linux-2.6.33/net/core/netchannel/users.c
Now, the users.c file uses a function named 'get_empty_filp()'. Right now I getting the following error
Code:
net/core/netchannel/user.c: In function ‘netchannel_bind_fd’:
net/core/netchannel/user.c:192: error: implicit declaration of function ‘get_empty_filp’
net/core/netchannel/user.c:192: warning: assignment makes pointer from integer without a cast
I found that the fun('get_empty_filp') is defined in following location

Code:
fun def => ~/linux-2.6.33/fs/internal.h
fun body => ~/linux-2.6.33/fs/file_table.c
The following is netchannel module's make file,

Code:
obj-y += netchannel.o storage.o user.o
How do I incorporate file_table.c and internal.h in this make file, so that it gets successfully compiled ?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-15-2011, 03:54 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
As far as internal.h, you can create a new #include "internal.h" into the source file which requires it.
 
1 members found this post helpful.
Old 02-15-2011, 04:54 AM   #3
vdx
Member
 
Registered: Aug 2007
Location: The Greate INDIA
Distribution: CentOS, RHEL, Fedora
Posts: 102

Original Poster
Rep: Reputation: 24
thnx corp769,

as u mentioned, I have already included the "internal.h". It gets compiled successfully.
but problem raises when it tries to link the object files.

it says "multiple definition of function 'get_empty_filp'"

do we have a flag in gcc that can exclude the duplicate entries founded by linking object files ?
 
Old 05-13-2011, 01:32 AM   #4
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by vdx View Post
do we have a flag in gcc that can exclude the duplicate entries founded by linking object files ?
I haven't read the whole thread in detail, so pardon me if I am barking up the wrong tree.
Have a look at #ifndef: http://gcc.gnu.org/onlinedocs/cpp/On...y-Headers.html

P.S.
SMS language is NOT appreciated on the technical foras.
U = You
Thx = Thanks
r = are
 
2 members found this post helpful.
Old 05-14-2011, 02:10 AM   #5
vdx
Member
 
Registered: Aug 2007
Location: The Greate INDIA
Distribution: CentOS, RHEL, Fedora
Posts: 102

Original Poster
Rep: Reputation: 24
thanx Anisha,
Its very helpful link.
 
  


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
2.6 Kernel makefile pooppp Programming 2 07-12-2008 08:41 AM
makefile to compile kernel? RIgimp75 Slackware 7 07-19-2006 01:42 AM
kernel Makefile question feetyouwell Linux - Software 0 11-16-2004 11:36 AM
How to create a Kernel 2.6 Makefile 7.e.Q Programming 1 11-03-2004 07:47 AM
module makefile for c++ in kernel 2.6 yuhuahe Linux - Software 0 04-14-2004 06:03 PM

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

All times are GMT -5. The time now is 06:39 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