Skip to content

Commit

Permalink
x/build: fix build math on amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Jun 20, 2024
1 parent 34fe3ca commit 8e2d901
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const (
loadSyntax = loadTypes | packages.NeedSyntax | packages.NeedTypesInfo
)

var skipPkgFiles = map[string]string{
"math/exp_amd64.go": "math",
}

func Do(args []string, conf *Config) {
flags, patterns, verbose := ParseArgs(args, buildFlags)
cfg := &packages.Config{
Expand All @@ -119,6 +123,13 @@ func Do(args []string, conf *Config) {
Fset: token.NewFileSet(),
}

if len(skipPkgFiles) > 0 {
cfg.Overlay = make(map[string][]byte)
for file, pkg := range skipPkgFiles {
cfg.Overlay[filepath.Join(runtime.GOROOT(), "src", file)] = []byte("package " + pkg)
}
}

llssa.Initialize(llssa.InitAll)
if verbose {
llssa.SetDebug(llssa.DbgFlagAll)
Expand Down

0 comments on commit 8e2d901

Please sign in to comment.