RESOLVED FIXED77300
[chromium] enable -Wexit-time-destructors for webkit unit tests
https://bugs.webkit.org/show_bug.cgi?id=77300
Summary [chromium] enable -Wexit-time-destructors for webkit unit tests
Ami Fischman
Reported 2012-01-29 10:35:55 PST
Pacify clang shared_library build by leaking a global static.
Attachments
Patch (1.38 KB, patch)
2012-01-29 10:36 PST, Ami Fischman
no flags
Patch (1.97 KB, patch)
2012-01-29 15:26 PST, Ami Fischman
no flags
Patch (2.27 KB, patch)
2012-01-30 09:51 PST, Ami Fischman
no flags
Patch for landing (1.29 KB, patch)
2012-01-30 10:41 PST, Tony Chang
no flags
Patch (2.45 KB, patch)
2012-01-31 15:34 PST, Ami Fischman
no flags
Ami Fischman
Comment 1 2012-01-29 10:36:38 PST
Ami Fischman
Comment 2 2012-01-29 10:39:47 PST
FTR, this change enables me to build targets: chrome test_shell_tests webkit_unit_tests DumpRenderTree with set|grep ^GYP: GYP_DEFINES='disable_nacl=1 enable_svg=0 proprietary_codecs=1 ffmpeg_branding=ChromeOS component=shared_library clang=1 clang_use_chrome_plugins=1' GYP_GENERATORS=ninja GYP_GENERATOR_FLAGS='output_dir=ninja config=Debug'
Ami Fischman
Comment 3 2012-01-29 15:26:30 PST
Ami Fischman
Comment 4 2012-01-29 15:28:22 PST
Nico pointed out new usages of exit-time dtors in tests will break the clang/shared build, which will likely be invisible to non-shared/non-clang builders. Updated patch includes the exit-time-dtors warnings for the webkit_unit_tests target for even non-shared builds, since it's clean now this should help keep it clean.
Tony Chang
Comment 5 2012-01-30 09:45:20 PST
Comment on attachment 124473 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=124473&action=review > Source/WebKit/chromium/tests/TextureManagerTest.cpp:42 > -FakeTextureAllocator fakeTextureAllocator; > +DEFINE_STATIC_LOCAL(FakeTextureAllocator, fakeTextureAllocator, ()); Can we move this into the requestTexture function? That appears to be the only place it's used.
Ami Fischman
Comment 6 2012-01-30 09:51:22 PST
Ami Fischman
Comment 7 2012-01-30 09:51:47 PST
(In reply to comment #5) > (From update of attachment 124473 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=124473&action=review > > > Source/WebKit/chromium/tests/TextureManagerTest.cpp:42 > > -FakeTextureAllocator fakeTextureAllocator; > > +DEFINE_STATIC_LOCAL(FakeTextureAllocator, fakeTextureAllocator, ()); > > Can we move this into the requestTexture function? That appears to be the only place it's used. Done.
Tony Chang
Comment 8 2012-01-30 10:36:01 PST
Comment on attachment 124564 [details] Patch The patch doesn't apply. I'll rebase to tip-of-tree and cq+ for you.
Tony Chang
Comment 9 2012-01-30 10:38:25 PST
(In reply to comment #8) > (From update of attachment 124564 [details]) > The patch doesn't apply. I'll rebase to tip-of-tree and cq+ for you. Looks like it was fixed in https://bugs.webkit.org/show_bug.cgi?id=77333. I'll just land the gyp change.
Tony Chang
Comment 10 2012-01-30 10:41:48 PST
Created attachment 124570 [details] Patch for landing
WebKit Review Bot
Comment 11 2012-01-30 11:07:14 PST
Comment on attachment 124570 [details] Patch for landing Clearing flags on attachment: 124570 Committed r106259: <http://trac.webkit.org/changeset/106259>
WebKit Review Bot
Comment 12 2012-01-30 11:07:19 PST
All reviewed patches have been landed. Closing bug.
Levi Weintraub
Comment 13 2012-01-30 18:10:34 PST
I'm afraid this breaks the build when we include webkittests as we do in the shared builders. See build output here: http://build.chromium.org/p/chromium/builders/Linux%20Clang%20%28dbg%29/builds/19648/steps/compile/logs/stdio I think this should be rolled back and re-opened pending a fix to webkittests or the build config (so WebKit isn't dependent on webkittests).
Levi Weintraub
Comment 14 2012-01-30 18:25:14 PST
Re-opening as I rolled this out in r106313.
Ami Fischman
Comment 15 2012-01-30 20:20:43 PST
How strange. The gyp target webkit_unit_tests built fine for me, which is why this seemed like a safe change. Tony/Nico/Levi: any ideas why find ninja/Debug/ -iname '*.ninja'|xargs grep FrameTestHelpers finds nothing in my chromium checkout? I.e. FrameTestHelpers.cpp doesn't seem to be referenced by any .ninja files, even though it is in webkit_unittest_files in third_party/WebKit/Source/WebKit/chromium/WebKit.gypi
Tony Chang
Comment 16 2012-01-31 12:17:15 PST
(In reply to comment #15) > How strange. The gyp target webkit_unit_tests built fine for me, which is why this seemed like a safe change. > > Tony/Nico/Levi: any ideas why > find ninja/Debug/ -iname '*.ninja'|xargs grep FrameTestHelpers According to WebKit.gyp, we don't compile FrameTestHelpers.cpp when using a components build. This warning is only triggered when using clang + static build.
Ami Fischman
Comment 17 2012-01-31 12:21:38 PST
(In reply to comment #16) > (In reply to comment #15) > > How strange. The gyp target webkit_unit_tests built fine for me, which is why this seemed like a safe change. > > > > Tony/Nico/Levi: any ideas why > > find ninja/Debug/ -iname '*.ninja'|xargs grep FrameTestHelpers > > According to WebKit.gyp, we don't compile FrameTestHelpers.cpp when using a components build. This warning is only triggered when using clang + static build. But that's only for the "webkit" target, right? Why is FTH.cpp not included in the "webkit_unit_tests" target?
Tony Chang
Comment 18 2012-01-31 13:22:33 PST
(In reply to comment #17) > But that's only for the "webkit" target, right? > Why is FTH.cpp not included in the "webkit_unit_tests" target? In WebKitUnitTests.gyp, it says: ['inside_chromium_build==1 and component=="shared_library"', { 'defines': [ 'WEBKIT_DLL_UNITTEST', ], }, { 'sources': [ '<@(webkit_unittest_files)', ], FrameTestHelpers.cpp will be compiled if you're not building a shared library. Does the clang error repro for you if you disable the shared build?
Ami Fischman
Comment 19 2012-01-31 15:34:48 PST
Ami Fischman
Comment 20 2012-01-31 15:35:55 PST
(In reply to comment #18) > Does the clang error repro for you if you disable the shared build? D'oh! I was looking at a version of the file in which I was trying to rip out the craxy that is the webkit-target-includes-test-files-but-only-in-shared-builds and forgot ToT still has the conditional. Verified that the latest patch builds in static build.
Tony Chang
Comment 21 2012-01-31 15:39:04 PST
Comment on attachment 124835 [details] Patch FYI: Levi here's another attempt at enabling -Wexit-time-destructors. It probably isn't tested by any of the canary bots so if this fails on the Chromium waterfall, feel free to revert.
Levi Weintraub
Comment 22 2012-01-31 15:49:32 PST
Throwing the current WebKit Sheriff on the thread.
WebKit Review Bot
Comment 23 2012-01-31 15:55:54 PST
Comment on attachment 124835 [details] Patch Clearing flags on attachment: 124835 Committed r106410: <http://trac.webkit.org/changeset/106410>
WebKit Review Bot
Comment 24 2012-01-31 15:56:01 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.