Commit 8dc4747
committed
Fix invocation of assembler for go1.22
In go1.19 through go1.22-devel (as of golang/go@6382893) a series of
changes were made to the way assembly files' symabis are produced.
https://go-review.googlesource.com/c/go/+/523337
Most significantly, the packagename now must be passed to the assembler
via the -p flag, even when generating only the symabis. The go build
system does this, but Bazel Go rules have not, and this finally breaks
in go1.22-devel as the compatibility code is removed.
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.1 parent c009a2b commit 8dc4747
2 files changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| |||
0 commit comments