go: add assembler_flags
field for adding arbitrary extra assembler flags
#17731
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
assembler_flags
field for adding arbitrary extra assembler flags when assembling Go-format assembly files.Note: These flags will not be added to gcc/clang-format assembly that is assembled packages using Cgo.
This field can be specified on several different target types:
On
go_mod
targets, the assembler flags are used when building any package involving the module including both first-party (i.e.,go_package
targets) and third-party dependencies.On
go_binary
targets, the assembler flags are used when building any packages comprising that binary including third-party dependencies. These assembler flags will be added after any assembler flags added by anyassembler_flags
field set on the applicablego_mod
target.On
go_package
targets, the assembler flags are used only for building that specific package and not for any other package. These assembler flags will be added after any assembler flags added by anyassembler_flags
field set on the applicablego_mod
target or applicablego_binary
target.Run
go doc cmd/asm
to see the flags supported bygo tool asm
.Fixes #17441.