cc-rs: build passes invalid `-nologo` and `-out:` flags to `ar` tool if specified in `AR` env var.
Found this here: https://chromium-review.googlesource.com/c/chromium/src/+/4087043/4//COMMIT_MSG#26
The AR env var can override the tool: https://github.com/rust-lang/cc-rs/blob/0e51f6d8a05548bd9991bfd8184b45b77b261a17/src/lib.rs#L2651-L2653
However the flags passed to it include “-nologo” and -out: which then fails with invalid flag.
It seems like if AR is specified in the env var, it shouldn’t assume it can change the arguments based on the target being msvc?
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- Point the `AR` env var to llvm-lib on windows, instead of llvm-ar See the discussion on: https://chromium-review.googlesource.com/c/chromium/src/+/4087043 And the bug: https://github.com/rust-lang/c... — committed to chromium/chromium by danakj 4 years ago
- Point the `AR` env var to llvm-lib on windows, instead of llvm-ar See the discussion on: https://chromium-review.googlesource.com/c/chromium/src/+/4087043 And the bug: https://github.com/rust-lang/c... — committed to oneseer/rust by danakj 4 years ago
https://github.com/rust-lang/cc-rs/pull/763 has also worked to address this issue and should have tagged this probably. Specifically it now allows setting
ARFLAGSto remove the-nologoflag which was not understood by the tool I was attempting to use at the time.