-fno-rtti

Christopher Faylor cgf@redhat.com
Sat Jul 27 14:16:00 GMT 2002


On Sat, Jul 27, 2002 at 09:32:14PM +0100, Conrad Scott wrote:
>Is there any strong reason currently to use the -fno-rtti flag in
>building the cygwin DLL?  AFAICT from the archives, the reasons have
>been to do with executable size.  From a quick test, it seems to make
>no more than a small difference in the size of the DLL (less than 1%)
>and doesn't seem to change the run-time size of objects (tho' this
>wasn't a very scientific test).  Also, the DLL seems to work fine when
>compiled with rtti.
>
>The main reason for asking (other than my usual simple minded
>curiosity) is that I would like to use dynamic_cast in some cygserver
>code I'm writing.  If the decision is to keep the -fno-rtti flag for
>the DLL, I can build the objects for the cygserver executable with rtti
>(which I'm assuming wouldn't be a problem), but given the intertwining
>of the code base, it might be "cleaner" to compile it all up with the
>same set of flags.

The Cygwin DLL has always used "c++ lite".  Part of the reason was that
g++ didn't work too well when cygwin was first conceived so things like
dynamic casts and exceptions were to be avoided.  Part of the reason
was that the original developer was teaching himself c++ when he initially
wrote cygwin.

There is also the issue of impacting dll size and speed with some
features like rtti.  It means that we use malloc in most cases where a
normal c++ program would use new.  We use small_printf rather than
trying to adapt some kind of cout mechanism.

My preference would be for you to avoid the use of this feature.  9k is
9k.  We already seem to grow and slow the dll with each release.  I'd
rather not make a conscious decision to do this when it can be avoided.

cgf



More information about the Cygwin-developers mailing list