[debug/profile-mode] broken c++config.h

Jonathan Wakely jwakely.gcc@gmail.com
Fri Mar 16 15:31:00 GMT 2012


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.)

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?

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-extern-template-sed.patch
Type: text/x-patch
Size: 1654 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20120316/4eb2d7ad/attachment.bin>


More information about the Libstdc++ mailing list