Extremely long linking time on windows but not Linux

I have a program that on Linux compiles and links in about 15 minutes from scratch, and then takes about 1 minute to compile on subsequent rebuilds.

The exact same program is taking hours to link on windows. The compilation step is the same, but it just gets hanged on the linking step for a really long time.

Is there a way to profile what is bottlenecking compilation?

I am trying to compile on Win10 using meson as the build system and VS through the command line as the compiler and cl as the linker.


Solution 1:

I don't think it's possible to profile but you can normally significantly speed up link via /incremental and /debug:fastlink flags.