This is the mail archive of the java@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]

Re: FYI: Updated "Building GCJ for Windows"


Hello Ranjit

Thank you for the tutorial! Great work!
For GCC 4.1.1 I additionally needed these patches (didn't use the ones you mentioned):


Before building the compiler running on linux building for windows:
-patch-natSharedLibLoader (http://gcc.gnu.org/ml/java-patches/2006-q2/msg00091.html)
Compilation of gcc will fail with "./java/lang/reflect/Modifier.h:41: error: expected unqualified-id before numeric constant" withhout this patch


Before building the compiler running on windows building for windows:
- patch-start (http://gcc.gnu.org/ml/java/2006-04/msg00010.html)
  Withhout this patch, compiled programs won't do anything on windows
- patch-jni (http://gcc.gnu.org/ml/java/2006-02/msg00066.html)
  Withhout this patch, JNI won't work (thus SWT fails)...


Open problems with gcc4.1.1 on windows (as far as I encountered):


- reflection (Class.forName(...)) is broken
Classes won't be found be Class.forName() (thus throwing an ClassNotFoundException).
Any Ideas? I once read something in the archives, but I'm really unable to find it again... I hope there's a solution for this.


- serialisation seems to be broken too
Writing to files works, loading again fails with (if I remember right) ClassNotFoundExceptions... Might be because of the reflection problem. my solution was to write good old ordinary config files


- stacktraces are unusuable
Whats the state? I'm relatively new to this list and it seems to be an old problem. Something like dwarf would be better than sjil exceptions but don't works on windows or would need a big deal to implement; there's no active windows maintainer so this keeps open? Am I more or less in the picture?


- uses of the regexp (e.g. String.split()) classes will fail with: java.util.MissingResourceException: Bundle gnu/regexp/MessagesBundle not found
Workaround: http://lists.debian.org/debian-gcc/2005/09/msg00141.html
better Workaround: put the gnu/regexp/MessagesBundle into a jar and compile it too, so it will be builtin.



regards Marco


Ranjit Mathew wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've updated my "Building GCJ for Windows" article:

http://rmathew.com/articles/gcj/bldgcj.html

as well as the associated scripts to work with the latest
GCC sources.

At the moment of this writing, you will need these patches:

  http://gcc.gnu.org/ml/java-patches/2006-q2/msg00285.html
  http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00410.html

for the mainline to be able to build GCJ for MinGW.

MinGW really needs to get the libgcj.dll thing working.
Right now each of the executables statically linked
with libgcj (like gij.exe, jv-convert.exe, etc.) are *huge* - about
40MB before stripping off debugging information and about 15MB
after that. :-(

The compiler is able to create binaries and I've done almost
no testing beyond "Hello World!", though I notice that the
stack traces are completely busted.

HTH,
Ranjit.

- --
Ranjit Mathew       Email: rmathew AT gmail DOT com

Bangalore, INDIA. Web: http://rmathew.com/




-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEiZ+hYb1hx2wRS48RAnAmAJ9s3ldi7zxjr4Im8t3KUk4F2L+7DgCcDA2g
tRriUTZPMrpdqHJQ6QNhMQs=
=SMMa
-----END PGP SIGNATURE-----


--- gcc/unwind-sjlj.c
+++ gcc/unwind-sjlj.c
@@ -265,7 +265,7 @@
   else
     {
       fs->personality = context->fc->personality;
-      return _URC_NO_REASON;
+      return context->fc->prev != NULL ? _URC_NO_REASON : _URC_END_OF_STACK;
     }
 }
--- libjava/gnu/gcj/runtime/natSharedLibLoader.cc
+++ libjava/gnu/gcj/runtime/natSharedLibLoader.cc
@@ -11,11 +11,12 @@
 #include <config.h>
 
 // If we're using the Boehm GC, then we need this include to override dlopen.
+#include <gcj/cni.h>
+
 #ifdef HAVE_BOEHM_GC
 #include <gc.h>
 #endif /* HAVE_BOEHM_GC */
 
-#include <gcj/cni.h>
 #include <jvm.h>
 #include <execution.h>
 
--- libjava/configure.host
+++ libjava/configure.host
@@ -260,6 +260,7 @@
 	slow_pthread_self=
 	;;
   *-mingw*)
+	libgcj_flags="${libgcj_flags} -fno-omit-frame-pointer"
   	# FIXME: win32_exception_handler( ) in win32.cc does not do the
 	# right stuff yet w.r.t. SEH. Live with the following for now.
 	can_unwind_signal=no

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