This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: speclib vs. -lc trouble.


Dave Korn wrote:
> , my perl-fu isn't up to
> much but it looks to me like speclib should be able to pass them straight
> through with just a little tweaking.

  If my perl-fu /was/ up to much, I would have realised that speclib would
trivially pass them straight through without any tweaking at all :)  However,
some aliases needed to be filtered out, or I got duplicated entries which
dlltool choked on.

  I'm just testing this to verify that it generates consistent ordinals and
that there is no change in the overall set of symbols exported from the DLL.
Assuming so, OK?

	* gendef:  Append explicit ordinals to exports.
	* speclib:  Avoid duplicated exports, and save filtered DEF file.

    cheers,
      DaveK


Index: speclib
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/speclib,v
retrieving revision 1.16
diff -p -u -r1.16 speclib
--- speclib	28 Mar 2009 04:55:36 -0000	1.16
+++ speclib	9 Apr 2009 16:29:33 -0000
@@ -39,12 +39,17 @@ while (<$nm_fd>) {
 	delete $defsyms{$1};
     } else {
 	$newdef .= $defsyms{$1} if exists $defsyms{$1};
+	delete $defsyms{$1} if exists $defsyms{$1};
     }
 }
 close $nm_fd;
 
 $newdef .= join '', sort values %defsyms if $inverse;
 
+open my $newdef_fd, ">", "newdef.def" or die "$0: couldn't open newdef.def - $!\n";
+print $newdef_fd $newdef;
+close $newdef_fd;
+
 open my $dlltool_fd, '|-', $dlltool, '-d', '/proc/self/fd/0', '-D', 'cygwin1.dll', '-l', $lib or
     die "$0: couldn't start dlltool - $dlltool - $!\n";
 print $dlltool_fd $newdef;
Index: gendef
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/gendef,v
retrieving revision 1.31
diff -p -u -r1.31 gendef
--- gendef	14 Mar 2009 09:14:47 -0000	1.31
+++ gendef	9 Apr 2009 16:29:33 -0000
@@ -14,6 +14,8 @@ my $tls_offsets = shift;
 my $out = shift;
 my $sigfe = shift;
 
+my $ordinal = 1;
+
 $main::first = 0;
 if (!defined($in) || !defined($out) || !defined($sigfe)) {
     die "usage: $0 deffile.in cygtls.h deffile.def sigfe.s\n";
@@ -37,7 +39,9 @@ my @nosigfuncs = ();
 my @out = ();
 for (@in) {
     /\sDATA$/o and do {
-	push(@data, $_);
+	chomp;
+	s/DATA//g;
+	push(@data, $_ . " @ " . $ordinal++ . " DATA\n");
 	next;
     };
     chomp;
@@ -63,7 +67,7 @@ for (@in) {
     s/(\S)\s+(\S)/$1 $2/go;
     s/(\S)\s+$/$1/o;
     s/^\s+(\S)/$1/o;
-    push(@out, $_ . "\n");
+    push(@out, $_ . " @ " . $ordinal++ . "\n");
 }
 
 for (@out) {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]