meson icon indicating copy to clipboard operation
meson copied to clipboard

compilers: Add b_lto and b_pgo support for MSVC

Open mochaaP opened this issue 2 months ago • 2 comments

Todo:

  • Should we add a common BuildOption for COMDAT folding (/Gy/-ffunction-section + /Gw/-fdata-sections for compilers, /OPT:REF/-Wl,--gc-sections/-Wl,-dead_strip + /OPT:{ICF,SAFEICF,NOICF}[^1]/-Wl,--icf={all,safe,none}[^2]/-Wl,-no_deduplicate[^3] for linkers)
  • How can we ensure b_lto is also on if b_pgo is on?
  • What about icl.exe?

[^1]: /OPT:SAFEICF is lld-link only [^2]: ld.gold and ld.lld supports ICF, but not ld.bfd [^3]: newer ld64 that supports ICF have this on by default, and only have an option for disabling it (-no_deduplicate or -O0 will trigger this, see ld64/src/ld/Options.cpp)

mochaaP avatar Dec 08 '25 16:12 mochaaP

What about icl.exe?

Are we talking about the legacy icl.exe that pairs with icc, or one of the oneAPI (LLVM based) compilers? If we're talking the legacy one leave it be. The oneAPI one is based on clang-cl, so we should be able to do whatever clang-cl does.

dcbaker avatar Dec 08 '25 17:12 dcbaker

Are we talking about the legacy icl.exe that pairs with icc, or one of the oneAPI (LLVM based) compilers?

the legacy one. i'm fine with ignoring it.

mochaaP avatar Dec 08 '25 17:12 mochaaP

need integration with vs2010backend.py

mochaaP avatar Feb 04 '26 15:02 mochaaP

Cygwin failure seems very much unrelated.

Do you want to fix the vs backend first or is this ok to merge already?

jpakkane avatar Feb 05 '26 09:02 jpakkane

The lint failure is related.

jpakkane avatar Feb 05 '26 10:02 jpakkane

done

mochaaP avatar Feb 05 '26 22:02 mochaaP