Bug 22314 - Adopt check-for-global-initializers on Windows
Summary: Adopt check-for-global-initializers on Windows
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-17 09:13 PST by Adam Roben (:aroben)
Modified: 2016-07-28 12:58 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2008-11-17 09:13:35 PST
It would be good to adopt the check-for-global-initializers script on Windows. I've done a little investigation into what would have to change in the script to make it work on Windows. Here's what I've come up with (based on <http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/check-for-global-initializers?rev=38440>):

1. Use of Xcode-specific environment variables

We can either set similar variables on Windows or pass the relevant values as parameters.

2. Use of a "link file list"

We can get the list of object files linked into the executable by using "dumpbin.exe /archivemembers".

3. Searching for "__GLOBAL__I" to indicate a global initializer

On Windows, global initializers are indicated by "symbol$initializer$", where "symbol" is the symbol being initialized.

4. List of files to skip uses .o extension

On Windows, these files have a .obj extension. We could just use the part of the filename before the extension instead.
Comment 1 Adam Roben (:aroben) 2008-11-17 09:17:04 PST
See bug 22315 about adopting check-for-exit-time-destructors as well.
Comment 2 David Kilzer (:ddkilzer) 2016-07-28 12:58:32 PDT
NOTE: Bug 160302 is going to remove these scripts.

However, I think the scripts would have had to use different tools to make them work on Windows.  (Maybe MSVC++ has a switch similar to -Wglobal-constructors instead?)