Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix breaking change with assembler in go1.22
In go1.22, a breaking change to the build system is introduced. https://go-review.googlesource.com/c/go/+/523337 Namely, that the packagename now *must* passed to the assembler, even when generating only the symabis. The go build system has always done this, but Bazel Go rules have not, and this finally breaks in go1.22. Without specifying -p to the assembler, the output symabis file will contain something like: ``` def <unlinkable>.s2Decode ABI0 ``` instead of ``` def github.com/klauspost/compress/s2.s2Decode ABI0 ``` The result is that the compiler will default to using ABIInternal instead of ABI0 if it cannot resolve a match in symabis, which will cause a link failure: ``` Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging github.com/klauspost/compress/s2.Decode: relocation target github.com/klauspost/compress/s2.s2Decode not defined for ABIInternal (but is defined for ABI0) link: error running subcommand external/go_sdk/pkg/tool/darwin_arm64/link: exit status 2 ``` We conservatively only do this for go minor releases later than 1.21.
- Loading branch information