Remove the LTCG warnings in the GN builds |
||||
Issue descriptionWe're encountering 2 kind of warnings when doing an Official GN build on Windows: - MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance - /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance We're always using the "/LTCG" linker flag for these builds, so the first problem is that some static libraries get build without it, despite the fact that most of their object have been compiled with /GL, lib.exe realizes this and restarts. It's relatively easy to fix this by adding the LTCG flag to the arflags. The second one is caused by the fact that we're always using the "/LTCG" linker flag for the Official builds. We could probably fix this by moving this flag to the 'optimize_max' config (which enable /GL), but this also cause some problems if a static library gets compiled with this config, but the module including it doesn't. e.g. chrome_elf.dll doesn't use the 'optimize_max' config but it links against base_static.lib which requires LTCG... This results in the following warning: [GL_PGO]E:\src\chrome\src>ninja -C out\ReleaseGN chrome_elf ninja: Entering directory `out\ReleaseGN' [1/1] LINK(DLL) chrome_elf.dll chrome_elf.dll.lib base_static.lib(pe_image.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance Ideally the solution should be "If one of the static libraries that you're using has some arflags defined, then you should pass them to your ldflags", but I'm not sure that there's a way to do this ? We could also just try to *reduce* the number of warnings, not remove them all.
,
Apr 29 2016
That's what I was planning to do. Now I'm just waiting for the fix that adds |arflags| to GN to stick before doing this.
,
Jul 14 2016
,
Jul 14 2016
The arflags fix landed a while ago ...
,
Jul 14 2016
Yep, I've used it in https://codereview.chromium.org/2018293002/diff/160001/build/config/compiler/BUILD.gn , there's still a few warnings but it's not as bad as it used to be.
,
Aug 10 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by brucedaw...@chromium.org
, Apr 29 2016