delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/02/08/23:22:37

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Tue, 8 Feb 2000 22:28:56 -0600 (CST)
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: Chris Faylor <cgf AT cygnus DOT com>
cc: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: Revisiting libcygwin.a/libc.a/libm.a
In-Reply-To: <20000208142317.A5789@cygnus.com>
Message-ID: <Pine.HPP.3.96.1000208221600.8720B-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0

On Tue, 8 Feb 2000, Chris Faylor wrote:

> >Remember it way too well. I did do some tests since and it seemed to work
> >with v1.0 CD version. I will check again this evening.
> 
> Hmm.  I thought that I checked with the CD version and it still had
> problems.  Now, what did I do with that test case...

I tried a few trivial apps on my system, which is running a fairly recent
snapshot on top of v1.0, and it worked for both C and C++ apps. C++ apps
are important due to global constructor issues, and we need to run some
real testcases before we can say it's ok. 

Now here's the problem: the following will work:
  
  $ c++ -o foo foo.cc -lc -lm

but this will fail:

  $ c++ -o foo foo.cc /path/to/libc.a /path/to/libm.a

if libc.a and libm.a are symlinks to libcygwin.a, and this is quite
possibly due to the linker getting confused with the various head_*
in the import libraries being pulled in out of order.

To get an insight, add a -v and see the order of the libraries, which
both the C and C++ drivers reorder when it sees -lc -lm on the command
line, but do not reorder when these are handed as libc.a and libm.a.

Solution? Create libc.a and libcygwin.a as separate import libraries
from the same set of exports, and libm.a from perhaps just the math
exports. Dlltool will use the archive names to create the head_ and
iname_ symbols, and linker will do the right thing hopefully. I need
to test this out before I can say this would work for sure of course.

Regards,
Mumit


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019