Index: mkimport =================================================================== RCS file: /cvs/src/src/winsup/cygwin/mkimport,v retrieving revision 1.3 diff -d -u -r1.3 mkimport --- mkimport 18 Apr 2009 17:23:45 -0000 1.3 +++ mkimport 23 Feb 2010 23:25:12 -0000 @@ -3,6 +3,9 @@ use File::Temp qw'tempdir'; use File::Spec; use Getopt::Long; + +$| = 1; + my $dir = tempdir(CLEANUP => 1); my ($ar, $as, $nm, $objcopy, %replace); @@ -18,7 +21,9 @@ my $libdll = shift; my $inpdll = shift; -open my $nm_fd, '-|', $nm, '-Apg', '--defined-only', $inpdll; +my $cmd_nm = "$nm -Apg --defined-only \"$inpdll\""; +print "Reading from $cmd_nm ...\n"; +open my $nm_fd, "$cmd_nm |" or die "E: $0: $cmd_nm:\n$!\n"; my %text = (); my %import = (); my %symfile = (); @@ -36,8 +41,8 @@ my $fn; my $_sym = '_' . $sym; if (!defined($fn = $symfile{$_sym})) { - $fn = "$sym.o"; - $text{$fn} = $_sym; + $fn = "$sym.o"; + $text{$fn} = $_sym; } my $imp_sym = '__imp__' . $replace{$sym}; $import{$fn} = $imp_sym; @@ -47,33 +52,39 @@ my $imp_sym = delete $import{$f}; my $glob_sym = $text{$f}; if (!defined $imp_sym) { - delete $text{$f}; + delete $text{$f}; } elsif ($imp_sym eq '__imp__') { - $text{$f} = 0; + $text{$f} = 0; } else { - $text{$f} = 1; - open my $as_fd, '|-', $as, '-o', "$dir/t-$f", "-"; - print $as_fd <