Wiki source for CompilerOptgen


Show raw source

{{fbdoc item="title" value="Compiler Option: -gen"}}----
Sets the backend code emitter.

{{fbdoc item="syntax"}}##
**-gen** < //backend// >
##
{{fbdoc item="param"}}
##//backend//##
##**gas**## for x86 GAS assembly, ##**gcc**## for GNU C, ##**llvm**## for LLVM IR.

{{fbdoc item="desc"}}
The ##-gen## compiler option sets the backend code emitter and assembler.

{{fbdoc item="subsect" value="-gen gas"}}
The compiler will emit GAS assembler code to a ##.asm## file which will then be compiled to an object file using '##as##'. This is fbc's original x86 code generation backend.

{{fbdoc item="subsect" value="-gen gcc"}}
The compiler will emit C code to a ##.c## file which will then be compiled to an .asm file using '##gcc##' as a high level assembler. The C backend is intended to make FB portable to more platforms than just x86. This requires gcc to be installed so that fbc can invoke it to compile the C code, also see [[CompilerInstallingGcc|Installing gcc for -gen gcc]].

{{fbdoc item="subsect" value="-gen llvm"}}
The compiler will emit LLVM IR code to a ##.ll## file which will then be compiled to an .asm file using '##llc##'. The LLVM backend is still a work in progress. It is intended for the same purpose as the C backend, and could theoretically solve some of the C backend's problems, such as debugging meta data support.

{{fbdoc item="see"}}
- [[CompilerTools|Tools used by fbc]]
- [[CompilerCmdLine|Using the Command Line]]

{{fbdoc item="back" value="CatPgCompOpt|Compiler Options"}}
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode