This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: demengler in libstdc++ is changed


On Thu, 13 Nov 2003, DJ Delorie wrote:
> > Absolutely.  I was under the impression that the demangler just used
> > std::vector and a few other features, not the full runtime.
>
> Don't forget "new", which needs at least libsupc++

That is trivial to work around in C++, just define a custom operator new
local to the library, which calls malloc.

> > In any case, it is straightforward to link in parts of the C++
> > runtime as needed, converting them to C if you wish.
>
> It is NOT straightforward to do that if you're building with the
> host's bundled compiler, especially if it does not have a C++ runtime.
>
> The biggest user of libiberty's demangler, gdb, has made it clear that
> a C++-based demangler would not be acceptable.  I wish the "new"
> demangler had been written in C to start with, so we could have
> avoided all these problems in the first place.

I'm not sure what the problem would be here.  It would simply be a C file
that would be compiled and linked into the program.  The point is that you
wouldn't _need_ a C++ runtime.  In LLVM, the C runtime library for
setjmp/longjmp is written in C++, for example, and is compiled into C
programs all of the time without lib(sup|std)c++.

> > > or if the compiler needed is non-free (or even just difficult to
> > > obtain).
> >
> > LLVM is freely available (and easy to obtain):
> > http://llvm.cs.uiuc.edu/releases/
>
> In the context of the GCC project, requiring a second compiler just to
> maintain GCC seems, well, dirty.

Hrm, well LLVM is heavily based on GCC, so I don't see what the problem
is.  *shrug*

If the demangler is compatible with the GCC "3.4" C++ parser, it should
work just fine with LLVM (which is based on mainline CVS).

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]