X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FGoldPlugin.html;h=e25c45751929f037d33be3a514edbff6e84b78f9;hb=74ee8ace0c6fd6715d16fd4f1a0e36a8a158868e;hp=68c5cf19280288ced2c771185e39105d4ae58069;hpb=ed7713df195051c3f9a79dcc5a21252224727c66;p=oota-llvm.git diff --git a/docs/GoldPlugin.html b/docs/GoldPlugin.html index 68c5cf19280..e25c4575192 100644 --- a/docs/GoldPlugin.html +++ b/docs/GoldPlugin.html @@ -7,7 +7,7 @@ -
LLVM gold plugin
+

LLVM gold plugin

  1. Introduction
  2. How to build it
  3. @@ -21,9 +21,9 @@
    Written by Nick Lewycky
    -
    Introduction
    +

    Introduction

    -
    +

    Building with link time optimization requires cooperation from the system linker. LTO support on Linux systems requires that you use the gold linker which supports @@ -33,14 +33,14 @@ project.

    The LLVM gold plugin implements the gold plugin interface on top of -libLTO. +libLTO. The same plugin can also be used by other tools such as ar and nm.

    - +

    How to build it

    -
    +

    You need to have gold with plugin support and build the LLVMgold plugin. Check whether you have gold running /usr/bin/ld -v. It will report “GNU gold” or else “GNU ld” if not. If you have @@ -72,9 +72,9 @@ placed.

    - +

    Usage

    -
    +

    The linker takes a -plugin option that points to the path of the plugin .so file. To find out what link command gcc would run in a given situation, run gcc -v [...] and look @@ -95,14 +95,13 @@ placed. own gold, be sure to install the ar and nm-new you built to /usr/bin.

    -

    - + -
    +

    The following example shows a worked example of the gold plugin mixing LLVM bitcode and native code.

    @@ -145,14 +144,20 @@ $ llvm-gcc -use-gold-plugin a.a b.o -o main # <-- link with LLVMgold plugin
     

    Gold informs the plugin that foo3 is never referenced outside the IR, leading LLVM to delete that function. However, unlike in the - libLTO + libLTO example gold does not currently eliminate foo4.

    +
    + - +

    + + Quickstart for using LTO with autotooled projects + +

    -
    +

    Once your system ld, ar and nm all support LLVM bitcode, everything is in place for an easy to use LTO build of autotooled projects:

    @@ -189,9 +194,9 @@ export CFLAGS="-O4"
    - +

    Licensing

    -
    +

    Gold is licensed under the GPLv3. LLVMgold uses the interface file plugin-api.h from gold which means that the resulting LLVMgold.so binary is also GPLv3. This can still be used to link non-GPLv3 programs just @@ -206,7 +211,7 @@ as much as gold could without the plugin.

    Valid HTML 4.01 Nick Lewycky
    - The LLVM Compiler Infrastructure
    + The LLVM Compiler Infrastructure
    Last modified: $Date: 2010-04-16 23:58:21 -0800 (Fri, 16 Apr 2010) $