Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go: add assembler_flags field for adding arbitrary extra assembler flags #17731

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Dec 6, 2022

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 any assembler_flags field set on the applicable go_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 any assembler_flags field set on the applicable go_mod target or applicable go_binary target.

Run go doc cmd/asm to see the flags supported by go tool asm.

Fixes #17441.

@tdyas tdyas added backend: Go Go backend-related issues category:new feature labels Dec 6, 2022
@tdyas tdyas requested review from benjyw and Eric-Arellano December 6, 2022 22:40
…flags (pantsbuild#17683)

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 any `assembler_flags` field set on the applicable `go_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 any
`assembler_flags` field set on the applicable `go_mod` target or applicable `go_binary` target.

Run `go doc cmd/asm` to see the flags supported by `go tool asm`.
@tdyas tdyas force-pushed the golang_assembler_flags branch from a7c2d4f to 76870a4 Compare December 7, 2022 20:42
@tdyas tdyas merged commit 427d308 into pantsbuild:main Dec 8, 2022
@tdyas tdyas deleted the golang_assembler_flags branch December 8, 2022 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Go Go backend-related issues category:new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go: support passing arbitrary assembler flags
2 participants