From patchwork Tue Dec 16 22:35:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 4284 Received: (qmail 28032 invoked by alias); 16 Dec 2014 22:36:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28023 invoked by uid 89); 16 Dec 2014 22:36:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Use pragmas rather than makefiles for necessary options for unwind code. Message-Id: <20141216223558.6CADB2C2446@topped-with-meat.com> Date: Tue, 16 Dec 2014 14:35:58 -0800 (PST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=HzL_rrrc3T9fk_aOBKUA:9 a=CjuIK1q_8ugA:10 Verified on x86_64-linux-gnu that no generated code (including unwind info) changes. Also tested arm-linux-gnueabihf that no generated code changes; there was one difference in the EABI unwind info for __unwind_freeres, which I don't understand but also deem wholly unimportant. Thanks, Roland 2014-12-16 Roland McGrath * nptl/unwind.c: Use pragma to turn on -fexceptions. * sysdeps/nptl/unwind-forcedunwind.c: Use pragma to turn on -fexceptions and -fasynchronous-unwind-tables. * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c: Likewise. * sysdeps/gnu/unwind-resume.c: Likewise. * nptl/Makefile (CFLAGS-unwind.c, CFLAGS-unwind-forcedunwind.c): Variables removed. * sysdeps/gnu/Makefile [$(subdir) = csu] (CFLAGS-unwind-resume.c): Likewise. [$(subdir) = rt] (CFLAGS-rt-unwind-resume.c): Likewise. --- a/nptl/Makefile +++ b/nptl/Makefile @@ -146,9 +146,6 @@ libpthread-static-only-routines = pthread_atfork # nptl-init.c contains sigcancel_handler(). CFLAGS-nptl-init.c = -fexceptions -fasynchronous-unwind-tables -# The unwind code itself, -CFLAGS-unwind.c = -fexceptions -CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables # The following three functions must be async-cancel safe. CFLAGS-pthread_cancel.c = -fexceptions -fasynchronous-unwind-tables --- a/nptl/unwind.c +++ b/nptl/unwind.c @@ -25,6 +25,8 @@ #include "pthreadP.h" #include +#pragma GCC optimize "-fexceptions" + #ifdef HAVE_FORCED_UNWIND #ifdef _STACK_GROWS_DOWN --- a/sysdeps/gnu/Makefile +++ b/sysdeps/gnu/Makefile @@ -79,11 +79,9 @@ endif ifeq ($(subdir),csu) routines += unwind-resume shared-only-routines += unwind-resume -CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables endif ifeq ($(subdir),rt) librt-sysdep_routines += rt-unwind-resume librt-shared-only-routines += rt-unwind-resume -CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables endif --- a/sysdeps/gnu/unwind-resume.c +++ b/sysdeps/gnu/unwind-resume.c @@ -21,6 +21,8 @@ #include #include +#pragma GCC optimize ("-fexceptions", "-fasynchronous-unwind-tables") + static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute__ ((noreturn)); static _Unwind_Reason_Code (*libgcc_s_personality) --- a/sysdeps/nptl/unwind-forcedunwind.c +++ b/sysdeps/nptl/unwind-forcedunwind.c @@ -23,6 +23,8 @@ #include #include +#pragma GCC optimize ("-fexceptions", "-fasynchronous-unwind-tables") + static void *libgcc_s_handle; static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); static _Unwind_Reason_Code (*libgcc_s_personality) --- a/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c +++ b/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c @@ -21,6 +21,8 @@ #include #include +#pragma GCC optimize ("-fexceptions", "-fasynchronous-unwind-tables") + static void *libgcc_s_handle; static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;