GCJ + JSR231: Any success?

I’m trying to run a JOGL application (e.g. Eclipse SWT Snippet 209: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet209.java) with a recent JSR231 build, but I’m only getting the error “Xlib: unexpected async reply”.
I once had a gcj 4.0 on a suse box that worked, but on my current ubuntu 6.06 both gcj 4.1 and gcj 4.0 fail with the above error for SWT and AWT demos.
Has anyone had more success?

Yours,
Stefan

Are you using the latest JOGL nightly build? Some bugs have been fixed recently in this area.

Does the application work with the Sun JDK? If so, this is probably a bug in the JAWT implementation in GCJ. JOGL requires that the “AWT lock” be held both while locking the “drawing surface” associated with a heavyweight component as well as when the Lock() function pointer inside the JAWT struct is called. There was actually a bug in the Mustang JDK in this area that was fixed only recently. If this appears to be the issue (because things work on the Sun JDK), ou should probably find a forum covering GCJ and post this question along with this information there.

Thanks Ken for your answer - I absolutely appreciate your efforts for JOGL!

I’m using the latest nightly build and the xlib error occurs for both SWT and AWT on gcj4.0 and gcj4.1, but both the application with SWT and AWT and the Snippet run fine on Sun JDKs and IBM JDKs. I didn’t find any suitable forum for gcj except the gcj developer mailing list and hoped that maybe someone else here has found a solution or can confirm that it currently doesn’t work.

Try using gcj in conjunction with JSR-231 beta 3 and see whether you get any further. The locking JOGL does internally has changed considerably since beta 3 and now stresses the correctness of the JAWT implementation more than it used to. I’m aware that JOGL used to work with GCJ at one point.

One of our users of the SWT version of JOGL has it running under GCJ. There are several changes that need to be made but cannot be sent back to the main codebase (I’ve offered these to Ken before, but turned down for reasonable reasons). The biggest change that needs to be made is the removal of all dynamic loading. Class.forName() is not compatible with the GCJ compilation. I have a collection of patches here that could be sent on if you’re interested. They are relative to our version of JOGL rather than the main reference implementation, but almost everything applies to both versions.

With beta2 the Snippet runs - but only somethimes. My application fails constantly. I think I’ll give up.

Mithrandir, thanks for your offer, I’ll come back to that once the JSR has been released :wink: