--emit=obj for Windows msvc producing .o instead of .obj

f86240e
Opened by Peter Atashian at 2023-09-14 04:25:11
rustc 1.14.0-nightly (19ac57926 2016-10-08)
binary: rustc
commit-hash: 19ac57926abb749a93e2eb84502048d9c57f2d7b
commit-date: 2016-10-08
host: x86_64-pc-windows-msvc
release: 1.14.0-nightly

Doing rustc --emit=obj foo.rs results in foo.o instead of the expected foo.obj.

TODO:

  • [ ] Investigate what automation or tools out there rely on --emit=obj using the .o extension and work with the pc-windows-msvc targets.

  • [ ] Investigate the feasibility of adjusting such automation or tools to support the .obj extension instead for pc-windows-msvc.

  • [ ] Add a obj_suffix to the target options and set it to obj only for pc-windows-msvc targets.

  • [ ] Adjust the aforementioned automation and tools and post something in the release notes.

Note that because MSVC is such a different target than GNU targets, any sort of automation or tooling that specifically needs object files would already be quite conditional on MSVC being different to invoke the linker correctly and such. Therefore I am of the opinion that the fallout from this change should be minimal and very easy to fix. If anyone can find any examples that prove me wrong, please do so.

Places to search for potential automation or tools: https://github.com/search?utf8=%E2%9C%93&q=--emit+obj&type=Code&ref=searchresults

  1. Triage: Still reproduces on latest nightly.

    Martin Nordholts at 2023-09-14 04:24:54