From cc33d70a92866e615a0e1d5b97d9cd3e90e99115 Mon Sep 17 00:00:00 2001
From: Chris Lattner
+
+
When I compile code using the LLVM GCC front end, it complains that it cannot find crtend.o.
In order to find crtend.o, you must have the directory in which it lives in your LLVM_LIB_SEARCH_PATH environment variable. For the binary distribution of @@ -382,6 +389,38 @@ the LLVM GCC front end, this will be the full path of the bytecode-libs directory inside of the LLVM GCC distribution.
+What is this __main() call that gets inserted into main()? +
++The __main call is inserted by the C/C++ compiler in order to guarantee +that static constructors and destructors are called when the program starts up +and shuts down. In C, you can create static constructors and destructors by +using GCC extensions, and in C++ you can do so by creating a global variable +whose class has a ctor or dtor. +
+ ++The actual implementation of __main lives in the +llvm/runtime/GCCLibraries/crtend/ directory in the source-base, and is +linked in automatically when you link the program. +
+ +