Treat linker warnings as error on Windows |
|||||||||
Issue descriptionWe keep having instances of LNK4217 creep into the build. Bug 654776 is one of several issues I've seen in the past few months about this; I just reported another one in bug 606766 comment 37. We should prevent these from creeping in by making LNK4217 an error, so the bots will break if people try to check this in.
,
Oct 25 2016
Is it feasible to fix or work around the benign warnings on the official builders? Otherwise /IGNORE sounds like the right way to go (I'd rather not only turn on /WX for component builds, that seems more confusing).
,
Oct 25 2016
The benign official warnings happen when the linker is started without /LTCG and encounters some LTCG object files, or when it is started with /LTCG and doesn't encounter any LTCG object files. This is designed for a world where LTCG is an all-or-nothing decision, and for Chrome it is an infinitely messy web of tradeoffs (build-times versus performance) and bug workarounds. So, maybe I'm too pessimistic, but my inclination would be to /IGNORE those warnings and then /WX.
,
Dec 16 2016
,
Dec 19 2016
Re #3: I have a simple patch which adds "/WX". As things stand: - Component builds will fail due to LNK4217 (locally defined symbol imported in function). - Release builds will fail due to LNK4075 (ignoring '/INCREMENTAL' due to '/OPT:ICF'. - Official builds log the LTCG message but nonetheless succeed - the LTCG messages are not in fact warnings.
,
Dec 19 2016
,
Dec 19 2016
,
Dec 19 2016
I think you should try to land your patch with exclusions - subtract the config for the two scenarios you mention where it causes failures. Those two bugs are linked to this one so when they are fixed the exclusions can be removed. The exclusions should be as specific as possible so that new warnings avoid being introduced.
,
Dec 20 2016
,
Dec 20 2016
,
Dec 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f6aa9ef3cd873f0cb097e3621f262c72a3876c7d commit f6aa9ef3cd873f0cb097e3621f262c72a3876c7d Author: wez <wez@chromium.org> Date: Thu Dec 22 21:46:17 2016 Fix conditional for /OPT:ICF so Debug non-component build does not warn. The condition under which /OPT:ICF was enabled was out-of-sync with the conditions for enabling incremental linking. Since the two are not compatible the difference resulted in linker warnings in Debug non-component builds. BUG= 621236 , 659007 Review-Url: https://codereview.chromium.org/2594153002 Cr-Commit-Position: refs/heads/master@{#440514} [modify] https://crrev.com/f6aa9ef3cd873f0cb097e3621f262c72a3876c7d/build/config/compiler/BUILD.gn
,
Dec 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c868aae8f9b8d51461afff79064c75339e6ce30c commit c868aae8f9b8d51461afff79064c75339e6ce30c Author: wez <wez@chromium.org> Date: Fri Dec 23 08:09:04 2016 Use the /WX flag to have link warnings treated as errors. Link steps with warnings typically lead to working binaries, but warnings can indicate dependency issues in the codebase, slow down builds, and otherwise just make it harder to find more relevant output in build logs. This CL also adds exceptions to ignore certain linker warnings under specific configurations and targets. BUG= 659007 , 676418 , 676417, 654776 Review-Url: https://codereview.chromium.org/2581893002 Cr-Commit-Position: refs/heads/master@{#440600} [modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/build/config/compiler/BUILD.gn [modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/build/config/win/BUILD.gn [modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/media/BUILD.gn [modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/media/mojo/BUILD.gn [modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/media/mojo/services/BUILD.gn [modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/third_party/WebKit/Source/platform/BUILD.gn
,
Dec 23 2016
\o/
,
Dec 23 2016
,
Dec 23 2016
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by brucedaw...@chromium.org
, Oct 25 2016