mold icon indicating copy to clipboard operation
mold copied to clipboard

Support Windows

Open rui314 opened this issue 3 years ago • 14 comments

We want to support the Windows target by mold 3.0.

rui314 avatar Dec 23 '21 06:12 rui314

Can't wait for this!

r0nsha avatar Jan 24 '22 18:01 r0nsha

+1

aadog avatar Jan 25 '22 01:01 aadog

Guys, stop spamming. All your useless comments are sent to all subscribed people. Just use reactions on the first message.

vrubleg avatar Jan 25 '22 06:01 vrubleg

ok ,i'm sorry

aadog avatar Jan 26 '22 02:01 aadog

In the case of the msys2/mingw environment currently there is this error:

In file included from filepath.cc:1:
mold.h:17:10: fatal error: sys/mman.h: No such file or directory
   17 | #include <sys/mman.h>

3rav avatar Jan 31 '22 07:01 3rav

Is it possible to help on this issue somehow? E.g. port to Cmake or other cross-platform build system, make some logic platform-independent etc.

yuyoyuppe avatar Jul 05 '22 13:07 yuyoyuppe

I don't think there's anything to speed this thing up. I'm busy working on mold/macOS right now, so I don't think I can start working on mold/Windows now. If I can hire a full-time engineer or two to have them fix all known problems of mold/Unix and mold/macOS, I can start working on mold/Windows early on, but for doing that I would have to pay six figure salary for each engineer out of my pocket, so I don't think it's realistic.

rui314 avatar Jul 05 '22 13:07 rui314

Then, please sponsor with donations

aadog avatar Jul 05 '22 14:07 aadog

Please initiate a sponsorship link

aadog avatar Jul 05 '22 14:07 aadog

I believe having a feature roadmap for Windows support with a bulleted list of features could go a long way of attracting open source contributions, since a lot of people are excited about having a fast linker on Windows.

That means doing more PR reviews and issue maintenance for the author though, which could be cumbersome, and I don't want to push a way of work on someone. 🙂

yuyoyuppe avatar Jul 05 '22 14:07 yuyoyuppe

I think a bulleted list of features or an issue tracker-based task management work after I set the foundation of mold/Windows. The core part has to be written by me (or by someone who is good at writing optimized programs and has extremely deep knowledge of the Windows linker) to achieve our performance goal. So what I can do right now is to try to finish up mold/macOS as quickly as possible so that I can start working on mold/Windows.

rui314 avatar Jul 06 '22 03:07 rui314

If the windows version of gold is implemented, can go/cgo achieve a link speed of %100++?

aadog avatar Jul 07 '22 12:07 aadog

I don't want to speculate about speed because mold/Windows is vaporware at the moment. I'll create mold/Windows because I see some opportunity there, and I can only say that I'll do my best.

rui314 avatar Jul 07 '22 13:07 rui314

PE executables are used not only in Windows, but also in EFI (so many operating systems include UNIX-like can use it for boot loader), SanOS, BeOS R4 x86 and others.

X547 avatar Jul 10 '22 08:07 X547

Any news about this? Currently, that's the only mold I have on my windows;

image

I will update this issue when I have an update, so do not ping us.

rui314 avatar Sep 26 '22 08:09 rui314

Do we have any news about MOLD Coming to Windows?

369BG963 avatar Jan 24 '23 07:01 369BG963

I'll support it in the sold linker instead of the mold linker, so I'll close this bug.

https://github.com/bluewhalesystems/sold/issues/8

rui314 avatar Jan 24 '23 07:01 rui314

I'll support it in the sold linker instead of the mold linker, so I'll close this bug.

Too bad. PE linker would be useful for linking EFI executables. Some opensource OSes use PE as native executable format (SanOS for example). BeOS R3 used PE for x86 platform. PE format is not only MS Windows.

X547 avatar Jan 24 '23 20:01 X547

I usually don't jump into these, but these examples are bad, lld already links x86/x64 incredibly fast, I can't see any adantage to these small oses to use Mold.

For big applications I'm super happy if we see a faster linker than lld for the 100mb+ binaries and 500mb+ pdb's. Being paid software is not a problem if it comes with sources (and its own symbols, profiling your linker is necessary from time to time). Hope to see (m/s)old linking x64 soon.

santagada avatar Jan 24 '23 20:01 santagada

Whether it's FOSS or not, someone has to cover the development cost. If users are not paying, it's on the developer. How much is that in this case? I would be able to earn hundreds of thousands or maybe more than a million USD in total if I'd work for a company instead of developing mold/Windows for free. In other words, it would cost me 6 to 7 figures in terms of opportunity cost. I'm happy to donate thousands of dollars a year to open source communities (which is what I'm currently doing through GitHub Sponsors), but this case is literally orders of magnitude larger than that.

I also want to point out that the situation that development tool developers cannot make big money by creating new better tools makes the industry stagnated. I disrupted it twice with lld and mold and showed that a 10x performance improvement is doable. Why can I build such better tools? It's not only because I'm good at writing high-performance programs, but it's mostly because no one else seriously considered to try to do that. There are many more areas we can make a significant improvement, but for example I can't hire engineers to let them work on it because I wouldn't be able to get a return from that investment. I believe the lack of economical incentive to create better tools is a serious problem here.

Being said that, I've already wrote lld for Windows (that's my first liner) while I was working for Google, and that's much faster than MSVC's linker. It's also cross-platform; you can build EFI executable with it. If you are not happy with sold, you can always use lld.

rui314 avatar Jan 24 '23 23:01 rui314

I'm with @rui314 , although as an individual developer I want to spend as less money as possible, but he is using his professional skill and personal time to create such creative and valuable product, this great effort is surely worthy to be paid. I don't think anyone has the right to make decisions for mold than rui himself.

wangwenx190 avatar Jan 25 '23 00:01 wangwenx190

@rui314 Are you able to work on sold in full time thanks to the society ?

glcraft avatar Jan 25 '23 09:01 glcraft

Sorry, I don't get what you mean. What do you mean by society?

rui314 avatar Jan 25 '23 11:01 rui314

oops I'm sorry, I reword: because sold is commercial and as I saw, payable, can you work on sold (or mold) in full time?

glcraft avatar Jan 26 '23 20:01 glcraft

I don't know, let's see how it works.

I'll lock the conversation as this issue is no longer relevant.

rui314 avatar Jan 26 '23 21:01 rui314