Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 15.09.2011 16:34, Caolán McNamara wrote:
On Thu, 2011-09-15 at 14:34 +0200, Michael Stahl wrote:
of course what also needs to be prevented is linking against system
libraries that expose STL in their interface; a quick search found me
cppunit and graphite; the mozilla/nss stuff doesn't seem to expose STL.

This is basically the scenario that caused the trouble. Its not
incompatibility between debugging stl in one of our modules vs another
one but incompatibility between, in practice, non-debugging system
cppunit and debugging stl in our code, i.e. stuff that uses cppunit
headers, runs the debugging-stl destructors on something created by
non-debugging-stl. Inlines resizing/deleting stuff was one problematic
one IIRC.

+    # cppunit and graphite expose STL in public headers

Quite probably need to also handle the mysql connector as well, maybe a
few more, hunspell ? Gets a bit unwieldy fast to maintain a list in
configure of stuff that uses stl.

we only have 212 modules so the size of the list is bounded :)

now which of these are external C++ libraries...

* stlport: irrelevant :)

* vigra, mdds, boost: these are by people who don't care about
encapsulation (a.k.a. "header-only" libraries), so no ABI problem

* xpdf, nss, moz, hunspell, mythes: no standard C++ in header (checked by
"grep std unxlngx6/inc/...")

* icu: this seems to use only std::string; guess the internal one needs a
flag, and the system one could be a problem.  strangely when looking at
the OOo icu module there doesn't seem to be anything STLport-related?

oh, wait a second: this page here claims that due to some libstdc++
internal issues the ::std::basic_string is ABI compatible in debug mode,
so "icu" shouldn't be a problem:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt03ch17s04.html

* mysqlcppconn: seems to use iostreams; built with dmake, so problem only
if from system

(by the way, how does it work that building this thing requires some
system mysql libraries? do users need to install those to use mysql? that
seems odd...)

For the internal cppunit and graphite probably need to pass
-D_GLIBCXX_DEBUG into *their* build systems as well, no ? The edge-cases
that needed to be handled seemed to pile up sufficiently high to make it
hard to know if it was all handled correctly :-(

* graphite: apparently built with dmake, so a problem only if from system

* cppunit: needs flag (already done in the patch), problem if from system

that's all i've found, slightly updated patch attached.  please check if
i've missed anything :)

regards,
 michael
enable libstdc++ debug mode with --enable-dbgutil

diff --git a/configure.in b/configure.in
index 0560d60..496e746 100755
--- a/configure.in
+++ b/configure.in
@@ -2293,6 +2293,22 @@ if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then
     PRODUCT=""
     PROFULLSWITCH=""
     AC_MSG_RESULT([yes])
+    # cppunit and graphite expose STL in public headers
+    if test "$with_system_cppunit" = "yes"; then
+        AC_MSG_ERROR([--with-system-cppunit conflicts with DBG_UTIL build])
+    else
+        with_system_cppunit=no
+    fi
+    if test "$with_system_graphite" = "yes"; then
+        AC_MSG_ERROR([--with-system-graphite conflicts with DBG_UTIL build])
+    else
+        with_system_graphite=no
+    fi
+    if test "$with_system_mysql_cppconn" = "yes"; then
+        AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with DBG_UTIL build])
+    else
+        with_system_mysql_cppconn=no
+    fi
     if test $_os = WINNT -a \( "$enable_mozilla" = yes -o "$enable_build_mozilla" = yes \); then
         # We can't build against the Mozilla stuff if using _DEBUG, will get linking errors
         # See connectivity/drivers/mozab
diff --git a/cppunit/makefile.mk b/cppunit/makefile.mk
index 7fba665..9269096 100644
--- a/cppunit/makefile.mk
+++ b/cppunit/makefile.mk
@@ -119,6 +119,15 @@ MY_LIBS = -lm
 
 CONFIGURE_ACTION = ./configure
 
+.IF "$(COM)" == "GCC"
+.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD" || "$(OS)" == "OPENBSD" || "$(OS)" == "NETBSD" || 
"$(OS)" == "DRAGONFLY" || "$(OS)" == "ANDROID"
+.IF "$(PRODUCT)"!="full"
+# enable debug STL
+EXTRA_CDEFS += -D_GLIBCXX_DEBUG
+.ENDIF # !PRODUCT
+.ENDIF # OS
+.ENDIF # GCC
+
 .IF "$(debug)"!=""
 DEBUGFLAG=-g
 .ENDIF
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 362b378..851cc75 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -107,6 +107,13 @@ endif
 
 endif
 
+# enable debug STL
+ifeq ($(gb_PRODUCT),$(false))
+gb_COMPILERDEFS += \
+       -D_GLIBCXX_DEBUG \
+
+endif
+
 gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- '{ print $$1*10000+$$2*100+$$3 }')
 gb_StrictAliasingUnsafe := $(shell expr $(gb_CCVER) \< 40600)
 
diff --git a/solenv/inc/unxfbsd.mk b/solenv/inc/unxfbsd.mk
index f751384..4470160 100644
--- a/solenv/inc/unxfbsd.mk
+++ b/solenv/inc/unxfbsd.mk
@@ -91,6 +91,11 @@ PICSWITCH:=-fpic
 CFLAGSCXX += -fvisibility-inlines-hidden
 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
 
+.IF "$(PRODUCT)"!="full"
+# enable debug STL
+CFLAGSCXX += -D_GLIBCXX_DEBUG
+.ENDIF # !PRODUCT
+
 # Compiler flags for compiling static object in multi threaded environment with graphical user 
interface
 CFLAGSOBJGUIMT=
 # Compiler flags for compiling static object in multi threaded environment with character user 
interface
diff --git a/solenv/inc/unxgcc.mk b/solenv/inc/unxgcc.mk
index 752de80..f34f12b 100644
--- a/solenv/inc/unxgcc.mk
+++ b/solenv/inc/unxgcc.mk
@@ -91,6 +91,11 @@ CFLAGSCXX+=-fvisibility-inlines-hidden
 CFLAGSCXX+=-std=c++0x -Wno-deprecated-declarations
 .ENDIF # "$(HAVE_CXX0X)" == "TRUE"
 
+.IF "$(PRODUCT)"!="full"
+# enable debug STL
+CFLAGSCXX += -D_GLIBCXX_DEBUG
+.ENDIF # !PRODUCT
+
 CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
 CFLAGS_USE_PCH=-I$(SLO)$/pch -DPRECOMPILED_HEADERS -Winvalid-pch
 CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)$/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.