Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: benbiles on August 22, 2014, 05:55:29 am

Title: cross compile on OSX ?
Post by: benbiles on August 22, 2014, 05:55:29 am
Hi, I would like to cross compile libtimecode https://github.com/x42/libtimecode to run on imx233 olimex baord.

I am using OSX. is there a cross compiler for OSX? or am I better off installing linux on an old pc and using that?

If its easier to use Linux, which distro would be the best for this purpose? I used to build custom linux Kernels years ago but
have no experience in cross compile / debug.

Ultimately it would be nice to learn how to cross compile / debug then build a release package!



Title: Re: cross compile on OSX ?
Post by: mbergmann on August 22, 2014, 10:55:16 am
Hi benbiles,

you may check out Roland Lang's posts on http://tblog.rool.at/ for installing the cross-compiler on OSX.
The blog post is basically for RasbPi, but the principles are the same.

Regards

Mike
Title: Re: cross compile on OSX ?
Post by: benbiles on August 23, 2014, 04:55:44 am
thanks Mike, will give this method a try this week and report back.. might save me going out and buying an old
Lenovo laptop and installing ubuntu on it.. i might still do that anyway..

Its an embarrassingly newby question but if gcc comes with olimex imx233 ready to run on the boards OS could i compile the code directly on the board rather than using a cross compiler at all?

or would that take the board weeks to compile? my end goal is to get things like ltc-tools compiled and running https://github.com/x42/ltc-tools

also i think i read somewhere the imx233 is actually arm5 source or something, does that effect the osx guide?


thanks again, ben
Title: Re: cross compile on OSX ?
Post by: mbergmann on August 23, 2014, 02:53:40 pm
Hi,

ARM is great for 'developing for', but not so great for 'developing on', so I prefer a cross-compiler.

For the ARM architecture simply specify:

CFLAGS += -mcpu=arm926ej-s -march=armv5te

To make the code working on i.MX233

Regards

Mike
Title: Re: cross compile on OSX ?
Post by: benbiles on August 23, 2014, 03:19:31 pm
Ok, thanks,  I'll just stick to using a cross compiler then ( hopefuly running on osx). Also will need to find a way to terminal over uart usb cable f.. Hopfuly that won't be a stumbling block with osx too..
I just realised I'll have to compile any needed dependencies if they are not already available,  so I suppose it would take forever on the imx233 even if it would compile.. Will post back if I run into any probs.