LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cross compilation (https://www.linuxquestions.org/questions/linux-newbie-8/cross-compilation-803506/)

joslyn 04-22-2010 07:52 AM

cross compilation
 
Hi All,

I am new to the embedded domain.I am learning about cross compilation. Just i want to compile an application and an driver file for ARM platform. I have downloaded the toolchain binaries from http://www.kernel.org/pub/tools/cros...es/bin/x86_64/. Please let me know the command that i need to use to compile the hello_world.c application and driver file.

Thanks,
Joslyn.

pixellany 04-22-2010 07:55 AM

What kind of system are you using?

If Linux, do you have the gcc compiler installed?

Does your package have a makefile?

onebuck 04-22-2010 08:36 AM

Hi,

Welcome to LQ!

'How to Ask Questions the Smart Way' would be my first suggestion since your post should have included more information.

If your using a embed and a PC to do your cross work on then the manufacture of the embed system will have the tools necessary. If you want to use the PC exclusively then the work is rather easily done with a GNU/Linux distribution that uses gcc (which most do). You would create your app then create a Makefile (this is where having the OEMs tools will make things easier). Once you compile and link for your system then it is just the matter of moving things to the embed.

I do suggest that you do a search here on LQ as this very subject has been covered so many times. Maybe not for your particular board but generally things are performed in the same manner.

Just a few more useful links;

Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Newbie Admin Guide
LinuxSelfHelp
Getting Started with Linux

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!

joslyn 04-23-2010 02:33 AM

The development system is x86 PC running on Linux kernel 2.6.21 with gcc 4.3.3 and the target system is beagle board.

The program what i have written is a helloword program (lodable kernel module) which has only module_init and module_exit functions and its definitions.
The Makefile given below is the one that i have used for compiling and running it on my development system (x86).

Makefile
--------
obj-m := hello_world.o

KDIR :=/lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)

default:
$(MAKE) -C $(KDIR) M=$(PWD) modules

Now i want to load the helloworld module in the target program. For this I need to compile the program for the target system using toolchain.
Pls let me the procedure that i need to follow to get this done.

Thanks.


All times are GMT -5. The time now is 12:04 AM.