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

Add Build::asm_flag #752

Merged
merged 1 commit into from Nov 17, 2022
Merged

Conversation

nicholasbishop
Copy link
Contributor

The method allows flags to be specified that are only applied to assembly input files, not C files. This is helpful with clang, which only accepts certain assembly options if the input file is asm, not C.

Closes #751

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

src/lib.rs Outdated
fn is_asm(file: &Path) -> bool {
if let Some(ext) = file.extension() {
let ext = ext.to_ascii_lowercase();
ext == "asm" || ext == "s"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably will need some adjustment over time, but I don't see anything it's concretely missing now.

@thomcc
Copy link
Member

thomcc commented Nov 17, 2022

Ah, there's no to_ascii_lowercase on OsStr back then, that will need to be fixed.

The method allows flags to be specified that are only applied to
assembly input files, not C files. This is helpful with clang, which
only accepts certain assembly options if the input file is asm, not C.
@nicholasbishop
Copy link
Contributor Author

nicholasbishop commented Nov 17, 2022

I changed the test to disable it if the parallel feature is enabled since the execution order seems to not be deterministic -- is that solution OK?

@thomcc
Copy link
Member

thomcc commented Nov 17, 2022

Yeah that's fine.

@thomcc thomcc merged commit 4008959 into rust-lang:main Nov 17, 2022
@thomcc
Copy link
Member

thomcc commented Nov 17, 2022

I'll try to cut a release with this and some other changes this weekend. (CC @Mark-Simulacrum)

@nicholasbishop nicholasbishop deleted the bishop-asm-flags branch November 17, 2022 01:54
@nicholasbishop
Copy link
Contributor Author

Great, thanks for the quick review :)

@thomcc
Copy link
Member

thomcc commented Nov 20, 2022

This is in 1.0.77.

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 this pull request may close these issues.

Feature request: support setting asm-specific flags
2 participants