Patchwork [google] Build libstdc++ exception throwing code with frame pointers (issue4348050)

login
register
mail settings
Submitter Paul Pluzhnikov
Date April 4, 2011, 9:05 p.m.
Message ID <20110404210505.0E2A91909EB@elbrus2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/89710/
State New
Headers show

Comments

Paul Pluzhnikov - April 4, 2011, 9:05 p.m.
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  <ppluzhnikov@google.com>

	* 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
Diego Novillo - April 5, 2011, 7:06 a.m.
On Mon, Apr 4, 2011 at 23:05, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:

> 2011-04-04  Paul Pluzhnikov  <ppluzhnikov@google.com>
>
>        * 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.

Remove the '(revision 171950)' strings.


>
> 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

Does this mean that this is not intended to go to trunk ever?  If so,
it may make more sense to put this in google/integration instead of
google/main.


Diego.

Patch

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: