gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Cross compiling * from Linux

#92516 - tyraen - Thu Jul 13, 2006 7:07 pm

This is probably a stupid question, but can you just up and try to cross compile random Unix source with the arm-eabi stuff from devkitARM? What if you need to run a 'configure' first, what special options are there (like target=arm-eabi or something?). I understand that most things aren't going to compile because they're missing libraries, but will some software that is meant to be cross platform?

#92587 - wintermute - Fri Jul 14, 2006 12:33 am

You can try and some simple apps may even port fairly easily. The main issue is always going to be the lack of an underlying OS despite my newlib hackery to implement basic stdio. Libraries tend to port quite well - libpng & zlib are easy enough to compile and build without much work.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#92668 - tyraen - Fri Jul 14, 2006 11:36 am

I sort of thought that might be the case, all the resources I can find talk about cross compiling to ARM/Linux, not ARM/...? :)

Thanks!

#92716 - wintermute - Fri Jul 14, 2006 5:02 pm

heh, forgot to add some configure options.

Code:

LDFLAGS=-specs=ds_arm9.specs ./configure --host=arm-eabi


devkitARM/bin should be in the path before running configure.

Currently you need to set LDFLAGS to avoid "compiler cannot create executables" errors - I'm going to sort out the default configuration to link against libnosys in the future.

You probably also want to use a --prefix to set the install directory. --prefix=$DEVKITARM should work but I recommend not installing anything in there - the installer removes the whole toolchain directory to avoid filling your drive with the data from subsequent versions of gcc. $DEVKITPRO/libnds is probably reasonable for ds specific libraries but I'd probably just use something like $DEVKITPRO/dsportlibs and add that to the makefile LIBDIRS - remember to use the $(DEVKITPRO) form in the makefile.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog