fix: override go/build.defaultContext() to use gc compiler
Fixes #1346 by creating an overlay for go/build/build.go that sets Compiler to "gc" in defaultContext(). This allows user code using go/build package to work with llgo while preserving runtime.Compiler as "llgo" for identification purposes. The overlay replaces the entire go/build/build.go file with a modified version where line 342 changes from 'c.Compiler = runtime.Compiler' to 'c.Compiler = "gc"'. This minimal change ensures go/build recognizes llgo-compiled binaries without requiring changes to user code. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
This commit is contained in:
2073
runtime/_overlay/go/build/build.go
Normal file
2073
runtime/_overlay/go/build/build.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -22,9 +22,13 @@ var testing_testing_go124 string
|
|||||||
//go:embed _overlay/net/textproto/textproto.go
|
//go:embed _overlay/net/textproto/textproto.go
|
||||||
var net_textproto string
|
var net_textproto string
|
||||||
|
|
||||||
|
//go:embed _overlay/go/build/build.go
|
||||||
|
var go_build_build string
|
||||||
|
|
||||||
var OverlayFiles = map[string]string{
|
var OverlayFiles = map[string]string{
|
||||||
"math/exp_amd64.go": "package math;",
|
"math/exp_amd64.go": "package math;",
|
||||||
"go/parser/resolver.go": go_parser_resolver,
|
"go/parser/resolver.go": go_parser_resolver,
|
||||||
|
"go/build/build.go": go_build_build,
|
||||||
"testing/testing.go": testing_testing,
|
"testing/testing.go": testing_testing,
|
||||||
"testing/testing_go123.go": testing_testing_go123,
|
"testing/testing_go123.go": testing_testing_go123,
|
||||||
"testing/testing_go124.go": testing_testing_go124,
|
"testing/testing_go124.go": testing_testing_go124,
|
||||||
|
|||||||
Reference in New Issue
Block a user