Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page Cross compilation of user program
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 01-22-2008   #1 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 1
Cross compilation of user program

Hello all,

I'm using linux 2.6.11 on the Triton module (PXA270). This is an ARM architecture processor.

My host machine is running on Debian etch 4.0.
I was able to install arm-linux cross compiler ver. 3.4.3 and build linux kernel, which is now running on the PXA module.
On my host machine I've got access to all modules and source code of this linux.

I'm trying to cross-compile simple program (cam from cam.c), which is using routine from driver implemented as kernel module (this is i2c-dev.ko).

cam.c source code:
#include <linux/i2c.h> // I need -D__KERNEL__ flag to include this header file

int
main ()
{
struct i2c_client camera;

i2c_attach_client(&camera);

return 0;
}

some comments:
struct i2c_client camera; //struct i2c_client is defined in <linux/i2c.h>
i2c_attach_client(&camera); // its implementation is in i2c-dev.c -> from which was build i2c-dev.ko
I was trying to cross-compile it (create static -.a or dynamic - .so library from i2c-dev.c) on the host computer , but I've received :
cam.o(.text+0xc): In function `main':
/home/majess/Praca/TRITON/cam_drv/cam.c:8: undefined reference to `i2c_attach_client'
collect2: ld returned 1 exit status

This means that I'm not able to link the 'i2c_attach_client' function to this program.

Does anybody have any idea how to solve this problem (how to map the function defined at ARM - target linux loadable module (.ko file) to host cross-compilator to compile program)?

Thanks for and reply/hint,
Lukasz Majewski

p.s. I'm a novice , so if it's possible use straight and simple language. )
majess is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
user interface program srilakshmigedela Linux Programming & Scripting 1 12-25-2007 12:58 PM
Set user id does not work for a program mikepol Linux Programming & Scripting 3 06-02-2007 07:02 AM
makefile error for procfile system shabeervsm The Linux Kernel 9 05-11-2007 12:20 PM
User and Screensaver problem Xcore Misc 6 04-21-2003 07:04 AM

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 09:34 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0