Documentation
¶
Overview ¶
Package builder is the compiler driver of TinyGo. It takes in a package name and an output path, and outputs an executable. It manages the entire compilation pipeline in between.
Index ¶
- Variables
- func Build(pkgName, outpath string, config *compileopts.Config, action func(string) error) error
- func GorootVersionString(goroot string) (string, error)
- func NewConfig(options *compileopts.Options) (*compileopts.Config, error)
- func RunTool(tool string, args ...string) error
- type Library
- type MultiError
Constants ¶
This section is empty.
Variables ¶
var CompilerRT = Library{ // contains filtered or unexported fields }
CompilerRT is a library with symbols required by programs compiled with LLVM. These symbols are for operations that cannot be emitted with a single instruction or a short sequence of instructions for that target.
For more information, see: https://compiler-rt.llvm.org/
var Picolibc = Library{ // contains filtered or unexported fields }
Picolibc is a C library for bare metal embedded devices. It was originally based on newlib.
Functions ¶
func Build ¶
Build performs a single package to executable Go build. It takes in a package name, an output path, and set of compile options and from that it manages the whole compilation process.
The error value may be of type *MultiError. Callers will likely want to check for this case and print such errors individually.
func GorootVersionString ¶
GorootVersionString returns the version string as reported by the Go toolchain for the given GOROOT path. It is usually of the form `go1.x.y` but can have some variations (for beta releases, for example).
func NewConfig ¶
func NewConfig(options *compileopts.Options) (*compileopts.Config, error)
NewConfig builds a new Config object from a set of compiler options. It also loads some information from the environment while doing that. For example, it uses the currently active GOPATH (from the goenv package) to determine the Go version to use.
Types ¶
type Library ¶ added in v0.13.0
type Library struct {
// contains filtered or unexported fields
}
Library is a container for information about a single C library, such as a compiler runtime or libc.
type MultiError ¶
type MultiError struct {
Errs []error
}
MultiError is a list of multiple errors (actually: diagnostics) returned during LLVM IR generation.
func (*MultiError) Error ¶
func (e *MultiError) Error() string