Skip to content
Permalink
Browse files
2010-03-04 Simon Fraser <simon.fraser@apple.com>
        Build fix: add exceptions to the check-for-global-initializers script
        for FocusController and SpatialNavigation, and improve the script
        to actually print out the globals found.

        * Scripts/check-for-global-initializers:

Canonical link: https://commits.webkit.org/46850@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Mar 4, 2010
1 parent 44598e4 commit 7455e9fea1328ef66be61cf66f6e25e5500f2abe
Showing 2 changed files with 34 additions and 1 deletion.
@@ -1,3 +1,11 @@
2010-03-04 Simon Fraser <simon.fraser@apple.com>

Build fix: add exceptions to the check-for-global-initializers script
for FocusController and SpatialNavigation, and improve the script
to actually print out the globals found.

* Scripts/check-for-global-initializers:

2010-03-04 Dirk Pranke <dpranke@chromium.org>

Reviewed by Dimitri Glazkov.
@@ -37,6 +37,7 @@ use strict;
use File::Basename;

sub touch($);
sub demangle($);

my $arch = $ENV{'CURRENT_ARCH'};
my $configuration = $ENV{'CONFIGURATION'};
@@ -78,9 +79,14 @@ for my $file (sort @files) {
next;
}
my $sawGlobal = 0;
my @globals;
while (<NM>) {
if (/^STDOUT:/) {
$sawGlobal = 1 if /__GLOBAL__I/;
my $line = $_;
if ($line =~ /__GLOBAL__I(.+)$/) {
$sawGlobal = 1;
push(@globals, demangle($1));
}
} else {
print STDERR if $_ ne "nm: no name list\n";
}
@@ -112,6 +118,10 @@ for my $file (sort @files) {
next if $shortName eq "SubresourceLoader.o";
next if $shortName eq "SVGElementInstance.o";
next if $shortName eq "XMLHttpRequest.o";

#FIXME: check to see if these are legit.
next if $shortName eq "FocusController.o";
next if $shortName eq "SpatialNavigation.o";
}
if ($target eq "WebKit") {
next if $shortName eq "HostedNetscapePluginStream.o";
@@ -120,6 +130,7 @@ for my $file (sort @files) {
}

print "ERROR: $shortName has a global initializer in it! ($file)\n";
print "ERROR: @globals\n";
$sawError = 1;
}
}
@@ -138,3 +149,17 @@ sub touch($)
open(TOUCH, ">", $path) or die "$!";
close(TOUCH);
}

sub demangle($)
{
my ($symbol) = @_;
if (!open FILT, "c++filt $symbol |") {
print "ERROR: Could not open c++filt\n";
return;
}
my $result = <FILT>;
close FILT;
chomp $result;
return $result;
}

0 comments on commit 7455e9f

Please sign in to comment.