summaryrefslogtreecommitdiff
path: root/docs/FAQ.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-19 05:53:12 +0000
committerChris Lattner <sabre@nondot.org>2003-11-19 05:53:12 +0000
commitcc33d70a92866e615a0e1d5b97d9cd3e90e99115 (patch)
tree91f0c719f4f1d44a48a636e6a008151a9417c4c9 /docs/FAQ.html
parent6ff1a9272d6d1b3eda313580e94dc69387d07346 (diff)
downloadllvm-cc33d70a92866e615a0e1d5b97d9cd3e90e99115.tar.gz
llvm-cc33d70a92866e615a0e1d5b97d9cd3e90e99115.tar.bz2
llvm-cc33d70a92866e615a0e1d5b97d9cd3e90e99115.tar.xz
add new FAQ entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/FAQ.html')
-rw-r--r--docs/FAQ.html47
1 files changed, 43 insertions, 4 deletions
diff --git a/docs/FAQ.html b/docs/FAQ.html
index d0c5148763..51ba682860 100644
--- a/docs/FAQ.html
+++ b/docs/FAQ.html
@@ -50,7 +50,7 @@
<li>Why do test results differ when I perform different types of builds?</li>
</ol></li>
- <li><a href="#cfe">GCC Front End</a>
+ <li><a href="#cfe">Using the GCC Front End</a>
<ol>
<li>
When I compile software that uses a configure script, the configure script
@@ -64,6 +64,13 @@
</li>
</ol>
</li>
+
+ <li><a href="#cfe_code">Questions about code generated by the GCC front-end</a>
+ <ol>
+ <li>What is this <tt>__main()</tt> call that gets inserted into
+ <tt>main()</tt>?</li>
+ </ol>
+ </li>
</ol>
<!-- *********************************************************************** -->
@@ -322,7 +329,7 @@ build.</p>
<!-- *********************************************************************** -->
<div class="doc_section">
- <a name="cfe">GCC Front End</a>
+ <a name="cfe">Using the GCC Front End</a>
</div>
<div class="question">
@@ -367,14 +374,14 @@ not linking on your system because the feature isn't available on your system.
</p>
</div>
-<div class="question"
+<div class="question">
<p>
When I compile code using the LLVM GCC front end, it complains that it cannot
find crtend.o.
</p>
</div>
-<div class="answer"
+<div class="answer">
<p>
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.
</p>
</div>
+
+
+<!-- *********************************************************************** -->
+<div class="doc_section">
+ <a name="cfe_code">Questions about code generated by the GCC front-end</a>
+</div>
+
+<div class="question">
+<p>
+What is this <tt>__main()</tt> call that gets inserted into <tt>main()</tt>?
+</p>
+</div>
+
+<div class="answer">
+<p>
+The <tt>__main</tt> 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.
+</p>
+
+<p>
+The actual implementation of <tt>__main</tt> lives in the
+<tt>llvm/runtime/GCCLibraries/crtend/</tt> directory in the source-base, and is
+linked in automatically when you link the program.
+</p>
+
+</div>
+
+
+
<!-- *********************************************************************** -->
<!-- *********************************************************************** -->