From patchwork Mon Apr 4 21:05:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 89710 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]) by ozlabs.org (Postfix) with SMTP id 92A83B6FC1 for ; Tue, 5 Apr 2011 07:05:17 +1000 (EST) Received: (qmail 23607 invoked by alias); 4 Apr 2011 21:05:15 -0000 Received: (qmail 23598 invoked by uid 22791); 4 Apr 2011 21:05:14 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Apr 2011 21:05:08 +0000 Received: from kpbe12.cbf.corp.google.com (kpbe12.cbf.corp.google.com [172.25.105.76]) by smtp-out.google.com with ESMTP id p34L561p003991; Mon, 4 Apr 2011 14:05:06 -0700 Received: from elbrus2.mtv.corp.google.com (elbrus2.mtv.corp.google.com [172.18.116.96]) by kpbe12.cbf.corp.google.com with ESMTP id p34L551S017109; Mon, 4 Apr 2011 14:05:05 -0700 Received: by elbrus2.mtv.corp.google.com (Postfix, from userid 74925) id 0E2A91909EB; Mon, 4 Apr 2011 14:05:04 -0700 (PDT) To: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org Subject: [google] Build libstdc++ exception throwing code with frame pointers (issue4348050) Message-Id: <20110404210505.0E2A91909EB@elbrus2.mtv.corp.google.com> Date: Mon, 4 Apr 2011 14:05:04 -0700 (PDT) From: ppluzhnikov@google.com (Paul Pluzhnikov) X-System-Of-Record: true 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 This patch builds code which throws exceptions with -fno-omit-frame-pointer, so frame-based unwinder can unwind through it. To be applied only to google/main branch. Tested by buildit bootstrap, verified in the build log that -fno-omit-frame-pointer is applied to functexcept, eh_throw and eh_terminate. 2011-04-04 Paul Pluzhnikov * libstdc++-v3/src/Makefile.am (revision 171950): Add -fno-omit-frame-pointer to functexcept. * libstdc++-v3/libsupc++/Makefile.am (revision 171950): Add -fno-omit-frame-pointer to eh_throw and eh_terminate. * libstdc++-v3/src/Makefile.in (revision 171950): Regenerate. * libstdc++-v3/libsupc++/Makefile.in (revision 171950): Regenerate. --- This patch is available for review at http://codereview.appspot.com/4348050 Index: libstdc++-v3/src/Makefile.am =================================================================== --- libstdc++-v3/src/Makefile.am (revision 171950) +++ libstdc++-v3/src/Makefile.am (working copy) @@ -395,7 +395,8 @@ $(XTEMPLATE_FLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) # libstdc++ libtool notes @@ -469,3 +470,6 @@ install_debug: (cd ${debugdir} && $(MAKE) \ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) + +# Google-specific pessimization +functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer Index: libstdc++-v3/libsupc++/Makefile.am =================================================================== --- libstdc++-v3/libsupc++/Makefile.am (revision 171950) +++ libstdc++-v3/libsupc++/Makefile.am (working copy) @@ -106,7 +106,8 @@ $(LIBSUPCXX_PICFLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -211,3 +212,7 @@ q=`echo $$p | sed -e 's,.*/,,'`; \ rm -f $(DESTDIR)$(bitsdir)/$$q; \ done + +# Google-specific pessimization +eh_terminate.lo_no_omit_frame_pointer = -fno-omit-frame-pointer +eh_throw.lo_no_omit_frame_pointer = -fno-omit-frame-pointer Index: libstdc++-v3/src/Makefile.in =================================================================== --- libstdc++-v3/src/Makefile.in (revision 171950) +++ libstdc++-v3/src/Makefile.in (working copy) @@ -484,7 +484,8 @@ $(XTEMPLATE_FLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) # libstdc++ libtool notes @@ -522,6 +523,9 @@ $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ debugdir = debug + +# Google-specific pessimization +functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer all: all-am .SUFFIXES: Index: libstdc++-v3/libsupc++/Makefile.in =================================================================== --- libstdc++-v3/libsupc++/Makefile.in (revision 171950) +++ libstdc++-v3/libsupc++/Makefile.in (working copy) @@ -412,7 +412,8 @@ $(LIBSUPCXX_PICFLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -476,6 +477,10 @@ # prepending each of $(*_HEADERS) with VPATH below. stddir = $(gxx_include_dir) bitsdir = $(gxx_include_dir)/bits + +# Google-specific pessimization +eh_terminate.lo_no_omit_frame_pointer = -fno-omit-frame-pointer +eh_throw.lo_no_omit_frame_pointer = -fno-omit-frame-pointer all: all-am .SUFFIXES: