This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH v2] libstdc++: Make certain exceptions transaction_safe.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, Torvald Riegel <triegel 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: Sat, 16 Jan 2016 14:35:22 +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>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
#if __GXX_WEAK__
// Declare all libitm symbols we rely on, but make them weak so that we do
// not depend on libitm.
extern void* _ZGTtnaX (size_t sz) __attribute__((weak));
extern void _ZGTtdlPv (void* ptr) __attribute__((weak));
extern uint8_t _ITM_RU1(const uint8_t *p)
ITM_REGPARM __attribute__((weak));
extern uint32_t _ITM_RU4(const uint32_t *p)
ITM_REGPARM __attribute__((weak));
extern uint64_t _ITM_RU8(const uint64_t *p)
ITM_REGPARM __attribute__((weak));
extern void _ITM_memcpyRtWn(void *, const void *, size_t)
ITM_REGPARM __attribute__((weak));
extern void _ITM_memcpyRnWt(void *, const void *, size_t)
ITM_REGPARM __attribute__((weak));
extern void _ITM_addUserCommitAction(void (*)(void *), uint64_t, void *)
ITM_REGPARM __attribute__((weak));
#else
// If there is no support for weak symbols, create dummies. The exceptions
// will not be declared transaction_safe in this case.
void* _ZGTtnaX (size_t) { return NULL; }
void _ZGTtdlPv (void*) { }
uint8_t _ITM_RU1(const uint8_t *) { return 0; }
uint32_t _ITM_RU4(const uint32_t *) { return 0; }
uint64_t _ITM_RU8(const uint64_t *) { return 0; }
void _ITM_memcpyRtWn(void *, const void *, size_t) { }
void _ITM_memcpyRnWt(void *, const void *, size_t) { }
void _ITM_addUserCommitAction(void (*)(void *), uint64_t, void *) { };
#endif
Jakub