[GCC-XML]Patches for GCC 3.3.1

Patrick Hartling patrick at vrac.iastate.edu
Wed Aug 27 10:28:00 EDT 2003


Brad King wrote:
>>After looking through the CVS logs, I saw that Revision 1.50 of xml.c
>>added some support for GCC 3.3 back in March of this year (*).  Using
>>the latest GCC-XML code from CVS, I made the attached patches that
>>appear to get GCC-XML working with GCC 3.3.1.  Output from my really
>>simple test cases look good compared to output from GCC-XML 0.4.2, but I
>>would like to be sure that my changes are actually valid.
> 
> 
> The CVS version of gccxml (even before your contribution) should have been
> able to simulate GCC 3.3.1 in your installation.  Building the patched
> cc1plus executable from GCC 3.0.4 should still be able to parse the 3.3
> standard library.  I have nightly testing on a project that uses gccxml to
> simulate gcc 3.3.
> 
> The GCC-XML patch need not be applied to your system compiler.  A separate
> build is fine.

Right, that's the way I am doing it.  Trying use GCC-XML 0.4.2 from the 
Ports Collection gives me errors like this, however:

In file included from /usr/include/c++/3.3/iosfwd:46,
                  from /usr/include/c++/3.3/bits/stl_algobase.h:70,
                  from /usr/include/c++/3.3/memory:54,
                  from /usr/include/c++/3.3/string:48,
                  from test.cpp:1:
/usr/include/c++/3.3/bits/c++locale.h:56: parse error before `__attribute__'
/usr/include/c++/3.3/bits/c++locale.h: In function `int
    std::__convert_from_v(...)':
/usr/include/c++/3.3/bits/c++locale.h:61: `__old' undeclared (first use this
    function)
/usr/include/c++/3.3/bits/c++locale.h:61: (Each undeclared identifier is
    reported only once for each function it appears in.)
/usr/include/c++/3.3/bits/c++locale.h:62: parse error before `if'
/usr/include/c++/3.3/bits/c++locale.h:64: initializer list being treated as
    compound expression
/usr/include/c++/3.3/bits/c++locale.h:64: cannot convert `const char*' 
to `int'
    in initialization
[Remainder of errors cut]

It may be that the way the Ports Collection builds and/or installs 
GCC-XML is invalid.  GCC-XML was just added to the Ports Collection a 
few weeks ago, and the disparity between FreeBSD 4.x (where GCC 2.95 is 
the system compiler) and 5.x is pretty significant.  My impression is 
that most ports are tested on FreeBSD 4.x, and if they at least compile 
on 5-current with the much newer version of GCC, that's good enough for 
now.  At any rate, with the latest CVS version of GCC-XML, things are 
working pretty well.

>>(*) Actually, I think Revision 1.50 added support for the GCC 3.4 code
>>base.  In particular, BINFO_ACCESSES() wasn't added until Revision 1.387
>>of GCC's tree.h, but GCC 3.3.x branched from Revision 1.367, which does
>>not contain the BINFO_ACCESSES() macro.  Furthermore, tm.h and
>>coretypes.h don't exist in the GCC 3.3 release branch.  This is
>>reflected in my patch for xml.c.
> 
> 
> In fact those changes were made to support Apple's branch of gcc 3 for
> their 3.3 release of OSX Panther.  I guess they included more changes in
> their version of gcc 3.3 than the gcc folks did.

Interesting.  That will make inclusion of OS X Panther into our work all 
the more ... entertaining, I'm sure.  :\

> I've applied your patch to xml.c, made a few tweaks, and committed the
> changes with credit to you in the CVS log.  I'll also be adding a patch
> for gcc 3.3 to the CVS repository as well.  Thanks for your work.

No problem.  :)

  -Patrick


-- 
Patrick L. Hartling                     | Research Assistant, VRAC
patrick at vrac.iastate.edu                | 2624 Howe Hall: 1.515.294.4916
http://www.137.org/patrick/             | http://www.vrac.iastate.edu/




More information about the gccxml mailing list