[GCC-XML] gccxml vs _glibcxx_debug

Brad King brad.king at kitware.com
Tue Aug 10 11:35:23 EDT 2010


On 08/10/2010 10:21 AM, Jakub Zytka wrote:
> As far as I remember gccxml (0.9) uses parser from gcc 4.2 which apparently 
> doesn't support stl debug mode (or does it? I've only seen some fragmentary 
> notes around the net, nothing definite)

On 08/10/2010 10:50 AM, Doug Gregor wrote:
>> In what version of GCC was the debug stl support added?
>
> Apple GCC 3.3, FSF GCC 3.4.

It's been around since well before gcc 4.2.

> If i use gccxml with -D_GLIBCXX_DEBUG i get:
> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux/bits/c++config.h:1226: 
> error: current namespace 'std' does not enclose strongly used namespace 
> '__gnu_debug_def'
[snip]
> namespace std
> {
>    using namespace __gnu_debug_def __attribute__ ((strong)); // here's the error
> }

It looks like GCC 4.1 and GCC 4.2 each use a GNU extension here, but the
rules (and corresponding code in c++config.h) changed between versions.
In the GCC 4.2 version of this header the strongly-used namespace *is*
inside std.

> Is _GLIBCXX_DEBUG not supported or is it just me?

Our design goal is to support C++98 code.  This is not; it uses
GNU extensions.

> Would upgrading gcc from 4.1 to 4.2 or eg. 4.4 help in such case?

If you pass "--gccxml-compiler g++-4.2" to gccxml then it will use
the system's GCC 4.2 compiler (assuming it is installed).  Since the
parser version matches it will probably work.

> Or perhaps namespace nondebug should be defined in some other way?
> Have anyone succeeded with tweaking c++config.h in gccxml in order to be able to 
> use _GLIBCXX_DEBUG? Any hints?

You might be able to copy/patch c++config.h from GCC 4.1 into
GCC_XML/Support/GCC/4.1/bits/c++config.h and try arranging the
namespaces the way they appear in GCC 4.2's header.  Unfortunately
that may require patching all the other headers that use that
namespace too.

-Brad



More information about the gccxml mailing list