github.com/prattmic/llgo-embedded@v0.0.0-20150820070356-41cfecea0e1e/third_party/gofrontend/libgo/README (about)

     1  See ../README.
     2  
     3  This is the runtime support library for the Go programming language.
     4  This library is intended for use with the Go frontend.
     5  
     6  This library should not be stripped when it is installed.  Go code
     7  relies on being able to look up file/line information, which comes
     8  from the debugging info using the libbacktrace library.
     9  
    10  The library has only been tested on GNU/Linux using glibc, and on
    11  Solaris.  It should not be difficult to port to other operating
    12  systems.
    13  
    14  Directories:
    15  
    16  go
    17    A copy of the Go library from http://golang.org/, with several
    18    changes for gccgo.
    19  
    20  runtime
    21    Runtime functions, written in C, which are called directly by the
    22    compiler or by the library.
    23  
    24  Contributing
    25  ============
    26  
    27  To contribute patches to the files in this directory, please see
    28  http://golang.org/doc/gccgo_contribute.html .
    29  
    30  The master copy of these files is hosted at
    31  http://code.google.com/p/gofrontend .  Changes to these files require
    32  signing a Google contributor license agreement.  If you are the
    33  copyright holder, you will need to agree to the individual contributor
    34  license agreement at
    35  http://code.google.com/legal/individual-cla-v1.0.html.  This agreement
    36  can be completed online.
    37  
    38  If your organization is the copyright holder, the organization will
    39  need to agree to the corporate contributor license agreement at
    40  http://code.google.com/legal/corporate-cla-v1.0.html.
    41  
    42  If the copyright holder for your code has already completed the
    43  agreement in connection with another Google open source project, it
    44  does not need to be completed again.
    45  
    46  Regenerating Makefiles
    47  ======================
    48  
    49  Use *exactly* autoconf 2.65 and libtool 2.2.8.  Run `autoreconf -fi`.
    50  
    51  Building for arm-none-eabi
    52  ==========================
    53  
    54  `LLVM_BUILD_DIR` is the directory you built LLVM in, and `LLVM_INSTALL_DIR`
    55  is the directory it installed to.
    56  
    57  This will generate libgobegin.a (contains main) and .libs/libgo-runtime.a:
    58  
    59      $ mkdir build && cd build
    60      $ ../configure CC="env REAL_CC=${LLVM_INSTALL_DIR}/bin/clang ${LLVM_BUILD_DIR}/bin/cc-wrapper" CFLAGS="--target=arm-none-eabi -mcpu=cortex-m4 -nostdlib" --host=arm-none-eabi --without-libffi --without-stack-split
    61      $ make libgo-runtime.la libgobegin.a -j4
    62  
    63  You will also want libbacktrace.a:
    64  
    65      $ cd ../libbacktrace
    66      $ mkdir build && cd build
    67      $ ../configure CC="env REAL_CC=${LLVM_INSTALL_DIR}/bin/clang ${LLVM_BUILD_DIR}/bin/cc-wrapper" CFLAGS="--target=arm-none-eabi -mcpu=cortex-m4 -nostdlib" --host=arm-none-eabi
    68      $ make -j4
    69  
    70  Build an object that contains _start and link it with the magic:
    71  
    72      $ clang --target=arm-none-eabi hello.o ./build/libgobegin.a ./build/.libs/libgo-runtime.a ../libbacktrace/build/.libs/libbacktrace.a -nostdlib -lgcc