Files
avo/script/bootstrap
Michael McLoughlin f295bde84c pass: ensure frame pointer register is saved (#174)
Currently `avo` uses `BP` as a standard general-purpose register. However, `BP` is used for the frame pointer and should be callee-save. Under some circumstances, the Go assembler will do this automatically, but not always. At the moment `avo` can produce code that clobbers the `BP` register. Since Go 1.16 this code will also fail a new `go vet` check.

This PR provides a (currently sub-optimal) fix for the issue. It introduces an `EnsureBasePointerCalleeSaved` pass which will check if the base pointer is written to by a function, and if so will artificially ensure that the function has a non-zero frame size. This will trigger the Go assembler to automatically save and restore the BP register.

In addition, we update the `asmdecl` tool to `asmvet`, which includes the `framepointer` vet check.

Updates #156
2021-04-18 18:37:56 -07:00

27 lines
694 B
Bash
Executable File

#!/bin/bash -ex
# Standalone version of the assembly checks in go vet.
go install ./internal/cmd/asmvet
# Install golangci-lint
golangci_lint_version='v1.23.6'
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin ${golangci_lint_version}
# Install tools.
tools=(
# embedmd required for documentation generation
github.com/campoy/embedmd
# covertool for merging coverage reports
github.com/dlespiau/covertool
# asmfmt for enforcing assembly style
github.com/klauspost/asmfmt/cmd/asmfmt
# gofumports for stricter formatting
mvdan.cc/gofumpt/gofumports
)
go install -modfile=script/tools.mod "${tools[@]}"