reactos/sdk/cmake
Joachim Henze d3687ed881 [0.4.11][CMAKE] Fix 9 MSVC2010SP1 x86 dbg warnings LNK4221 CORE-18104 CORE-14373
by always unconditionally enabling "String Pooling" /GF

Pros:
- consistency between the toolchains, as GCC always has this enabled
- shrinks the binary sizes for MSVC dbg builds
- smaller binaries will also make relocations less probable with MSVC dbg and a given set of (often outdated) precalculated base-addresses
- interestingly it also fixes/hides some linker warnings LNK4221

which can be observed with MSVC 2010SP1 (16.0.40219.1) x86 target in dbg configuration, here example from releases/0.4.7:
[819/11751] Linking C static library dll\opengl\mesa\main\mesa_main.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[830/11751] Linking C static library dll\opengl\mesa\math\mesa_math.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[858/11751] Linking C static library dll\opengl\mesa\swrast\mesa_swrast.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[879/11751] Linking C static library dll\opengl\mesa\tnl\mesa_tnl.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[897/11751] Linking C static library dll\opengl\mesa\vbo\mesa_vbo.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[1602/11751] Linking C static library sdk\lib\3rdparty\adns\adns.lib
internal.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[4327/11751] Linking C static library sdk\lib\tdilib\tdilib.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[11714/11751] Linking C static library win32ss\user\winsrv\consrv.lib
consrv.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

[11726/11751] Linking C static library win32ss\user\winsrv\concfg\concfg.lib
precomp.h.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

It manages to make all the mentioned 9 LNK4221 disappear without introducing any other warnings into those modules, or into any other module.
Ftr I do not understand why String Pooling hides those LNK4221. But its effectiveness is evident.
But some other LNK4221 in other modules do still remain after it. Their count is not 0 afterwards, just significantly reduced.

Cons:
- String Pooling may slightly increase the build time, but the impact is negligible, even on my 12 year-old PC.
- String Pooling may make lousy code crash, that illegally wants to write into string constants, like we saw it for ROSTESTS298 for example.
  But that is actually not a bad thing. That test was also broken beforehand and crashed even on real Windows.
  We didn't find any similar problems within the 'productive code' yet.

fix is a partial pick of:
0.4.12-dev-354-g 5e673f3118
and its addendum
0.4.12-dev-655-g 237110604b [CMAKE] msvc.cmake: Remove 2 now redundant '/GF' (#1239)
2022-03-31 18:27:23 +02:00
..
Compiler CORE-14513 [CMAKE] Remove modules that are shipped with cmake (#575) 2018-08-19 22:01:31 +02:00
baseaddress.cmake [SDK] Update baseaddresses 2018-10-25 06:59:45 +02:00
baseaddress_dwarf.cmake [SDK] Update baseaddresses 2018-10-25 06:59:45 +02:00
baseaddress_msvc.cmake [SDK] Update baseaddresses 2018-10-25 06:59:45 +02:00
bison-flex.cmake Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
CMakeMacros.cmake [0.4.11][CMAKE][BOOTDATA] Fix LiveCD does not import caroots.inf into registry CORE-17739 CORE-17735 (#3930) 2022-01-21 23:10:28 +01:00
compilerflags.cmake Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
config-amd64.cmake Replace our dxtn.dll by a version based on the libtxc_dxtn source code (#203) 2017-12-20 11:15:13 +01:00
config-arm.cmake Replace our dxtn.dll by a version based on the libtxc_dxtn source code (#203) 2017-12-20 11:15:13 +01:00
config.cmake Replace our dxtn.dll by a version based on the libtxc_dxtn source code (#203) 2017-12-20 11:15:13 +01:00
gcc.cmake [0.4.11][NTOSKRNL] Restore section layout for NTOSKRNL to fix BSOD regression CORE-14683 2020-10-31 16:31:41 +01:00
host-tools.cmake [CLANG-CL] Initial commit that allows us to compile ReactOS with clang-cl. 2017-11-23 14:09:57 +01:00
init-section.lds [0.4.11][NTOSKRNL] Restore section layout for NTOSKRNL to fix BSOD regression CORE-14683 2020-10-31 16:31:41 +01:00
localization.cmake Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
midl-support.cmake Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
msvc.cmake [0.4.11][CMAKE] Fix 9 MSVC2010SP1 x86 dbg warnings LNK4221 CORE-18104 CORE-14373 2022-03-31 18:27:23 +02:00
widl-support.cmake [CMAKE/WIDL] Add rudimentary dependency tracking in add_rpcproxy_files 2018-01-20 15:46:25 +01:00
writing_CmakeLists_for_ReactOS.txt Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00