Merge pull request #1384 from luoliwoshang/feature/export-different-names-1378

cl: support //export with different symbol names on embedded targets
This commit is contained in:
xushiwei
2025-11-17 08:10:09 +08:00
committed by GitHub
7 changed files with 395 additions and 9 deletions

View File

@@ -53,6 +53,11 @@ var (
enableDbg bool
enableDbgSyms bool
disableInline bool
// enableExportRename enables //export to use different C symbol names than Go function names.
// This is for TinyGo compatibility when using -target flag for embedded targets.
// Currently, using -target implies TinyGo embedded target mode.
enableExportRename bool
)
// SetDebug sets debug flags.
@@ -73,6 +78,12 @@ func EnableTrace(b bool) {
enableCallTracing = b
}
// EnableExportRename enables or disables //export with different C symbol names.
// This is enabled when using -target flag for TinyGo compatibility.
func EnableExportRename(b bool) {
enableExportRename = b
}
// -----------------------------------------------------------------------------
type instrOrValue interface {