From cc33d70a92866e615a0e1d5b97d9cd3e90e99115 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 19 Nov 2003 05:53:12 +0000 Subject: [PATCH] add new FAQ entry git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10078 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/FAQ.html | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/docs/FAQ.html b/docs/FAQ.html index d0c5148763a..51ba6828606 100644 --- a/docs/FAQ.html +++ b/docs/FAQ.html @@ -50,7 +50,7 @@
  • Why do test results differ when I perform different types of builds?
  • -
  • GCC Front End +
  • Using the GCC Front End
    1. When I compile software that uses a configure script, the configure script @@ -64,6 +64,13 @@
  • + +
  • Questions about code generated by the GCC front-end +
      +
    1. What is this __main() call that gets inserted into + main()?
    2. +
    +
  • @@ -322,7 +329,7 @@ build.

    - GCC Front End + Using the GCC Front End
    @@ -367,14 +374,14 @@ not linking on your system because the feature isn't available on your system.

    -

    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.

    + + + +
    + Questions about code generated by the GCC front-end +
    + +
    +

    +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. +

    + +
    + + +