From patchwork Mon Sep 22 00:58:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 391775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D41B914012C for ; Mon, 22 Sep 2014 10:58:27 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:in-reply-to:subject:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=qd4 bJ+GcnVD1ZPEs7dAL/sTn3SMcGk4iGpz8/lBBwKPDTozsiGFoH1IgJGCSzKP25ao EUTzSufVq4yrnYJ3Nudv/e8eTowL4cZ83fT3+fpYBn6nEN/Gfp201caBWbniL42I 9NnEEefvzT2wLUhi21Mz9LL1AJZZSIlb2OT1NWDo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:in-reply-to:subject:mime-version :content-type:content-transfer-encoding; s=default; bh=QgklUeOKT fH8K/ow6LQx8vlameI=; b=yTMo+W7pK5UTFkR9Noq1Hdq1C4wKOmwaOQEY+5FTL 44nvuVpToIvZALdYO1aQkETVus/FZKKPaq0ajtvqfcCj6mrQFttKwKjxbVdrFRar +kuDQ21jg2mHpPWTpKmWojqKP+HMJ0mxlDci0sM5ahRv9Mgn0XVegAZqpStgTJMc 4k= Received: (qmail 7872 invoked by alias); 22 Sep 2014 00:58:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7861 invoked by uid 89); 22 Sep 2014 00:58:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: bes.se.axis.com Received: from bes.se.axis.com (HELO bes.se.axis.com) (195.60.68.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Sep 2014 00:58:16 +0000 Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id 262F12E379 for ; Mon, 22 Sep 2014 02:58:13 +0200 (CEST) Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id N685YmhXxgng for ; Mon, 22 Sep 2014 02:58:09 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bes.se.axis.com (Postfix) with ESMTP id 3752E2E316 for ; Mon, 22 Sep 2014 02:58:09 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 1596612E7 for ; Mon, 22 Sep 2014 02:58:09 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id 09D6812DC for ; Mon, 22 Sep 2014 02:58:09 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 076993E048; Mon, 22 Sep 2014 02:58:09 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id s8M0w8QD031870; Mon, 22 Sep 2014 02:58:08 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id s8M0w8K8031866; Mon, 22 Sep 2014 02:58:08 +0200 Date: Mon, 22 Sep 2014 02:58:08 +0200 Message-Id: <201409220058.s8M0w8K8031866@ignucius.se.axis.com> From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org In-reply-to: <541BCD3C.1060201@redhat.com> (message from Jeff Law on Fri, 19 Sep 2014 08:29:16 +0200) Subject: Re: [RFA 2/2]: --enable-explicit-exception-frame-registration compatibility option MIME-Version: 1.0 > From: Jeff Law > Date: Fri, 19 Sep 2014 08:29:16 +0200 > On 09/12/14 11:51, Hans-Peter Nilsson wrote: > > Ping! > >> libgcc: > >> * crtstuff.c [EH_FRAME_SECTION_NAME && !USE_PT_GNU_EH_FRAME]: > >> Sanity-check USE_EH_FRAME_REGISTRY_ALWAYS against > >> EH_FRAME_SECTION_NAME, emit error if unsane. > >> (USE_EH_FRAME_REGISTRY): Let USE_EH_FRAME_REGISTRY_ALWAYS > >> override USE_PT_GNU_EH_FRAME. > >> * Makefile.in (FORCE_EXPLICIT_EH_REGISTRY): New > >> variable for substituted force_explicit_eh_registry. > >> (CRTSTUFF_CFLAGS): Add FORCE_EXPLICIT_EH_REGISTRY. > >> * configure.ac (explicit-exception-frame-registration): > >> New AC_ARG_ENABLE. > >> * configure: Regenerate. > OK. > jeff > Thanks! JFTR, here's the boring rebase needed as per jsm28's s/EH_FRAME_SECTION_NAME/_LIBGCC_EH_FRAME_SECTION_NAME_/g. I started a native build on x86_64-linux and --explicit-exception-frame-registration with this patch and observed it build the first-stage libstdc++.so and inspected the result and crtbegin.o as a sanity-check, as I can't trust myself not to typo. :) libgcc: * crtstuff.c (USE_EH_FRAME_REGISTRY): Let USE_EH_FRAME_REGISTRY_ALWAYS override USE_PT_GNU_EH_FRAME. [__LIBGCC_EH_FRAME_SECTION_NAME__ && !USE_PT_GNU_EH_FRAME]: Sanity- check USE_EH_FRAME_REGISTRY_ALWAYS against __LIBGCC_EH_FRAME_SECTION_NAME__, emit error if unsane. * Makefile.in (FORCE_EXPLICIT_EH_REGISTRY): New variable for substituted force_explicit_eh_registry. (CRTSTUFF_CFLAGS): Add FORCE_EXPLICIT_EH_REGISTRY. * configure.ac (explicit-exception-frame-registration): New AC_ARG_ENABLE. * configure: Regenerate. Index: libgcc/Makefile.in =================================================================== --- libgcc/Makefile.in (revision 215439) +++ libgcc/Makefile.in (working copy) @@ -50,6 +50,8 @@ target_noncanonical = @target_noncanonic # The rules for compiling them should be in the t-* file for the machine. EXTRA_PARTS = @extra_parts@ +FORCE_EXPLICIT_EH_REGISTRY = @force_explicit_eh_registry@ + extra-parts = libgcc-extra-parts # Multilib support variables. @@ -283,7 +285,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ -finhibit-size-directive -fno-inline -fno-exceptions \ -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ - -fbuilding-libgcc -fno-stack-protector \ + -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \ $(INHIBIT_LIBC_CFLAGS) # Extra flags to use when compiling crt{begin,end}.o. Index: libgcc/configure.ac =================================================================== --- libgcc/configure.ac (revision 215439) +++ libgcc/configure.ac (working copy) @@ -262,6 +262,22 @@ no) ;; esac +AC_ARG_ENABLE([explicit-exception-frame-registration], + [AC_HELP_STRING([--enable-explicit-exception-frame-registration], + [register exception tables explicitly at module start, for use + e.g. for compatibility with installations without PT_GNU_EH_FRAME support])], +[ +force_explicit_eh_registry= +if test "$enable_explicit_exception_frame_registration" = yes; then + if test "$enable_sjlj_exceptions" = yes; then + AC_MSG_ERROR([Can't enable both of --enable-sjlj-exceptions + and --enable-explicit-exception-frame-registration]) + fi + force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS +fi +]) +AC_SUBST([force_explicit_eh_registry]) + AC_LIB_PROG_LD_GNU AC_MSG_CHECKING([for thread model used by GCC]) Index: libgcc/crtstuff.c =================================================================== --- libgcc/crtstuff.c (revision 215439) +++ libgcc/crtstuff.c (working copy) @@ -131,7 +131,12 @@ call_ ## FUNC (void) \ # define USE_PT_GNU_EH_FRAME #endif -#if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) && !defined(USE_PT_GNU_EH_FRAME) +#ifdef USE_EH_FRAME_REGISTRY_ALWAYS +# ifndef __LIBGCC_EH_FRAME_SECTION_NAME__ +# error "Can't use explicit exception-frame-registration without __LIBGCC_EH_FRAME_SECTION_NAME__" +# endif +#endif +#if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) && (!defined(USE_PT_GNU_EH_FRAME) || defined(USE_EH_FRAME_REGISTRY_ALWAYS)) # define USE_EH_FRAME_REGISTRY #endif #if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) \