Documentation
¶
Index ¶
- type CRTFlavor
- type CXXRuntimeFlavor
- type DebugInfoPolicy
- type DriverFlavor
- type Export
- func Use(goos, goarch, targetName string, wasiThreads, forceEspClang bool, ...) (export Export, err error)
- func UseTarget(targetName string, level optlevel.Level, ltoMode lto.Mode) (export Export, err error)
- func UseWithGOARM(goos, goarch, goarm, targetName string, wasiThreads, forceEspClang bool, ...) (export Export, err error)
- func UseWithGOARMAndToolchain(goos, goarch, goarm, targetName string, wasiThreads, forceEspClang bool, ...) (export Export, err error)
- type LinkerFlavor
- type NativeToolchain
- type NativeToolchainInput
- type ObjectFormat
- type PlatformABI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CXXRuntimeFlavor ¶ added in v1.0.1
type CXXRuntimeFlavor string
const ( CXXRuntimeUnknown CXXRuntimeFlavor = "" CXXRuntimeMSVC CXXRuntimeFlavor = "msvc" )
type DebugInfoPolicy ¶
DebugInfoPolicy describes how a selected linker handles debug information. Build orchestration consumes this typed capability instead of inferring it from a target name or linker executable.
type DriverFlavor ¶ added in v1.0.1
type DriverFlavor string
const ( DriverFlavorUnknown DriverFlavor = "" DriverFlavorClangGNU DriverFlavor = "clang" )
type Export ¶
type Export struct {
CC string // C compiler executable
CCArgs []string
CXX string // C++ compiler executable
CXXArgs []string
CCFLAGS []string
CFLAGS []string
LDFLAGS []string
// CompilerIdentity values are stable version strings used to keep cached
// packages separate when an explicit native toolchain changes.
CCIdentity string
CXXIdentity string
// Toolchain records the ABI and flag dialect selected for native-format
// outputs. It is independent of the host shell and remains empty for named
// embedded/WebAssembly targets that drive their linker directly.
Toolchain NativeToolchain
// Additional fields from target configuration
BuildTags []string
GOOS string
GOARCH string
Libc string
Linker string // Linker to use (e.g., "ld.lld", "avr-ld")
LinkerArgs []string
LinkerIdentity string
ExtraFiles []string // Extra files to compile and link (e.g., .s, .c files)
ClangRoot string // Root directory of custom clang installation
ClangBinPath string // Path to clang binary directory
LLVMTarget string // LLVM Target
TargetABI string // RISC-V Target ABI (e.g., "lp64", "lp64d")
BinaryFormat string // Binary format (e.g., "elf", "esp", "uf2")
FormatDetail string // For uf2, it's uf2FamilyID
Emulator string // Emulator command template (e.g., "qemu-system-arm -M {} -kernel {}")
DebugInfo DebugInfoPolicy
// Flashing/Debugging configuration
Device flash.Device // Device configuration for flashing/debugging
}
func Use ¶
func Use(goos, goarch, targetName string, wasiThreads, forceEspClang bool, level optlevel.Level, ltoMode lto.Mode, goGlobalDCE bool) (export Export, err error)
Use extends the original Use function to support target-based configuration If targetName is provided, it takes precedence over goos/goarch
func UseTarget ¶
func UseTarget(targetName string, level optlevel.Level, ltoMode lto.Mode) (export Export, err error)
UseTarget loads configuration from a target name (e.g., "rp2040", "wasi")
func UseWithGOARM ¶ added in v1.0.1
func UseWithGOARM(goos, goarch, goarm, targetName string, wasiThreads, forceEspClang bool, level optlevel.Level, ltoMode lto.Mode, goGlobalDCE bool) (export Export, err error)
UseWithGOARM is Use with an explicit Go ARM architecture setting. The setting affects native GOARCH=arm clang and linker triples; named targets retain their target configuration's LLVM triple.
func UseWithGOARMAndToolchain ¶ added in v1.0.1
func UseWithGOARMAndToolchain(goos, goarch, goarm, targetName string, wasiThreads, forceEspClang bool, level optlevel.Level, ltoMode lto.Mode, goGlobalDCE bool, nativeInput NativeToolchainInput) (export Export, err error)
UseWithGOARMAndToolchain is UseWithGOARM with explicit Go-compatible native compiler commands. Named -target configurations intentionally ignore these host commands and preserve their existing toolchain selection.
type LinkerFlavor ¶ added in v1.0.1
type LinkerFlavor string
const ( LinkerFlavorUnknown LinkerFlavor = "" LinkerFlavorELFLLD LinkerFlavor = "ld.lld" LinkerFlavorMachO LinkerFlavor = "ld64.lld" LinkerFlavorCOFFLLD LinkerFlavor = "lld-link" LinkerFlavorMinGWLLD LinkerFlavor = "mingw-lld" )
type NativeToolchain ¶ added in v1.0.1
type NativeToolchain struct {
ABI PlatformABI
ObjectFormat ObjectFormat
Driver DriverFlavor
Linker LinkerFlavor
TargetTriple string
CRT CRTFlavor
CXXRuntime CXXRuntimeFlavor
SDKVersion string
CRTVersion string
ToolsetVersion string
}
NativeToolchain describes the externally visible ABI and the tools used to produce a native object. Keep these choices explicit: in particular, a Windows host does not imply either the MSVC or MinGW ABI.
type NativeToolchainInput ¶ added in v1.0.1
type NativeToolchainInput struct {
CC []string
CXX []string
ExternalLinker []string
ExternalFlags []string
Dir string
Environ []string
}
NativeToolchainInput contains Go-compatible native compiler command prefixes and external-linker flags. CC, CXX, and ExternalLinker are parsed command prefixes: element zero is the executable and the remainder are arguments that must precede LLGo's generated flags. ExternalFlags is the plain flag list parsed from -extldflags.
type ObjectFormat ¶ added in v1.0.1
type ObjectFormat string
const ( ObjectFormatUnknown ObjectFormat = "" ObjectFormatELF ObjectFormat = "elf" ObjectFormatMachO ObjectFormat = "macho" ObjectFormatCOFF ObjectFormat = "coff" )
type PlatformABI ¶ added in v1.0.1
type PlatformABI string
const ( PlatformABIUnknown PlatformABI = "" PlatformABIGNU PlatformABI = "gnu" PlatformABIDarwin PlatformABI = "darwin" PlatformABIMsvc PlatformABI = "msvc" )