- Modified cl/import.go to check LLGO_TARGET_BAREMETAL env var
- For baremetal targets: //export SymbolName allows different export name (TinyGo-style)
- For normal targets: //export SymbolName uses SymbolName as function name (standard Go)
- Set LLGO_TARGET_BAREMETAL=1 in internal/build/build.go when baremetal tag present
- Added test for normal targets in _demo/normal/export/
- Added CI test to verify both embedded and normal target behavior
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Implements support for TinyGo-style //export directive that allows
exporting functions with symbol names different from the Go function name.
This is essential for embedded development where hardware specifications
require specific symbol names (e.g., ARM Cortex-M interrupt handlers like
LPSPI2_IRQHandler, SysTick_Handler).
Changes:
- Modified cl/import.go to support two export formats:
1. //export ExportName (TinyGo-style, export name can differ from function name)
2. //export FuncName ExportName (Go-style, explicit function and export names)
- Added test case in _demo/embedded/export_test/ with nm verification
Example usage:
//export LPSPI2_IRQHandler
func interruptLPSPI2() {
// exported as LPSPI2_IRQHandler
}
Fixes#1378🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>