[LLVMdev] LLVM Newb: Getting started
Anton Korobeynikov
asl at math.spbu.ru
Sat Nov 25 07:49:12 PST 2006
Hello, Wolfgang.
> I did not manage to make llvm-gcc create __main.
Code for static construction & destruction is highly platform dependent.
Usually it's placed in crt.o binary, which is compiled during main gcc
build cycle.
For example, for Linux we should only output some code in specialy named
sections and this code will automatically called by system loader. As
opposite, for mingw32 we're emitting "__main" directly.
You can change default behaviour by changing
X86DAGToDAGISel::EmitSpecialCodeForMain() routine located in the
lib/Target/X86/X86ISelDAGToDAG.cpp file (I'm assuming, you're using some
x86 target).
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
More information about the llvm-dev
mailing list