[PATCH] Remove libstdc++ from cygwin1.dll build

Thomas Pfaff tpfaff@gmx.net
Tue Nov 26 02:51:00 GMT 2002

I had some problems building the cygwin1.dll after i changed gcc to use
sjlj exceptions. The resulting dll was unusable.

I have discovered that this is due to the fact that cygwin1 is linked
against libstdc++. The only reasons why cygwin1 is linked against stdc++
are the operators new and delete and __cxa_pure_virtual.

IMHO this is not acceptable because the new and new[] operators will throw
exceptions if the memory allocation has failed. C programs will terminate
via abort because the exception is not caught, C++ programs might behave

A possible solution might be to use the nothrow new operators, i think
that the cleanest way is to define own operators. As a side effect the
cygwin1 dll can be build with an sjlj gcc and the dll is
significantly smaller.


2002-11-26  Thomas Pfaff  <tpfaff@gmx.net>

	* cxx.cc: New file. Implement new, new[], delete and delete[]
	operators. Implement  __cxa_pure_virtual.
	* Makefile.in (DLL_OFILES): Add cxx.o.
	Remove libstdc++.a from cygwin1.dll link step.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cxx.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20021126/a4a1a3ce/attachment.ksh>

More information about the Cygwin-patches mailing list