Overview
This issue tracks the implementation of Task 1 from the overall cross-platform compilation design (#1176): Adding -target parameter support for llgo build, llgo run, and llgo test commands.
Scope
Build and link parameter configuration support including:
- llvm-target
- goos/goarch
- cflags/ldflags
- linker
- cpu
- features
- build-tags
Implementation Details
Target Configuration System
- Introduce
@/targets directory containing JSON configuration files
- Support multi-level inheritance via
inherits field
- Automatic parameter merging and overriding
Supported Configuration Fields
- inherits: Array for multi-level inheritance
- llvm-target: LLVM backend target triple
- goos/goarch: Go OS and architecture identifiers
- build-tags: Go build tags for conditional compilation
- cflags/ldflags: C compiler and linker parameters
- features/cpu: CPU features, model
- linker: Specifies the linker to use
Command Integration
Add -target flag support to:
llgo build -target <target_name>
llgo run -target <target_name>
llgo test -target <target_name>
Migration Strategy
- Retain logic for native builds
- Retain wasm/wasip1 logic (SDK download, sysroot/resource-dir automation)
- Use JSON target configs for all other platforms
Related Issues
Implementation Status
Acceptance Criteria
Overview
This issue tracks the implementation of Task 1 from the overall cross-platform compilation design (#1176): Adding
-targetparameter support forllgo build,llgo run, andllgo testcommands.Scope
Build and link parameter configuration support including:
Implementation Details
Target Configuration System
@/targetsdirectory containing JSON configuration filesinheritsfieldSupported Configuration Fields
Command Integration
Add
-targetflag support to:llgo build -target <target_name>llgo run -target <target_name>llgo test -target <target_name>Migration Strategy
Related Issues
Implementation Status
Acceptance Criteria
-targetparameter works for build/run/test commands