builder

package
v0.0.0-...-9c32996 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2025 License: BSD-3-Clause, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParserError          = errors.New("parser error occurred")
	ErrMultiplePackages     = errors.New("directory contained multiple packages")
	ErrUnexpectedOutputPath = errors.New("unexpected output path provided")
	ErrLinknameAlreadyUsed  = errors.New("encountered duplicate linkname")
	ErrCodeGeneratorError   = errors.New("failed to generate object code")
	ErrCompilerFailed       = errors.New("compiler exited with an error")
)

Functions

func Build

func Build(ctx context.Context, moduleDir, packageDir string) error

func BuildPackages

func BuildPackages(ctx context.Context, options Options) error

func StageGoRoot

func StageGoRoot(stageDir string, env Env) error

Types

type Env

type Env map[string]string

func Environment

func Environment() (Env, error)

func (Env) List

func (e Env) List() []string

func (Env) Print

func (e Env) Print()

func (Env) Value

func (e Env) Value(key string) string

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(src, dest *ssa.Package)

func (*Graph) AddGlobalDependency

func (g *Graph) AddGlobalDependency(dependency *ssa.Package)

func (*Graph) Buckets

func (g *Graph) Buckets() ([][]*ssa.Package, error)

type Options

type Options struct {
	Packages          map[string]string
	Output            string
	BuildDir          string
	DumpOnVerifyError bool
	DumpIR            bool
	Environment       Env
	//CompilerVerbosity compiler.Verbosity
	GenerateDebugInfo bool
	BuildTags         []string
	Cpu               string
	Float             string
	CTypeNames        bool
	NumJobs           int
	Optimization      string
	StackSize         int
	KeepWorkDir       bool
	DebugLowering     bool
}

type Package

type Package struct {
	Name        string
	Version     string
	PathPrefix  string
	Sources     []string
	IncludeDirs []string
	Defines     []string
	Files       map[string]string
}

func (*Package) Compile

func (p *Package) Compile(toolchain Toolchain, triplet string, cpu string, fpu string, debug bool, opt string, floatEnabled bool,
	numjobs int) ([]string, error)

type Toolchain

type Toolchain struct {
	CC      string
	LD      string
	ObjCopy string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL