www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/08/14:17:59

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199905081817.NAA00544@modi.xraylith.wisc.edu>
X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol
To: Paul Thiessen <paul AT grserv DOT med DOT jhmi DOT edu>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: problem w/ mingw32/egcs/msvcrt and file reads (fwd)
In-reply-to: Your message of "Sat, 08 May 1999 09:08:36 EDT."
<Pine DOT SGI DOT 4 DOT 10 DOT 9905080700040 DOT 68630-100000 AT turandot DOT med DOT jhmi DOT edu>
Date: Sat, 08 May 1999 13:17:07 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

Paul Thiessen <paul AT grserv DOT med DOT jhmi DOT edu> writes:
> Thanks for your help!
>   This isn't a big deal, but I'm just trying to understand more fully how 
> all this works: I do notice that crtdll.dll is still being linked
> in. (I tagged on an objdump -p at the end of this.) I thought from what I
> read earlier that msvcrt.dll was basically a drop-in replacement for
> crtdll.dll, but apparently that's not totally true? That there are still a
> few functions in crtdll that msvcrt doesn't have?

You're absolutely correct the crtdll is still being linked in certain
conditions, but so far I haven't seen any problems due to it. It only
happens when you use c++ or g77 (but not gcc), and the reason is the
following: the math library is defined to libcrtdll.a when we build
mingw32 compiler at compile time, and even if we use the msvcrt specs,
it gets linked in. The workaround is the following (of course, you
need to do this when if you find problems):
  
instead of:
  
  $ c++ -o foo foo.o

do,

  $ gcc -o foo foo.o -lstdc++

For g77, use gcc with -lg2c. 

The reason for not seeing any problem due to this is that msvcrt is a
superset and already resolves all the references and it never gets to
load anything from CRTDLL that conflicts. You check always check by
telling the linker to be verbose (gcc -Wl,--verbose I believe is the
right flag), which shows all the references. You can also use the
map file option, -Wl,-M, to enumerate the resolution process.

This is fixed in egcs-1.2.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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