This is the mail archive of the cygwin@sourceware.cygnus.com
mailing list for the Cygwin project. See the Cygwin
home page for more information.
To use or not to use -lc [RE: in execvp.c undefined ...]
- To: Michael Fonte <mikef@sensor.com>
- Subject: To use or not to use -lc [RE: in execvp.c undefined ...]
- From: Mumit Khan <khan@xraylith.wisc.edu>
- Date: Thu, 22 Apr 1999 16:33:37 -0500 (CDT)
- cc: cygwin@sourceware.cygnus.com
- Reply-To: Mumit Khan <khan@xraylith.wisc.edu>
On Thu, 22 Apr 1999, Michael Fonte wrote:
> Reply I caught this about 30 minutes later. I am not sure why 'most' of the
> source code distributions out there explicitly add -lc as well. Anyone have
> a historical perspective on this. I suppose there are apps out there that
> don't use libc, they either write their own or don't need it. In these
> cases it would be nice to not have to link against libc. In either case for
> compatibility reasons explicitly adding -lc should not cause a fatal error
> (IMHO).
Historically speaking, it was usually to deal with systems which had
multiple C runtime libraries, and the compiler drivers didn't handle
it as well as you'd like or at all. eg., lots of systems had libc.a,
libc_s.a, libc_g.a and so on where each library had some special meaning
(profile, debugging, static-vs-dynamic, some-other-feature, etc); more
often than not, there was no switch to pass to "cc" that will pick the
right one, and so you'll have to do it yourself. I don't recall having
to do this since the late 80's however.
Currently, there is absolutely no reason to do this in general; it's just
a bad habit folks pick up from old packages and perpetuate the whole
mess ;-)
This is also another reason one should not use low-level linkers etc
unless there is a special reason. You need to know way too much about
the target system to use ld etc directly.
> The makefile was generated via a configure script from the standard tcl8.0.5
> source distribution.
You're using the Makefile.in in tcl8.0.5/unix directory, which is one
problem right there (unless of course you really mean to build a Cygwin
Tcl that doesn't use Win32 API); the other is a bug in Tcl Makefile.in
-- it should not have the -lc in the first place (see ``LIBS = ').
You can pretty much use my patches for 8.0.4 and import it into a 8.0.5
CVS tree. Might need a few minor adjustments however. it's available from
http://www.xraylith.wisc.edu/~khan/software/tcl/. I'll try to get 8.0.5
patches out sometime soon.
Regards,
Mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com