This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling & Running C++ Progs without standard libc.
- To: emiruner at hotmail dot com, gcc at gcc dot gnu dot org
- Subject: Re: Compiling & Running C++ Progs without standard libc.
- From: mrs at wrs dot com (Mike Stump)
- Date: Thu, 29 Jul 1999 06:45:49 -0700
> From: "Emir Uner" <emiruner@hotmail.com>
> To: gcc@gcc.gnu.org
> Date: Thu, 29 Jul 1999 06:11:47 PDT
> As the C++ used in kernel I cannot link the code with the standard
> libc.
Why? (Or at least large parts of it.)
> The code runs well but two C++ features don't work: RTTI and
> Exceptions. What must I do?
Learn to start linking in those routines that are needed, and letting
stuff find them. For things that are inappropriate to link in
(malloc, fopen), you will need to read and understand the runtime
libraries and `invent' a solution.
You might need finer resolution on the objects, so you might have to
split out the routines in the runtime you want to replace from those
that you don't want to replace.
For example, I support gcc on vxWorks, surprise, a kernel and it has
C++ in it. We used to not link in the C++ runtime libraries nor
libgcc.a type stuff. What did we find? Oh, that no C++ libraries
were present, and that long long didn't work. Solution to the
problem, link in more of the routines and add support for that stuff
we didn't like. Net result, now C++ works (including RTTI and EH) and
that long long works.
:-)