github.com/llvm-mirror/llgo@v0.0.0-20190322182713-bf6f0a60fce1/README.TXT (about)

     1  llgo
     2  ====
     3  
     4  llgo is a Go (http://golang.org) frontend for LLVM, written in Go.
     5  
     6  llgo is under active development. It compiles and passes most of the
     7  standard library test suite and a substantial portion of the gc test suite,
     8  but there are some corner cases that are known not to be handled correctly
     9  yet. Nevertheless it can compile modestly substantial programs (including
    10  itself; it is self hosting on x86-64 Linux).
    11  
    12  Mailing list: https://groups.google.com/d/forum/llgo-dev
    13  
    14  Supported platforms
    15  -------------------
    16  
    17  llgo is currently only supported on the x86-64 Linux platform. Contributions
    18  that add support for other platforms are welcome.
    19  
    20  There are two components which would need to be ported to new platforms: the
    21  compiler and the runtime library. The compiler has little platform-specific
    22  code; the most significant is in irgen/cabi.go. The main limiting factor
    23  for new platforms is the runtime library in third_party/gofrontend/libgo,
    24  which inherits some support for other platforms from the gc compiler's
    25  runtime library, but this support tends to be incomplete.
    26  
    27  Installation
    28  ------------
    29  
    30  llgo requires:
    31  * Go 1.3 or later.
    32  * CMake 2.8.8 or later (to build LLVM).
    33  * A modern C++ toolchain (to build LLVM).
    34    http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain
    35  
    36  Note that Ubuntu Precise is one Linux distribution which does not package
    37  a sufficiently new CMake or C++ toolchain.
    38  
    39  To build and install llgo:
    40  
    41      # Checkout llvm project.
    42      git clone https://github.com/llvm/llvm-project.git
    43  
    44      # Build LLVM, Clang and llgo: (see also http://llvm.org/docs/CMake.html)
    45      cd llvm-project
    46      mkdir build
    47      cd build
    48      cmake ../llvm -DLLVM_ENABLE_PROJECTS='clang;llgo' -DCMAKE_INSTALL_PREFIX=/path/to/llvm-inst
    49      make install
    50  
    51  Running
    52  -------
    53  
    54  llgo-go is llgo's version of the "go" command. It has the same command line
    55  interface as go, and works the same way, but it uses llgo to compile.
    56  
    57  llgoi is an interactive REPL for Go. It supports expressions, statements, most
    58  declarations and imports, including binary imports from the standard library
    59  and source imports from $GOPATH. See docs/llgoi.rst for more information.
    60  
    61  llgo is the compiler binary. It has a command line interface that is intended
    62  to be compatible to a large extent with gccgo.
    63  
    64  Contributing
    65  ------------
    66  
    67  Changes to code outside the third_party directory should be contributed in
    68  the normal way by sending patches to <llvm-commits@lists.llvm.org>.
    69  
    70  Changes to code in the third_party directory must first be made in the
    71  respective upstream project, from which they will be mirrored into the llgo
    72  repository. See the script update_third_party.sh for the locations of the
    73  upstream projects and details of how the mirroring works.
    74