From: Andrew Haley <aph@redhat.com>
To: Java Patch List <java-patches@gcc.gnu.org>
Subject: Compile all native code with '-fexceptions -fasynchronous-unwind-tables'
Date: Tue, 24 Jun 2008 13:35:00 -0000 [thread overview]
Message-ID: <4860F800.9060005@redhat.com> (raw)
We haven't been compiling all JNI code with -fexceptions, and on ARM this has
the unfortunate effect of causing the VM to hang when generating stack traces.
-fasynchronous-unwind-tables is used here because it adds little to the size
of the unwinder data and can generate more useful traces when we e.g trap
on a segfault.
I committed this in libjava and upstream Classpath.
Andrew.
2008-06-11 Andrew Haley <aph@redhat.com>
* native/jawt/Makefile.am,
native/fdlibm/Makefile.am,
native/jni/java-util/Makefile.am,
native/jni/gstreamer-peer/Makefile.am,
native/jni/native-lib/Makefile.am,
native/jni/gconf-peer/Makefile.am,
native/jni/gtk-peer/Makefile.am,
native/jni/xmlj/Makefile.am,
native/jni/midi-alsa/Makefile.am,
native/jni/java-nio/Makefile.am,
native/jni/midi-dssi/Makefile.am,
native/jni/classpath/Makefile.am,
native/jni/java-io/Makefile.am,
native/jni/java-lang/Makefile.am,
native/jni/java-net/Makefile.am (AM_CFLAGS): Add @EXTRA_CFLAGS@.
* configure.ac (EXTRA_CFLAGS): New macro.
* lib/Makefile.am (resources): Add .svn.
Index: classpath/native/jni/classpath/Makefile.am
===================================================================
--- classpath/native/jni/classpath/Makefile.am (revision 137040)
+++ classpath/native/jni/classpath/Makefile.am (working copy)
@@ -8,4 +8,5 @@
AM_LDFLAGS = @CLASSPATH_CONVENIENCE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/gstreamer-peer/Makefile.in
===================================================================
--- classpath/native/jni/gstreamer-peer/Makefile.in (revision 137040)
+++ classpath/native/jni/gstreamer-peer/Makefile.in (working copy)
@@ -165,6 +165,7 @@
ERROR_CFLAGS = @ERROR_CFLAGS@
EXAMPLESDIR = @EXAMPLESDIR@
EXEEXT = @EXEEXT@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
FASTJAR = @FASTJAR@
FGREP = @FGREP@
FIND = @FIND@
@@ -361,7 +362,8 @@
# gstreamer contain broken prototypes (by design).
AM_CFLAGS = @WARNING_CFLAGS@ -Wno-write-strings -Wno-missing-field-initializers \
@ERROR_CFLAGS@ -Wno-unused-parameter @GSTREAMER_BASE_CFLAGS@ \
- @GDK_CFLAGS@ @GSTREAMER_CFLAGS@ @GSTREAMER_PLUGINS_BASE_CFLAGS@
+ @GDK_CFLAGS@ @GSTREAMER_CFLAGS@ @GSTREAMER_PLUGINS_BASE_CFLAGS@ \
+ @EXTRA_CFLAGS@
all: all-am
Index: classpath/native/jni/gstreamer-peer/Makefile.am
===================================================================
--- classpath/native/jni/gstreamer-peer/Makefile.am (revision 137040)
+++ classpath/native/jni/gstreamer-peer/Makefile.am (working copy)
@@ -19,4 +19,5 @@
# gstreamer contain broken prototypes (by design).
AM_CFLAGS = @WARNING_CFLAGS@ -Wno-write-strings -Wno-missing-field-initializers \
@ERROR_CFLAGS@ -Wno-unused-parameter @GSTREAMER_BASE_CFLAGS@ \
- @GDK_CFLAGS@ @GSTREAMER_CFLAGS@ @GSTREAMER_PLUGINS_BASE_CFLAGS@
+ @GDK_CFLAGS@ @GSTREAMER_CFLAGS@ @GSTREAMER_PLUGINS_BASE_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/midi-dssi/Makefile.am
===================================================================
--- classpath/native/jni/midi-dssi/Makefile.am (revision 137040)
+++ classpath/native/jni/midi-dssi/Makefile.am (working copy)
@@ -12,4 +12,4 @@
# No STRICT_WARNING_CFLAGS here as we use dlsym to load the address of
# a function,and ISO C prohibits casting void pointers, like those returned
# by dlsym, to function pointers.
-AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ @EXTRA_CFLAGS@
Index: classpath/native/jni/gconf-peer/Makefile.am
===================================================================
--- classpath/native/jni/gconf-peer/Makefile.am (revision 137040)
+++ classpath/native/jni/gconf-peer/Makefile.am (working copy)
@@ -10,4 +10,5 @@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ @GCONF_CFLAGS@ @GDK_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ @GCONF_CFLAGS@ @GDK_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/java-io/Makefile.am
===================================================================
--- classpath/native/jni/java-io/Makefile.am (revision 137040)
+++ classpath/native/jni/java-io/Makefile.am (working copy)
@@ -9,4 +9,5 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/native-lib/Makefile.am
===================================================================
--- classpath/native/jni/native-lib/Makefile.am (revision 137040)
+++ classpath/native/jni/native-lib/Makefile.am (working copy)
@@ -9,4 +9,5 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/java-util/Makefile.am
===================================================================
--- classpath/native/jni/java-util/Makefile.am (revision 137040)
+++ classpath/native/jni/java-util/Makefile.am (working copy)
@@ -4,4 +4,6 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
+
Index: classpath/native/jni/java-lang/Makefile.am
===================================================================
--- classpath/native/jni/java-lang/Makefile.am (revision 137040)
+++ classpath/native/jni/java-lang/Makefile.am (working copy)
@@ -16,4 +16,5 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@ -I$(top_srcdir)/native/fdlibm
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/midi-alsa/Makefile.am
===================================================================
--- classpath/native/jni/midi-alsa/Makefile.am (revision 137040)
+++ classpath/native/jni/midi-alsa/Makefile.am (working copy)
@@ -9,4 +9,5 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@ `pkg-config --cflags-only-I alsa`
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ `pkg-config --cflags-only-other alsa`
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ `pkg-config --cflags-only-other alsa` \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/java-nio/Makefile.am
===================================================================
--- classpath/native/jni/java-nio/Makefile.am (revision 137040)
+++ classpath/native/jni/java-nio/Makefile.am (working copy)
@@ -20,4 +20,5 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/java-net/Makefile.am
===================================================================
--- classpath/native/jni/java-net/Makefile.am (revision 137040)
+++ classpath/native/jni/java-net/Makefile.am (working copy)
@@ -22,4 +22,5 @@
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@ \
+ @EXTRA_CFLAGS@
Index: classpath/native/jni/xmlj/Makefile.am
===================================================================
--- classpath/native/jni/xmlj/Makefile.am (revision 137040)
+++ classpath/native/jni/xmlj/Makefile.am (working copy)
@@ -22,6 +22,7 @@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
# Don't enable ERROR flags. Code isn't warning free yet.
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @XML_CFLAGS@ @XSLT_CFLAGS@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @XML_CFLAGS@ \
+ @XSLT_CFLAGS@ @EXTRA_CFLAGS@
EXTRA_DIST = BUGS
Index: classpath/native/jni/gtk-peer/Makefile.am
===================================================================
--- classpath/native/jni/gtk-peer/Makefile.am (revision 137040)
+++ classpath/native/jni/gtk-peer/Makefile.am (working copy)
@@ -58,4 +58,4 @@
# headers contain broken prototypes (by design, see gtkitemfactory.h).
AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ \
@GTK_CFLAGS@ @FREETYPE2_CFLAGS@ @PANGOFT2_CFLAGS@ \
- @X_CFLAGS@
+ @X_CFLAGS@ @EXTRA_CFLAGS@
Index: classpath/native/jawt/Makefile.am
===================================================================
--- classpath/native/jawt/Makefile.am (revision 137040)
+++ classpath/native/jawt/Makefile.am (working copy)
@@ -10,4 +10,4 @@
# Just the WARNING_CFLAGS. We cannot use the strict flags since the gtk
# headers contain broken prototypes (by design, see gtkitemfactory.h).
AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ \
- @GTK_CFLAGS@ @PANGOFT2_CFLAGS@
+ @GTK_CFLAGS@ @PANGOFT2_CFLAGS@ @EXTRA_CFLAGS@
Index: classpath/native/fdlibm/Makefile.am
===================================================================
--- classpath/native/fdlibm/Makefile.am (revision 137040)
+++ classpath/native/fdlibm/Makefile.am (working copy)
@@ -60,6 +60,6 @@
AM_LDFLAGS = @CLASSPATH_CONVENIENCE@
-# We just want the standard flags for fdlibm since it is an upstream lib
-# and our normal -pedantic -Wall -Werror breaks this lib. So no AM_CFLAGS.
-# We also don't need extra includes, so no AM_CPPFLAGS either.
+AM_CFLAGS = @EXTRA_CFLAGS@
+
+# We don't need extra includes, so no AM_CPPFLAGS.
Index: classpath/configure.ac
===================================================================
--- classpath/configure.ac (revision 137040)
+++ classpath/configure.ac (working copy)
@@ -503,6 +503,12 @@
WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
AC_SUBST(WARNING_CFLAGS)
+ dnl CFLAGS that are used for all native code. We want to compile
+ dnl everything with unwinder data so that backtrace() will always
+ dnl work.
+ EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables'
+ AC_SUBST(EXTRA_CFLAGS)
+
dnl Strict warning flags which not every module uses.
dnl Should probably be configurable.
STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
Index: classpath/lib/Makefile.am
===================================================================
--- classpath/lib/Makefile.am (revision 137040)
+++ classpath/lib/Makefile.am (working copy)
@@ -96,7 +96,7 @@
if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
cp $(top_srcdir)/resource/$$p $$p; \
done
- @list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name \*\.in -prune -o -type f -print`; for p in $$list; do \
+ @list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name .svn -prune -o -name \*\.in -prune -o -type f -print`; for p in $$list; do \
dirname=`dirname $$p`; \
if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
cp $(top_srcdir)/resource/$$p $$p; \
reply other threads:[~2008-06-24 13:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4860F800.9060005@redhat.com \
--to=aph@redhat.com \
--cc=java-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).