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]

Re: Recompiling troubles.... Was Re: Strange behaviour in C++...


> I added -fno-vtable-thunks to MYCXXFLAGS in libstdc++/Makefile.in 
> and recompiled it. Is this the right place to do
> the change?

Your best bet is to change the compiler internals altogether; in
config/linux.h it says DEFAULT_VTABLE_THUNKS.

Unfortunately, with the way Linux libio/stdio/iostream works, you also
have to recompile the C library, because it uses thunks as well.

> I used CVS to checkout the latest source. How do I apply Martin's
> patch to my copy? Sorry for my complete lack of knowledge about cvs
> diffs......

I guess the patch doesn't work out-of-the-box; it needs to be updated
to the current code.

> This bug is a showstopper for my project, so I really need a
> workaround.... :-| (or even better! a fix! ;-) )

There is always a work-around: Don't call virtual functions inside
destructors. This suggestion may sound strange, but it is meant
seriously: If you need to make your code work, it is best to accept
the restriction, instead of relying on flaky patches and untested
features. Of course, if you are willing to experiment, and if you
accept to totally break your compiler, I definitely encourage you to
try the patch. To install it, go into the cp directory and invoke

patch < patchfile.html

(unfortunately, the archive currently makes it difficult to get to the
original message, so the patch may fail for that reason as well)

Regards,
Martin


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