Skip to content

Commit 34ff542

Browse files
committed
MSVC: Build ~35% faster by calling dumpbin just once per directory.
Peifeng Qiu Discussion: https://postgr.es/m/CABmtVJiKXQjast0dQD-8KAtfm8XmyYxo-4Dc7+M+fBr8JRTqkw@mail.gmail.com
1 parent 726cc42 commit 34ff542

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

src/tools/msvc/gendef.pl

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use strict;
22
use warnings;
33
use 5.8.0;
4-
use File::Spec::Functions qw(splitpath catpath);
54
use List::Util qw(max);
65

76
my @def;
@@ -12,17 +11,6 @@
1211
# src/tools/msvc/gendef.pl
1312
#
1413

15-
sub dumpsyms
16-
{
17-
my ($objfile, $symfile) = @_;
18-
my ($symvol, $symdirs, $symbase) = splitpath($symfile);
19-
my $tmpfile = catpath($symvol, $symdirs, "symbols.out");
20-
system("dumpbin /symbols /out:$tmpfile $_ >NUL")
21-
&& die "Could not call dumpbin";
22-
rename($tmpfile, $symfile);
23-
return;
24-
}
25-
2614
# Given a symbol file path, loops over its contents
2715
# and returns a list of symbols of interest as a dictionary
2816
# of 'symbolname' -> symtype, where symtype is:
@@ -177,15 +165,12 @@ sub usage
177165

178166
my %def = ();
179167

180-
while (<$ARGV[0]/*.obj>) ## no critic (RequireGlobFunction);
181-
{
182-
my $objfile = $_;
183-
my $symfile = $objfile;
184-
$symfile =~ s/\.obj$/.sym/i;
185-
dumpsyms($objfile, $symfile);
186-
print ".";
187-
extract_syms($symfile, \%def);
188-
}
168+
my $symfile = "$ARGV[0]/all.sym";
169+
my $tmpfile = "$ARGV[0]/tmp.sym";
170+
system("dumpbin /symbols /out:$tmpfile $ARGV[0]/*.obj >NUL")
171+
&& die "Could not call dumpbin";
172+
rename($tmpfile, $symfile);
173+
extract_syms($symfile, \%def);
189174
print "\n";
190175

191176
writedef($deffile, $platform, \%def);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy