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: support passing arbitrary assembler flags #17441

Closed
Tracked by #17447
tdyas opened this issue Nov 2, 2022 · 0 comments · Fixed by #17731
Closed
Tracked by #17447

go: support passing arbitrary assembler flags #17441

tdyas opened this issue Nov 2, 2022 · 0 comments · Fixed by #17731
Labels
backend: Go Go backend-related issues

Comments

@tdyas
Copy link
Contributor

tdyas commented Nov 2, 2022

go supports passing arbitrary assembler flags to go tool asm invocations via a -asmflags argument. Pants should support this feature.

Model as fields on go_binary and go_package (for tests) that set additional assembler flags to use with defaults coming from option(s).

@tdyas tdyas added the backend: Go Go backend-related issues label Nov 2, 2022
tdyas added a commit that referenced this issue Dec 8, 2022
…flags (#17731)

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.
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant