This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
freestanding library documentation
- From: Richard Henderson <rth at redhat dot com>
- To: jsm28 at cam dot ac dot uk, gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Apr 2002 14:27:34 -0800
- Subject: freestanding library documentation
Look ok?
r~
Index: standards.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/standards.texi,v
retrieving revision 1.4
diff -u -p -r1.4 standards.texi
--- standards.texi 2002/02/27 18:47:52 1.4
+++ standards.texi 2002/04/02 22:24:57
@@ -132,16 +132,26 @@ the semantics defined in the standard.
freestanding implementation for a freestanding environment, use the
option @option{-ffreestanding}; it will then define
@code{__STDC_HOSTED__} to @code{0} and not make assumptions about the
-meanings of function names from the standard library. To build an OS
-kernel, you may well still need to make your own arrangements for
-linking and startup. @xref{C Dialect Options,,Options Controlling C
-Dialect}.
+meanings of function names from the standard library, with exceptions
+noted below. To build an OS kernel, you may well still need to make
+your own arrangements for linking and startup.
+@xref{C Dialect Options,,Options Controlling C Dialect}.
GCC does not provide the library facilities required only of hosted
implementations, nor yet all the facilities required by C99 of
freestanding implementations; to use the facilities of a hosted
environment, you will need to find them elsewhere (for example, in the
GNU C library). @xref{Standard Libraries,,Standard Libraries}.
+
+Most of the compiler support routines used by GCC are present in
+@file{libgcc}, but there are a few exceptions. GCC requires the
+freestanding environment provide @code{memcpy}, @code{memmove},
+@code{memset} and @code{memcmp}. Some older ports of GCC are
+configured to use the BSD @code{bcopy}, @code{bzero} and @code{bcmp}
+functions instead, but this is deprecated for new ports.
+Finally, if @code{__builtin_trap} is used, and the target does
+not implement the @code{trap} pattern, then GCC will emit a call
+to @code{abort}.
For references to Technical Corrigenda, Rationale documents and
information concerning the history of C that is available online, see