This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] libstdc++: Make certain exceptions transaction_safe.
- From: Torvald Riegel <triegel at redhat dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Jonathan Wakely <jwakely at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 18 Jan 2016 17:30:44 +0100
- Subject: Re: [PATCH v2] libstdc++: Make certain exceptions transaction_safe.
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnymZpixht_LqsS6ZEDLPnrymcb_sm0zU_pPFDYsjwpQqbA at mail dot gmail dot com> <20160116124323 dot GM15084 at redhat dot com> <CAGWvnynBY3Zh+43Heu0Wkea5P3164XV=09+QOKqUUBGgREGR4Q at mail dot gmail dot com> <20160116133521 dot GN3017 at tucnak dot redhat dot com> <CAGWvny=z0bERxs-ksP=wwoyw9hPZFZoJ8Mq7TcnkA=yTJarwaQ at mail dot gmail dot com> <1453062105 dot 26597 dot 419 dot camel at localhost dot localdomain> <CAGWvnyn4w6rUDvej9q=gseNKE1BhZb30eyw-DY5qWchqFXAk8g at mail dot gmail dot com> <1453125282 dot 26597 dot 422 dot camel at localhost dot localdomain>
On Mon, 2016-01-18 at 14:54 +0100, Torvald Riegel wrote:
> On Sun, 2016-01-17 at 18:30 -0500, David Edelsohn wrote:
> > On Sun, Jan 17, 2016 at 3:21 PM, Torvald Riegel <triegel@redhat.com> wrote:
> > > On Sat, 2016-01-16 at 15:38 -0500, David Edelsohn wrote:
> > >> On Sat, Jan 16, 2016 at 8:35 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > >> > On Sat, Jan 16, 2016 at 07:47:33AM -0500, David Edelsohn wrote:
> > >> >> stage1 libstdc++ builds just fine. the problem is stage2 configure
> > >> >> fails due to missing ITM_xxx symbols when configure tries to compile
> > >> >> and run conftest programs.
> > >> >
> > >> > On x86_64-linux, the _ITM_xxx symbols are undef weak ones and thus it is
> > >> > fine to load libstdc++ without libitm and libstdc++ doesn't depend on
> > >> > libitm.
> > >> >
> > >> > So, is AIX defining __GXX_WEAK__ or not? Perhaps some other macro or
> > >> > configure check needs to be used to determine if undefined weak symbols
> > >> > work the way libstdc++ needs them to.
> > >>
> > >> __GXX_WEAK__ appears to be defined by gcc/c-family/c-cppbuiltin.c
> > >> based on SUPPORTS_ONE_ONLY. gcc/defaults.h defines SUPPORTS_ONE_ONLY
> > >> if the target supports MAKE_DECL_ONE_ONLY and link-once semantics.
> > >> AIX weak correctly supports link-once semantics. AIX also supports
> > >> the definition of __GXX_WEAK__ in gcc/doc/cpp.texi, namely collapsing
> > >> symbols with vague linkage in multiple translation units.
> > >>
> > >> libstdc++/src/c++11/cow-stdexcept.cc appears to be using __GXX_WEAK__
> > >> and __attribute__ ((weak)) for references to symbols that may not be
> > >> defined at link time or run time. AIX does not allow undefined symbol
> > >> errors by default. And the libstdc++ inference about the semantics of
> > >> __GXX_WEAK__ are different than the documentation.
> > >>
> > >> AIX supports MAKE_DECL_ONE_ONLY and the documented meaning of
> > >> __GXX_WEAK__. AIX does not support extension of the meaning to
> > >> additional SVR4 semantics not specified in the documentation.
> > >
> > > I see, so we might be assuming that __GXX_WEAK__ means more than it
> > > actually does (I'm saying "might" because personally, I don't know; your
> > > information supports this is the case, but the initial info I got was
> > > that __GXX_WEAK__ would mean we could have weak decls without
> > > definitions).
> >
> > I believe that libstdc++ must continue with the weak undefined
> > references to the symbols as designed, but protect them with a
> > different macro. For example, __GXX_WEAK_REF__ or __GXX_WEAK_UNDEF__
> > defined in defaults.h based on configure test or simply overridden in
> > config/rs6000/aix.h. Or the macro could be local to libstdc++ and
> > overridden in config/os/aix/os_defines.h.
>
> OK. I'm currently testing the attached patch on x86_64-linux.
No regressions in the libstdc++ and libitm tests on x86_64-linux.