Skip to content

Commit

Permalink
go-fuzz-build: copy abi_arm64.h
Browse files Browse the repository at this point in the history
Fixes #348
  • Loading branch information
josharian committed Oct 19, 2023
1 parent 6a27b0a commit a92a875
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions go-fuzz-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,11 @@ func (c *Context) populateWorkdir() {
// Cross-compilation is not implemented.
c.copyDir(filepath.Join(c.GOROOT, "pkg", runtime.GOOS+"_"+runtime.GOARCH), filepath.Join(c.workdir, "goroot", "pkg", runtime.GOOS+"_"+runtime.GOARCH))
}
// go1.17 added abi_amd64.h
if _, err := os.Stat(filepath.Join(c.GOROOT, "src", "runtime", "cgo", "abi_amd64.h")); err == nil {
c.mkdirAll(filepath.Join(c.workdir, "goroot", "src", "runtime", "cgo"))
c.copyFile(filepath.Join(c.GOROOT, "src", "runtime", "cgo", "abi_amd64.h"), filepath.Join(c.workdir, "goroot", "src", "runtime", "cgo", "abi_amd64.h"))
for _, h := range []string{"abi_amd64.h", "abi_arm64.h"} {
if _, err := os.Stat(filepath.Join(c.GOROOT, "src", "runtime", "cgo", h)); err == nil {
c.mkdirAll(filepath.Join(c.workdir, "goroot", "src", "runtime", "cgo"))
c.copyFile(filepath.Join(c.GOROOT, "src", "runtime", "cgo", h), filepath.Join(c.workdir, "goroot", "src", "runtime", "cgo", h))
}
}

// Clone our package, go-fuzz-deps, and all dependencies.
Expand Down

0 comments on commit a92a875

Please sign in to comment.