GP32 How To Build A Cross Compiler (unix/linux)


sixxie

Certified Guru
Joined
Apr 2, 2003
Messages
59
Website
www.6809.org.uk
Compiling something recently, I was disappointed with the speed and thought maybe a more recent version of gcc would help. Didn't find anything online specific to building a cross-compiler for GP32, so struggled through myself.

Had a few failures, due to the SDK libraries being compiled one way and gcc building itself (and therefore libgcc.a) another. I assume the GBA people have an FPU or something so avoid this (or maybe they just have an SDK compiled with a recent gcc). Bah. Anyway, found out what the problem was and thought I'd document it all somewhere google would find so maybe someone else won't spend a day growling over it.

Building a gcc-3.3.2 ARM cross-compiler for GP32. Any additions gratefully received..

Of course it made no damn difference to the speed ;)
 
-msoft-float -mthumb-interwork --enable-interwork

Dont use it, it will tell the compiler to build a "slow" thumb mode compiler.

Dont use gcc 3.3.2, use 3.3.3 or a cvs version of 3.4.0,
the cvs version of 3.4.0 boost your floating point maths over 400%.

Dont use -O3, it will only rise the size of code, but not the speed.
Always use -O2.


Cant check it all, but try theses hints...
 
> -msoft-float -mthumb-interwork --enable-interwork
>
> Dont use it, it will tell the compiler to build a "slow" thumb mode compiler.

I thought it just enabled the possibility to switch to thumb mode if needed (though Bob knows when it would be needed)? If you use the old SDK libraries without interwork enabled you get lots of warnings when you link, I know that much. Though I think these warnings can be ignored (unlike the soft-float stuff).

Eventually I'll be porting to use your replacement SDK though as you've provided source for that, so it can be compiled up with a gcc without those options and all will be lovely in the world.

> Dont use gcc 3.3.2, use 3.3.3 or a cvs version of 3.4.0,
> the cvs version of 3.4.0 boost your floating point maths over 400%.

I can imagine the FP improvements come from incorporating the soft-float patch that's floating around (compiles in some asm library code, allows -mfpu=softvfp). Out of interest, is there improvement in integer speed? I'd love to squeeze a bit more speed out 'ferfree'.

> Dont use -O3, it will only rise the size of code, but not the speed.
> Always use -O2.

Ok.
 
>I can imagine the FP improvements come from incorporating the soft-float
>patch that's floating around (compiles in some asm library code, allows
>-mfpu=softvfp). Out of interest, is there improvement in integer speed? I'd> >love to squeeze a bit more speed out 'ferfree'.

-mfpu=softvfp is activated per default, if you use gcc 3.4.0 cvs
Integer is not spped up.

>Eventually I'll be porting to use your replacement SDK though as you've
>provided source for that, so it can be compiled up with a gcc without those >options and all will be lovely in the world.

get a gcc 3.4.0 cross compiler for linux and windows on my HP,
http://www.mirkoroller.de/gp32
 
> I posted a cross compiler How-To over a month ago here:
>
> http://www.gp32x.de/board/index.php?showtopic=7112&st=15

Gah! I wish I'd seen that yesterday! Google didn't come up
with the goods...

Though I do imagine I'd still have had problems with my SDK libraries
being no-fpued and thumb-interworked. If I have time tonight, I'll start
looking at your new whizz-bang SDK :)

Shame about there being no noticable integer improvements, I guess I'll have
to write better code ;)
 
Last edited by a moderator:
I try to compile my own gcc 3.3.3 and got some errors :(

if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/home/slubman/Applications/gp32/gcc-3.3.3-arm-elf/gcc/xgcc -B/home/slubman/Applications/gp32/gcc-3.3.3-arm-elf/gcc/ -B~/gp32gcc/arm-elf/bin/ -B~/gp32gcc/arm-elf/lib/ -isystem ~/gp32gcc/arm-elf/include -O2 -msoft-float -mthumb-interwork -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -Dinhibit_libc -fno-inline -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.3.3/gcc -I../../gcc-3.3.3/gcc/. -I../../gcc-3.3.3/gcc/config -I../../gcc-3.3.3/gcc/../include -DL_udivsi3 -xassembler-with-cpp -c ../../gcc-3.3.3/gcc/config/arm/lib1funcs.asm -o libgcc/./_udivsi3.o
as: unrecognized option `-mno-fpu'
make[2]: *** [libgcc/./_udivsi3.o] Erreur 1
make[2]: Leaving directory `/home/slubman/Applications/gp32/gcc-3.3.3-arm-elf/gcc'
make[1]: *** [stmp-multilib] Erreur 2
make[1]: Leaving directory `/home/slubman/Applications/gp32/gcc-3.3.3-arm-elf/gcc'
make: *** [all-gcc] Erreur 2
 
Back
Top