IMPORTANT: SD card should be ext2 formated, because of links needed by libs.
2. Install gcc compiler and binutils. To do this first add your new made space as ipkg source destination by adding line to /etc/ipkg.conf like this
dest card /mnt/cardNow you can install packages you need
ipkg install glibc-extra-nss libthread-db1 ipkg install -d card binutils binutils-symlinks cpp gcc gcc-symlinks libc6-dev
(If you wonder about feed take this http://familiar.handhelds.org/releases/v0.8.2/feed/base)
I installed also thisipkg install -d card g++ g++-symlinksTo have all card packages linked to default locations against root (like /bin/gcc for /media/card/gcc) use this:
ipkg-link mount /media/card/3. Write hello world programm in file hello.c
#include <stdio.h>
int main(int argc, char** argv) {
printf("Hello, World!\n");
return 0;
}
4. If you try
gcc hello.c -o hellofor some reason test app do not compiles. It says that it can't find -lgcc_s. I get rid of this with command:
ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so5. You should also correct some kind of bug in file /usr/lib/libc.so with comenting out last line with *** so it will look like this
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. *** BUG in libc/scripts/output-format.sed *** elf32-bigarm,elf32-littlearm */ GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
This file has changed in 0.8.4-rc2, but it still breaks. if you set the line starting with 'GROUP' to what is above and leave everything else alone, it works.
If you want to compile somthing with -pthread option then do the same with file - /usr/lib/libpthread.so (this file is fine now (0.8.4-rc2))
6. Compile it withgcc hello.c -o hello7. If you try to use ar (or libtool) you will probably run into something like this:
ar: cru: No such file or directory
00:03.19 joh anything strange with the version of 'ar' in busybox? 00:03.55 joh I do this: "ar cru libiw.a iwlib.o" and get "ar: cru: No such file or directory" 00:04.03 kergoth its extract only. 00:04.05 kergoth no create 00:04.17 joh oh, is it possible to enable create? 00:04.26 kergoth not that i know of 00:05.14 joh dohIt's finding /usr/bin/ar which is a symlink that points to busybox rather than /mnt/card/packages/usr/bin/arm-linux-ar. So do this:
rm /usr/bin/ar ln -s /mnt/card/packages/usr/bin/arm-linux-ar /usr/bin/arThe above didn't work for me (JoshuaLayne), instead:
rm /usr/bin/ar ln -s /mnt/card/usr/bin/arm-linux-ar /usr/bin/ar