Bug 74365 - [chromium] When building with clang, enable -Wglobal-constructors
Summary: [chromium] When building with clang, enable -Wglobal-constructors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on: 74375
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-12 16:01 PST by Tony Chang
Modified: 2011-12-27 14:04 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.45 KB, patch)
2011-12-12 16:02 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (2.81 KB, patch)
2011-12-12 16:35 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (2.69 KB, patch)
2011-12-20 11:58 PST, Tony Chang
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2011-12-12 16:01:34 PST
[chromium] When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
Comment 1 Tony Chang 2011-12-12 16:02:29 PST
Created attachment 118899 [details]
Patch
Comment 2 Tony Chang 2011-12-12 16:03:24 PST
Builds on my Linux machine, I need to test on Mac before landing.

Related: http://trac.webkit.org/changeset/96881
Comment 3 Nico Weber 2011-12-12 16:09:06 PST
Comment on attachment 118899 [details]
Patch

FWIW, exit time destructors are already enabled by

67            'variables': { 'enable_wexit_time_destructors': 1, },

in WebKit.gyp.

Mac doesn't look at 'cflags', but instead looks at xcode_settings: { 'OTHER_CFLAGS': }, so if you want this to have an effect on the chromium/mac port you'd need that too.

Thanks for doing this!
Comment 4 Tony Chang 2011-12-12 16:35:59 PST
Created attachment 118904 [details]
Patch
Comment 5 Tony Chang 2011-12-12 16:37:01 PST
(In reply to comment #3)
> (From update of attachment 118899 [details])
> Mac doesn't look at 'cflags', but instead looks at xcode_settings: { 'OTHER_CFLAGS': }, so if you want this to have an effect on the chromium/mac port you'd need that too.

I ended up using WARNING_CFLAGS because that's what enable_wexit_time_destructors does.  Let me know if that's the wrong way to do this.
Comment 6 Nico Weber 2011-12-12 16:38:24 PST
Comment on attachment 118904 [details]
Patch

lgtm.
Comment 7 Tony Chang 2011-12-20 11:58:48 PST
Created attachment 120052 [details]
Patch
Comment 8 Tony Chang 2011-12-20 11:59:19 PST
enable_wexit_time_destructors is already enabled everywhere so I removed that from this patch.
Comment 9 Nico Weber 2011-12-20 12:05:42 PST
lgtm, but it's still blocked on sail's patch landing (it's in the commit queue right now).
Comment 10 Tony Chang 2011-12-27 13:50:27 PST
I just tested building Chromium Mac and it passed with this patch.  I verified from the output that -Wglobal-constructors is being passed on the compile line.
Comment 11 Tony Chang 2011-12-27 14:04:29 PST
Committed r103727: <http://trac.webkit.org/changeset/103727>