x/build: overlayFiles for fix math on amd64
This commit is contained in:
@@ -111,6 +111,10 @@ const (
|
||||
loadSyntax = loadTypes | packages.NeedSyntax | packages.NeedTypesInfo
|
||||
)
|
||||
|
||||
var overlayFiles = map[string]string{
|
||||
"math/exp_amd64.go": "package math;",
|
||||
}
|
||||
|
||||
func Do(args []string, conf *Config) {
|
||||
flags, patterns, verbose := ParseArgs(args, buildFlags)
|
||||
cfg := &packages.Config{
|
||||
@@ -119,6 +123,13 @@ func Do(args []string, conf *Config) {
|
||||
Fset: token.NewFileSet(),
|
||||
}
|
||||
|
||||
if len(overlayFiles) > 0 {
|
||||
cfg.Overlay = make(map[string][]byte)
|
||||
for file, src := range overlayFiles {
|
||||
cfg.Overlay[filepath.Join(runtime.GOROOT(), "src", file)] = []byte(src)
|
||||
}
|
||||
}
|
||||
|
||||
llssa.Initialize(llssa.InitAll)
|
||||
if verbose {
|
||||
llssa.SetDebug(llssa.DbgFlagAll)
|
||||
|
||||
Reference in New Issue
Block a user