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

Separate source args with -- when compiling assembly with clang-cl #857

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

roblabla
Copy link
Contributor

Currently, when compiling with clang-cl, we separate the source from the arguments by inserting a --. This avoids compilation errors due to conflicts between source paths and arguments (especially on macos, where path will often begin with /Users, but /U is a clang-cl flag).

However, this separator is disabled when we are compiling assembly for msvc targets, as those will usually be compiled through ml.exe, which doesn't understand this separator. Problem is, this is not always the case: Only .asm files are compiled using ml.exe. Any asm using a different extension will still go through the normal C compiler (clang-cl), and hence we need to provide the separator in that case.

Currently, when compiling with clang-cl, we separate the source from
the arguments by inserting a `--`. This avoids compilation errors due
to conflicts between source paths and arguments (especially on macos,
where path will often begin with /Users, but /U is a clang-cl flag).

However, this separator is disabled when we are compiling assembly for
msvc targets, as those will usually be compiled through `ml.exe`, which
doesn't understand this separator. Problem is, this is not always the
case: Only `.asm` files are compiled using `ml.exe`. Any asm using a
different extension will still go through the normal C compiler
(clang-cl), and hence we need to provide the separator in that case.
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.

Yeah, I see. I wish we had tests for this but so it goes.

@thomcc thomcc merged commit 0d082a2 into rust-lang:main Sep 1, 2023
16 checks passed
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.

2 participants