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

Feature request: support setting asm-specific flags #751

Closed
nicholasbishop opened this issue Nov 16, 2022 · 2 comments · Fixed by #752
Closed

Feature request: support setting asm-specific flags #751

nicholasbishop opened this issue Nov 16, 2022 · 2 comments · Fixed by #752

Comments

@nicholasbishop
Copy link
Contributor

Background: clang fails with an error if you pass asm options when compiling a non-asm input. For example:

$ clang -c foo.S -Wa,-defsym,abc=0
(no error!)

$ clang -c foo.c -Wa,-defsym,abc=0
error: unknown argument: '-defsym'

It would be helpful to have a Build::asm_flag method for adding flags specific to compiling assembly. The flags passed in this way would only be added to the command for .S/.asm files.

@thomcc
Copy link
Member

thomcc commented Nov 16, 2022

Patch welcome. I can try to get to it this after thanksgiving if no movement has happened though.

@dot-asm
Copy link
Contributor

dot-asm commented Nov 22, 2022

Formally speaking, one could have used flag_if_supported("-no-integrated-as") in this case. And one can wonder if it would be generally more appropriate. Indeed, since the suggestion is to pass the option to multiple files(*), it implies that the symbol definition is intended to be global. In which case C is formally entitled to refer to it too :-)

(*) And if not, then it would be more appropriate to split the compilation into two and generate pair of libraries for rustc to link with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants