This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ demangler horrors
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 8 Jul 2003 00:19:53 -0400
- Subject: Re: C++ demangler horrors
Alex said:
>1) when libiberty is configured for the build or host machine, just
> check whether a C++ compiler is there, and use the result to decide
> which demangler to build, and that's it.
This is precisely what I would like to avoid. :-p For the build machine
it's fine since the build libraries never get installed, of course. For
the host, I want the demangler chosen *not* to be dependent on random
features of the build environment.
>2) when libiberty is configured for the target, do *not* test for a
> C++ compiler. Instead, get configure-target-libiberty to depend on
> configure-target-libstdc++-v3 (does this introduce any cycles?),
No.
Does merely configuring libstdc++-v3 without building it give us the
needed header files in the correct arrangement? That would be mildly
surprising to me. And if it does, why can't we just pull them 'raw' out
of the source directory, rather than even trying to build it at all?
Then libiberty would simply require the 'presence' of the libstdc++-v3
directory. :-)
> and just assume the C++ compiler is good enough to build the
> C++ demangler into libiberty. We still need some logic for the
> case of a C-only build, but I think this approach might work.
And for the cases when build!=target.
---
Here's another proposal:
--with-cxx-demangler
--without-cxx-demangler
(and possibly...)
--with-cxx-demangler=foo
For all directories which want a C++ demangler.
If a directory is --with-cxx-demangler, then it must depend on
libstdc++-v3 to get the demangler. If it is --without-cxx-demangler,
then it builds without demangling functionality, and doesn't need the
dependency.
The default for this option should be the same no matter what is in the
environment, in my opinion, but it could be defaulted based on
environmental detection if people insist (provided it's recorded clearly
somewhere).
Then there must be a preexisting installed C++ compiler for any 'host'
directory to build --with-cxx-demangler, but at least that will be
well-documented.
A host-libstdc++-v3 might be introduced, of course. OK, I retract that
part of the suggestion. :-) (Although that would fit in with one of my
crazier plans, involving a 3-staged build for Canadian crosses.)
I put a half-dozen other options in another message.
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html