In my previous post http://olimex.wordpress.com/2012/09/06/imx233-olinuxino-get-started-making-the-arch-linux-sd-card/ I wrote how to setup GCC tools for iMX233-OLinuXino and how to make your “hello world” program.
To do compilation on the SD card though is bad idea. SD card is FLASH memory this means to write sector in it this sector first have to be erased, the number of Erase cycles of the Flash memory is limited and may be as high as 1 000 000 times and as low as 1 000 cycles (depend on the SD card vendor ;) ), 1000 times my seems to you quite high but just imagine that you have to compile several times your code until you make it work you can wear your card for week.
Then what you should do?
There is smart work around by using SSH and shared folder on your host linux computer where you can place your working directory.
1. You need to install SSH on iMX233-OLinuXino (we assume you use ARCH Linux distribution):
$ sudo su
# pacman -Sy sshfs
2. On your host linux machine create working directory for instance “olinuxino_test” using this command:
# sshfs [user]@[host]:[dir] [mountpoint]
# sshfs email@example.com:olinuxino_test /mnt/test_build
In this case the working directory is in the user home folder.
3. Simply go to the mount point and start working:
# cd /mnt/test_build
# cc testcode.c -o test
4. If you want to unmount the remote directory use this command:
# fusermount -u /mnt/test_build
By using this approach all your compilation is done in the remote folder and your SD card flash is safe.