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: Dominique d'Humières <dominiq at lps dot ens dot fr>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jack Howarth <howarth at bromo dot med dot uc dot edu>
- Date: Tue, 19 Jan 2016 20:10:46 +0100
- Subject: Re: [PATCH v2] libstdc++: Make certain exceptions transaction_safe.
- Authentication-results: sourceware.org; auth=none
- References: <1EF9008F-5418-4A35-AA1F-9931E464B0AA at lps dot ens dot fr>
On Sat, 2016-01-16 at 10:57 +0100, Dominique d'HumiÃres wrote:
> > Addressed these, fixed a problem with using GLIBCXX_WEAK_DEFINITION
> > (which is only set on Darwin despite the generic-sounding name -- so
> > just use __attribute__((weak)) directly), and also updated
> > testsuite_abi.cc so that it knows about CXXABI_1.3.10.
> >
> > Approved by Jonathan Wakely. Committed as r232454.
> This breaks bootstrap on darwin, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69310.
Please give this patch a try. I've only tested it on x86_64-linux.
Jon, okay from your side if Darwin testing succeeds?
commit 6987f84f278d2cbf5b828a8c81c1be84b292b1af
Author: Torvald Riegel <triegel@redhat.com>
Date: Tue Jan 19 18:36:14 2016 +0100
libstdc: Use weak alias instead of just alias in TM support.
PR libstdc++/69310
* src/c++11/cow-stdexcept.cc: Use weak alias instead of just alias
to make Darwin happy.
diff --git a/libstdc++-v3/src/c++11/cow-stdexcept.cc b/libstdc++-v3/src/c++11/cow-stdexcept.cc
index a0f505c..a070747 100644
--- a/libstdc++-v3/src/c++11/cow-stdexcept.cc
+++ b/libstdc++-v3/src/c++11/cow-stdexcept.cc
@@ -364,7 +364,9 @@ _ZGTtNSt##NAME##C1EPKc (CLASS* that, const char* s) \
construct the COW string in the latter manually. Note that the \
exception classes will not be declared transaction_safe if the \
shared empty _Rep is disabled with --enable-fully-dynamic-string \
- (in which case _GLIBCXX_FULLY_DYNAMIC_STRING is nonzero). */ \
+ (in which case _GLIBCXX_FULLY_DYNAMIC_STRING is nonzero). \
+ The alias declarations are also declared weak because Darwin \
+ doesn't support non-weak aliases. */ \
CLASS e(""); \
_ITM_memcpyRnWt(that, &e, sizeof(CLASS)); \
_txnal_cow_string_C1_for_exceptions(_txnal_##BASE##_get_msg(that), \
@@ -372,7 +374,7 @@ _ZGTtNSt##NAME##C1EPKc (CLASS* that, const char* s) \
} \
void \
_ZGTtNSt##NAME##C2EPKc (CLASS*, const char*) \
- __attribute__((alias ("_ZGTtNSt" #NAME "C1EPKc"))); \
+ __attribute__((weak, alias ("_ZGTtNSt" #NAME "C1EPKc"))); \
void \
_ZGTtNSt##NAME##C1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE( \
CLASS* that, const std::__sso_string& s) \
@@ -393,7 +395,7 @@ _ZGTtNSt##NAME##D1Ev(CLASS* that) \
{ _txnal_cow_string_D1(_txnal_##BASE##_get_msg(that)); } \
void \
_ZGTtNSt##NAME##D2Ev(CLASS*) \
-__attribute__((alias ("_ZGTtNSt" #NAME "D1Ev"))); \
+__attribute__((weak, alias ("_ZGTtNSt" #NAME "D1Ev"))); \
void \
_ZGTtNSt##NAME##D0Ev(CLASS* that) \
{ \