WANTED
last updated on 27/03/2006
Home > gccswitches

GNU Command Line Switches

SH-ELF-GCC

mandatory

-ml
compile for little endian target.
-m4
generate code for sh4.

recommended

-lg -lm -lc -lgcc
link 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

-I
tell 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

-little
generate code for little endian target.

SH-ELF-LD

mandatory

-mshlelf
generate little endian elf output.

recommended

-Tt
set 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.

ARM-ELF-GCC

mandatory

-mcpu=arm7

recommended

-O4

ARM-ELF-AS

mandatory

-marm7

ARM-ELF-LD

mandatory

-marmelf

recommended

-Tt
set start of TEXT section. For the AICA this would usually be 0x00000000
13.08.2000 Groepaz/Hitmen
03.09.2000 added ARM related stuff
Web-Programming by Cupid Design by Se7en Content maintained by Groepaz ©1996-2017 Hitmen