[PATCH v2] libstdc++: Make certain exceptions transaction_safe.
Torvald Riegel
triegel@redhat.com
Sun Jan 17 20:21:00 GMT 2016
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).
The attached patch works around this by always definining stubs for the
libitm functions, yet declaring them weak at the same time. If
__GXX_WEAK__ is not supplied, the transactional clones aren't built at
all. This tests fine on x86_64-linux, and I suppose that it should work
on AIX too (but I haven't tested). Is it harmless if gnu.pre lists
symbols that we don't provide?
Thoughts?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libstdc++-weak-fix.patch
Type: text/x-patch
Size: 2387 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20160117/9f401a40/attachment.bin>
More information about the Libstdc++
mailing list