public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf@redhat.com>
To: Zack Weinberg <zack@codesourcery.com>
Cc: Adam Megacz <gcc@lists.megacz.com>, gcc@gcc.gnu.org
Subject: Re: victory! I have a working crosscompiler!
Date: Mon, 10 Dec 2001 12:08:00 -0000	[thread overview]
Message-ID: <20011210194610.GE25811@redhat.com> (raw)
In-Reply-To: <20011210193106.GF10344@codesourcery.com>

On Mon, Dec 10, 2001 at 11:31:06AM -0800, Zack Weinberg wrote:
>On Mon, Dec 10, 2001 at 02:11:47PM -0500, Adam Megacz wrote:
>>Bo Thorsen <bo@sonofthor.dk> writes:
>>>Not true.  If you have a C compiler, you have a C library.
>>
>>But I've never seen a file called "libc.so" on a windows machine.
>>
>>And (for example), getpwent() is part of libc, yet (AFAIK) is pretty
>>much meaningless on a Win32 system.
>
>As I understand it, libc.so is roughly analogous to the core DLLs:
>kernel32, etc.  Look in gcc/config/i386/mingw32.h and cygwin.h for some
>lists.
>
>The interfaces defined by the C standard will be provided by some
>library - that's what Bo means.  Some of the interfaces defined by
>POSIX are present too, more with cygwin.  Very unix-specific routines
>like getpwent naturally won't show up.

getpwent does show up with cygwin.  Cygwin implements a substantial
number of "UNIX" functions.

In the cygwin case, there is a libc.a but it is linked to libcygwin.a.
On starrtup, a program automatically loads cygwin1.dll in an analogous
way to libc.so.  cygwin1.dll contains most of the functions found in a
normal libc.so.  cygwin1.dll makes calls to other system DLLs.

The equivalent for mingw is something like libmsvcrt40.a/msvcrt40.dll
(and libmingwm10/mingwm10.dll).  msvcrt40.dll is a Microsoft provided
DLL.  There are many fewer 'UNIX' like functions available under mingw,
for obvious reasons.

I've lost the thread of the reason for the original query but I can't
think of a good reason why you need to know precisely what your C
library is called.  The library gets linked in automatically just like
it does on any UNIX system.  You shouldn't have to figure out precisely
what it's called.  Just use it.

If you want to know if a particular function is available under a
particular Windows UNIX-emulation the best way is to just try to link
it and note any errors.

cgf

  reply	other threads:[~2001-12-10 19:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-08 19:10 Adam Megacz
2001-12-10  2:36 ` Bo Thorsen
2001-12-10 11:11   ` Adam Megacz
2001-12-10 11:31     ` Zack Weinberg
2001-12-10 12:08       ` Christopher Faylor [this message]
2001-12-10 12:49         ` Adam Megacz
2001-12-10 13:11           ` Phil Edwards
2001-12-10 13:20             ` Adam Megacz
2001-12-10 11:38     ` Craig Rodrigues
2001-12-10 12:52       ` Adam Megacz
2001-12-10 11:44     ` Andreas Schwab
2001-12-10 12:34     ` DJ Delorie
2001-12-10 15:59 Danny Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011210194610.GE25811@redhat.com \
    --to=cgf@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gcc@lists.megacz.com \
    --cc=zack@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).