From 92c4330f5bba5a7329356c7f66313027b9d5b0c5 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 21 Sep 2009 02:32:06 +0000 Subject: [PATCH] * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that cxx_malloc is always set to the cygwin version. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/dcrt0.cc | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e8e67d9f5..3a4a81801 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-09-20 Christopher Faylor + + * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that + cxx_malloc is always set to the cygwin version. + 2009-09-20 Christopher Faylor * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index e49183796..2a023456f 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -766,6 +766,12 @@ dll_crt0_1 (void *) sigproc_init (); check_sanity_and_sync (user_data); + /* This is a kludge to work around a version of _cygwin_common_crt0 + which overwrote the cxx_malloc field with the local DLL copy. + Hilarity ensues if the DLL is not loaded like while the process + is forking. */ + __cygwin_user_data.cxx_malloc = &default_cygwin_cxx_malloc; + /* Initialize malloc and then call user_shared_initialize since it relies on a functioning malloc and it's possible that the user's program may have overridden malloc. We only know about that at this stage,