Skip to content

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
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