This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Build StackTrace differently


Andrew pointed out that StackTrace needs to be compiled without the
sibcall optimization, since otherwise the number of frames on the
stack can be different from what this code expects.

Fixed as appended.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* Makefile.in: Rebuilt.
	* Makefile.am (gnu/gcj/runtime/StackTrace.lo): New rule.
	(%.lo: %.java) Filter out StackTrace.lo.

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.353
diff -u -r1.353 Makefile.am
--- Makefile.am 13 Jan 2004 17:37:22 -0000 1.353
+++ Makefile.am 15 Jan 2004 18:25:14 -0000
@@ -452,11 +452,20 @@
 $(gtk_c_files): $(gtk_c_headers)
 
 ## FIXME: see above.
-$(javao_files) $(x_javao_files) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS): %.lo: %.java
+
+## Note: we omit StackTrace here, since it has an explicit rule a bit
+## later, and GNU make will warn in this case.
+$(filter-out gnu/gcj/runtime/StackTrace.lo, $(javao_files)) $(x_javao_files) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS): %.lo: %.java
 	$(GCJCOMPILE) -o $@ $<
 
 $(gtk_awt_peer_sources:.java=.lo): %.lo: %.java
 	$(GCJCOMPILE) -fjni -o $@ $<
+
+## A special case.  The sibcall optimization can change the number of
+## frames on the stack, and StackTrace makes assumptions about this
+## number.
+gnu/gcj/runtime/StackTrace.lo: gnu/gcj/runtime/StackTrace.java
+	$(GCJCOMPILE) -fno-optimize-sibling-calls -o $@ $<
 
 ## Pass the list of object files to libtool in a temporary file to 
 ## avoid tripping platform command line length limits.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]