This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [debug/profile-mode] broken c++config.h
- From: PaweÅ Sikora <pawel dot sikora at agmk dot net>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 16 Mar 2012 16:44:58 +0100
- Subject: Re: [debug/profile-mode] broken c++config.h
- References: <7281837.C0MGfFFFqB@vmx> <CAH6eHdS26eFOUikahq3WzPFVD-Q4hXKwo_ubU+xY0zDNVHmM_A@mail.gmail.com>
On Friday 16 of March 2012 14:29:21 Jonathan Wakely wrote:
> 2012/3/16 PaweÅ Sikora:
> > Hi,
> >
> > during gcc build process there's some sed magic (libstdc++-v3/include/Makefile.{am,in}) in action
> > which modifies libstdc++/include/bits/c++config.h (replaces '#define _GLIBCXX_EXTERN_TEMPLATE'
> > according to --enable-extern-template=yes/no settings). in fact, this sed rule also produces
> > a wrong '#define _GLIBCXX_EXTERN_TEMPLATE 1 -1' in line 293:
> >
> > #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE)
> > # define _GLIBCXX_STD_C __cxx1998
> > # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
> > namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > # define _GLIBCXX_END_NAMESPACE_CONTAINER \
> > } _GLIBCXX_END_NAMESPACE_VERSION
> > # undef _GLIBCXX_EXTERN_TEMPLATE
> > # define _GLIBCXX_EXTERN_TEMPLATE 1 -1 <==== here
> > #endif
> >
> > this broken macro causes runtime errors on mingw (see PR52540).
> > attached small patch fixes all weird runtime errors for me.
>
> Should the addition be \$$ to escape it for the shell as well as for make?
> (I know it works, but that might not be true for all shells.)
i don't think that $, could be expaneded by any shell.
> The diff for Makefile.in is unnecessary, as it should be regenerated
> from Makefile.am
>
> Apart from that the patch looks good, I've CC'd gcc-patches, could you
> provide a changelog entry?
attached. i hope it's correct :)
2012-03-16 PaweÅ Sikora <pawel.sikora@agmk.net>
PR libstdc++/52540
* include/Makefile.am (c++config.h): Fix sed rule to not break
the _GLIBCXX_EXTERN_TEMPLATE redefinition.
* include/Makefile.in: Regenerated.