Is libc built by gcc?

Brian Dessent brian@dessent.net
Fri Apr 20 22:54:00 GMT 2007


Ray Hurst wrote:

> Is libc built by gcc?

Maybe you could elaborate as to what you're *actually* trying to do.

By process of deduction, if libc is written in C then it has to be
compiled by *some* C compiler.  On linux systems, the libc is the GNU C
library (glibc), and glibc is written in C, and gcc is the C compiler,
thus libc is compiled by gcc.

But that is just one specific instance, it is not a general rule.  What
you seem to be asking is whether libc is part of gcc, and the answer to
that is no, it's completely separate.  gcc does not contain a C library
because gcc is used with too many various platforms to make this
maintainable.  gcc uses whatever C library comes with the system, and
given that gcc has been ported to at least two or three dozen platforms,
there is a long list of various C libraries that gcc could potentially
be used with.  If you were using gcc on e.g. Solaris then the libc would
have been written/maintained by Sun and built with Sun's C compiler.

Brian



More information about the Gcc-help mailing list