From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41455 invoked by alias); 18 Jun 2019 08:21:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 40621 invoked by uid 89); 18 Jun 2019 08:21:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_COUK autolearn=ham version=3.3.1 spammy= X-HELO: smtp1.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp1.wavenetuk.net) (195.26.36.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jun 2019 08:21:46 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id 6103E12006A7; Tue, 18 Jun 2019 09:21:43 +0100 (BST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH, sanitizer] Wrap rethrow_primary_exception (PR 87880). From: Iain Sandoe In-Reply-To: <20190617080719.GO643@redhat.com> Date: Tue, 18 Jun 2019 08:21:00 -0000 Cc: Jakub Jelinek Content-Transfer-Encoding: quoted-printable Message-Id: References: <62358CB5-F721-4DA5-BE9F-7E9A34B2A78C@sandoe.co.uk> <20190614144754.GF19695@tucnak> <78C2E45E-6989-4DE2-A836-2A51C298822A@sandoe.co.uk> <20190616185842.GM19695@tucnak> <20190617080719.GO643@redhat.com> To: GCC Patches X-SW-Source: 2019-06/txt/msg01006.txt.bz2 > On 17 Jun 2019, at 09:07, Jonathan Wakely wrote: >=20 > On 16/06/19 20:58 +0200, Jakub Jelinek wrote: >> On Sun, Jun 16, 2019 at 07:54:42PM +0100, Iain Sandoe wrote: >>> So, I guess, unless Jonathan has plans to add __cxa_rethrow_primary_exc= eption >>> during the 10 time-frame, it=E2=80=99s correct to exclude the symbol an= yway and we should >>> bump the so version and apply trunk. >>=20 >> I don't understand why they've added it, it should be called >> std::rethrow_exception and that is how it is called in libstdc++. >=20 > std::rethrow_exception was new in C++11, so maybe they wanted to be > able to use it in C++03 code as well? (Just a guess). >=20 >>> Actually, because the way in which interposing works for Darwin is diff= erent, the only >>> symbol change in the library on Darwin is removing an "undefined dynami= c lookup". >>> So, for back-ports, I can could up with some Darwin-specific Makefike c= hange that >>> only adds the ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION=3D0 for Darwin. >>>=20 >>> So - OK for trunk with a bumped soname? >>=20 >> Yes. this is what I applied. Iain 2019-06-18 Iain Sandoe PR libsanitizer/87880 * asan/asan_interceptors.h: (ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION): New. * asan/Makefile.am (DEFS): Add=20 ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION, defined to 0. * asan/Makefile.in: Regenerated. * asan/libtool-version: Bump version. diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am index 867240d..b18ab2a 100644 --- a/libsanitizer/asan/Makefile.am +++ b/libsanitizer/asan/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS =3D -I $(top_srcdir)/include -I $(top_srcdir) # May be used by toolexeclibdir. gcc_version :=3D $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) -DEFS =3D -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_M= ACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=3D1 -DASAN_NEEDS_SEGV=3D1= -DCAN_SANITIZE_UB=3D0 +DEFS =3D -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_M= ACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=3D1 -DASAN_NEEDS_SEGV=3D1= -DCAN_SANITIZE_UB=3D0 -DASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION=3D0 if USING_MAC_INTERPOSE DEFS +=3D -DMAC_INTERPOSE_FUNCTIONS -DMISSING_BLOCKS_SUPPORT endif diff --git a/libsanitizer/asan/asan_interceptors.h b/libsanitizer/asan/asan= _interceptors.h index b599ebb..beb1dc9 100644 --- a/libsanitizer/asan/asan_interceptors.h +++ b/libsanitizer/asan/asan_interceptors.h @@ -79,7 +79,12 @@ void InitializePlatformInterceptors(); #if ASAN_HAS_EXCEPTIONS && !SANITIZER_WINDOWS && !SANITIZER_SOLARIS && \ !SANITIZER_NETBSD # define ASAN_INTERCEPT___CXA_THROW 1 -# define ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION 1 +# if ! defined(ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION) \ + || ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION +# define ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION 1 +# else +# define ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION 0 +# endif # if defined(_GLIBCXX_SJLJ_EXCEPTIONS) || (SANITIZER_IOS && defined(__arm__= )) # define ASAN_INTERCEPT__UNWIND_SJLJ_RAISEEXCEPTION 1 # else diff --git a/libsanitizer/asan/libtool-version b/libsanitizer/asan/libtool-= version index e3138f3..c509757 100644 --- a/libsanitizer/asan/libtool-version +++ b/libsanitizer/asan/libtool-version @@ -3,4 +3,4 @@ # a separate file so that version updates don't involve re-running # automake. # CURRENT:REVISION:AGE -5:0:0 +6:0:0