lld as ld replacement on Windows (with MinGW)


I couldn’t find a lld specific list so I hope this is the correct place for lld questions.

I would like to build a llvm/clang/libcxx based toolchain for Windows using the MinGW runtime. Since the MinGW runtime kind of expects to be built by gcc I figured the easiest way forward would be to use lld in ld mode. However, it seems that lld cannot produce windows executables while working in “ld mode”.
lld -flavor gnu -m i386pe
error: unsupported emulation 'i386pe’.

Is support for i386pe in ld mode something that is on the road map for lld or should I just give up this route?

In general I would very much appreciate if anyone has any pointers for how to build a llvm/clang/libxx toolchain for Windows using MinGW runtime (the end goal being to have a toolchain free from GNU tools and without the dependency on Visual Studio).


This feature request has raised a few times since last year, and a few patches were proposed, but no progress has been made so far. So we don’t know the answer. As the maintainer of the COFF support of LLD, I’m not against supporting MinGW, but the proposed patches looked a bit too intrusive to me, so they were not merged. If there’s anyone who’s interested in supporting MinGW, I’m happy to help.

Thanks for the information and good to know that patches are welcome. I don’t need it desperately enough (yet) to step up to the challenge.