This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Profiling trouble with C++ and egcs
- To: niklas at petra dot appli dot se
- Subject: Profiling trouble with C++ and egcs
- From: Marc Espie <espie at tetto dot liafa dot jussieu dot fr>
- Date: Tue, 31 Aug 1999 19:41:31 +0200
- Cc: egcs-bugs at egcs dot cygnus dot com
- Reply-To: Marc dot Espie at liafa dot jussieu dot fr
A test of Jeff Law crashed out...
turns out our g++ is unable to run profiling.
Looking at the specs, it's not that surprising:
profiling replaces -lc with -lc_p, but does nothing
with -lstdc++ or -lm.
So, g++ turns out trying to link with libstdc+.so, libm.so,
and libc_p.a -> boom, crash, no support for dynamic libraries
without libc.so.
>From the egcs front, it definitely looks like some specs
are missing from the gxxmain driver.
Namely, *ANY* library it controls should be subject to
the same potential transformation that libc is.
Anything else, as far as -lm is concerned, won't be satisfactory.
I believe the same should be true of libstdc++, especially with
multi-libbed environments where a profiling libstdc++ could occur.
As far as OpenBSD goes, there is a way to `hide' the problem:
simply enforce -Bstatic at the start of the linker command line
to be sure no surprises coming from dynamic libraries being
devishly added by egcs will cause problems... another solution
would be to fix the linker to work under such dire circumstances...
but this is but a kludge. The larger problem is that gxxmain kludges
lstdc++ and lm in a rather surprising way.