GNU Command Line Switches
SH-ELF-GCC
mandatory
-mlcompile for little endian target.
-m4
generate code for sh4.
recommended
-lg -lm -lc -lgcclink against standard libraries.
-o
specify name of output file.
-Wall
show all warnings. it's always a good thing to write code that compiles without all these warnings. :=P
-m4-single-only
*always* use this one instead of -m4 if you don't really need double precision floating point variables. (you most probably don't)
-O3
use highest optimization level. valid values are -O0 (none) -O3 (max).
--fast-math
use the sh4-built-in math functions.
optional
-Itell gcc about the path(s) to search for include files.
-nostartfiles
don't link standard startup files.
-nostdlib
don't link standard library.
-e
define entry point (if other than main()).
-c
compile only, but don't link.
-Wl,,,...
pass one or more options to the linker (LD). Incase there are spaces seperating arguments from switches, always use commas to fill them. (eg. -Wl,-Ttext,0x8c010000)
SH-ELF-AS
mandatory
-littlegenerate code for little endian target.
SH-ELF-LD
mandatory
-mshlelfgenerate little endian elf output.
recommended
-Ttset start of TEXT section. For Dreamcast this would usually be 0x8c010000
-lg -lm -lc -lgcc
link against standard libraries.
optional
--library-path=set path to search for libraries.
-L
set path to search for linker scripts.
--script
set script file to use for linking.
note: for the ARM tools i just listed the differences to the above, all the
generic (target independent) switches remain the same ofcoz.
set start of TEXT section. For the AICA this would usually be 0x00000000
ARM-ELF-GCC
mandatory
-mcpu=arm7recommended
-O4ARM-ELF-AS
mandatory
-marm7ARM-ELF-LD
mandatory
-marmelfrecommended
-Ttset start of TEXT section. For the AICA this would usually be 0x00000000
13.08.2000 Groepaz/Hitmen
03.09.2000 added ARM related stuff
03.09.2000 added ARM related stuff