llvm-mingw icon indicating copy to clipboard operation
llvm-mingw copied to clipboard

`$arch-w64-mingw32-windmc` is missing

Open ggardet opened this issue 5 years ago • 15 comments

We are missing $arch-w64-mingw32-windmc.

Maybe just a wrapper thing?

ggardet avatar Jun 18 '20 08:06 ggardet

I'm not familiar with the windmc tool and whether there's anything corresponding among the LLVM tools. (We don't build binutils at all here, as binutils generally don't support windows on arm/aarch64 anyway.)

If there exists a corresponding LLVM tool, it should be enough to install it with a wrapper (like the windres one) for adapting the command line parameter syntax. If there doesn't exist a corresponding tool in LLVM, one has to write it first.

mstorsjo avatar Jun 18 '20 08:06 mstorsjo

windmc is a replacement for microsofts message compiler mc.exe i dont think clang has anything similar as llvm-mc.exe seems to be a machine code parser. mc or windmc is used for linking in manifests and other message related stuff mc.exe related documentation here -> https://docs.microsoft.com/en-us/windows/win32/wes/message-compiler--mc-exe- and windmc here -> https://linux.die.net/man/1/windmc wine also has one called wmc https://www.systutorials.com/docs/linux/man/1-wmc/

Could maybe just get the code for windmc out of binutils to create a local one as it des not seem to specifically rely on gcc.

revelator avatar Jul 14 '20 07:07 revelator

Most binutils tools don't rely on gcc itself, but they rely on libbfd which is the internal library of binutils - so it's not so straightforward to just extract windmc out of it. Wine's wmc might actually be easier to use standalone.

Earlier I used binutils objcopy/strip (before llvm-objcopy supported COFF), with a huge hack that masqueraded arm binaries as x86 before calling the binutils tools as binutils doesn't support arm on windows, but the operation of those tools didn't rely on any architecture specific bits, and then restored the right architecture type afterwards.

It would be easier to look into this if there'd be a smallish project that relies on using binutils' windmc, that one can test building, to see that a drop-in replacement of the tool works as intended.

mstorsjo avatar Jul 14 '20 07:07 mstorsjo

Hmm aye it relies on bfd atleast from what i can glean. wines wmc might actually be better in that case.

revelator avatar Jul 15 '20 04:07 revelator

Well allthough it is not directly stated wines wmc does seem to have a dependency on getopt and gettext.

revelator avatar Jul 15 '20 04:07 revelator

Any news on this? Can I just copy all the files missing from llvm-mingw from other mingw-w64 builds? Will it work?

wangwenx190 avatar Jul 15 '21 09:07 wangwenx190

Any news on this? Can I just copy all the files missing from llvm-mingw from other mingw-w64 builds? Will it work?

It presumably would work yes.

But to make any sort of progress whatsoever, I'd at least need a small minimal example of a project that uses the tool, so that it contains example input files, build files (makefiles etc) that should how the tool is invoked to build those files, and a working app so that one can verify that whatever the tool produces actually works.

@jeremyd2019 - Are there any projects in msys2 mingw-packages where you'd run into the issue of windmc missing?

(And even with an example of using it, I'm not sure if the llvm ecosystem has anything corresponding to it, so it might require someone to actually reimplement it from scratch, unless there's some component that can be reused.)

mstorsjo avatar Jul 15 '21 10:07 mstorsjo

I have not seen anything fail for lack of windmc. I thought I have seen things using it though. It may have been silently using windmc from msys2, and just working.

jeremyd2019 avatar Jul 17 '21 22:07 jeremyd2019

The only usage I remember seeing was https://github.com/msys2-contrib/cpython-mingw/commit/4f1841b7211dd4d9557a868525b5005e4d67e55e

jeremyd2019 avatar Jul 17 '21 22:07 jeremyd2019

Here's a usage I just came across where the project just shipped the output of Microsoft's MC because they couldn't find windmc (maybe it didn't exist yet?)

https://github.com/postgres/postgres/blob/master/src/bin/pgevent/README

jeremyd2019 avatar Jul 18 '21 23:07 jeremyd2019

Here's a package that's failing due to lack of windmc: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-devcon-git/PKGBUILD

Unfortunately it doesn't have makefiles, it's a Microsoft sample being built by the PKGBUILD script directly.

jeremyd2019 avatar Aug 01 '21 19:08 jeremyd2019

Here's another... https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-poco/011-cmake-mingw.patch#L18

jeremyd2019 avatar Aug 08 '21 00:08 jeremyd2019

aye and poco even builds no problem if windmc is present.

revelator avatar Aug 08 '21 04:08 revelator

Build ReactOS needs this windmc

wangwenx190 avatar Aug 17 '21 01:08 wangwenx190

somebody finally got pywin32 building on mingw-w64 again, but it's failing with clang because of lack of windmc. https://github.com/msys2/MINGW-packages/pull/9750#issuecomment-939561761

jeremyd2019 avatar Oct 11 '21 19:10 jeremyd2019