Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-04-12 07:19:52 +0400
committerChristopher Faylor <me@cgf.cx>2009-04-12 07:19:52 +0400
commitedd090a2704aaf538c41cc97619c1d473b4916b2 (patch)
tree844ddc3a55e17cffac03a1342e30c9e15acf1453 /winsup/cygwin/speclib
parent370a1171d8e7f3e93062815f53734f74a35ac817 (diff)
* mkimport: New script to perform all operations necessary to create
libcygwin.a. * rmsym: Delete. * newsym: Delete. * Makefile.in (toolopts): New variable which holds options relating to binutils/gcc tools. (speclib): Use toolopts. Add symbols to avoid copying to special libraries. (OBSOLETE_FUNCTIONS): Delete. (NEW_FUNCTIONS): Change to represent an argument to new mkimport script. (libcygwin.a): Use only new mkimport script to create libcygwin.a. Only rely on ${LIBCOS}. (*/lib*.a): Simplify speclib dependencies. (speclib): Accept toolchain options. Convert every argument to absolute path. Simplify parsing of nm output. Accommodate new exclude option.
Diffstat (limited to 'winsup/cygwin/speclib')
-rwxr-xr-xwinsup/cygwin/speclib36
1 files changed, 18 insertions, 18 deletions
diff --git a/winsup/cygwin/speclib b/winsup/cygwin/speclib
index b26644a1f..80ef23301 100755
--- a/winsup/cygwin/speclib
+++ b/winsup/cygwin/speclib
@@ -8,35 +8,35 @@ use strict;
sub dllname($;$);
my $static;
-my $exclude;
+my $inverse;
+my @exclude;
-GetOptions('static!'=>\$static, 'v|exclude!'=>\$exclude);
+my ($ar, $as, $nm, $objcopy);
+GetOptions('exclude=s'=>\@exclude, 'static!'=>\$static, 'v!'=>\$inverse,
+ 'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
-my $nm = shift;
-my $ar = shift;
-my $libdll = File::Spec->rel2abs(shift @ARGV);
-my $lib = File::Spec->rel2abs(pop @ARGV);
+$_ = File::Spec->rel2abs($_) for @ARGV;
-open my $nm_fd, '-|', $nm, '-Ap', '--defined-only', @ARGV, $libdll or
+my $libdll = shift;
+my $lib = pop;
+
+open my $nm_fd, '-|', $nm, '-Apg', '--defined-only', @ARGV, $libdll or
die "$0: execution of $nm for object files failed - $!\n";
my %match_syms = ();
my $symfiles = ();
my $lastfn;
my %extract = ();
+my $exclude_regex = @exclude ? join('|', @exclude) : '\\UnLiKeLy//';
+$exclude_regex = qr/$exclude_regex/;
while (<$nm_fd>) {
study;
- m%^\Q$libdll\E:([^:]*):\d+ i \.idata\$([56])% and do {
- next;
- };
- m%^\Q$libdll\E:[^:]*:\d+ I (__head_.*)$% and do {
- next;
- };
- next unless m%^([^:]*):([^:]*(?=:))?.* [DTI] (.*)%o;
- if ($1 ne $libdll) {
- $match_syms{$3} = 1;
- } elsif ($match_syms{$3} ? !$exclude : $exclude) {
- $extract{$2} = 1;
+ my ($file, $member, $symbol) = m%^([^:]*):([^:]*(?=:))?.* T (.*)%o;
+ next if !defined($symbol) || $symbol =~ $exclude_regex;
+ if ($file ne $libdll) {
+ $match_syms{$symbol} = 1;
+ } elsif ($match_syms{$symbol} ? !$inverse : $inverse) {
+ $extract{$member} = 1;
}
}
close $nm_fd;