GCJ problem with org.xml.sax package

Bryce McKinlay mckinlay@redhat.com
Fri Aug 12 20:27:00 GMT 2005


In GCC 4.1, some parts of libgcj, including org.xml, are compiled with 
the new "binary compatibility" ABI. It isn't safe to call BC-ABI code 
from code built with the old, "C++ ABI". Building your code with the 
BC-ABI ("-findirect-dispatch") should solve the problem.

The list of packages currently built with the BC-ABI in libgcj 4.1 includes:

gnu.xml
javax.imageio
javax.xml
gnu.java.beans
gnu.java.awt.peer.gtk
org.xml
org.w3c

Currently, code that refers directly to these classes should be built 
with -findirect-dispatch.

Bryce


S. Park wrote:

> I'm experiencing some strange behavior with a simple class compiled 
> with gcj 4.1 on FreeBSD 4.11 and 5.4 IA32. It compiles and runs as is, 
> but if I subclass anything in the package org.xml.sax (e.g. by 
> uncommenting the 'extends' clause below), the executable seg faults. 
> What's strange is that I can instantiate objects of types in that same 
> package within the body of the main method. The problem only appears 
> when subtyping. The test class looks like this:
>
> import java.util.HashMap;
> import org.xml.sax.helpers.DefaultHandler;
> import org.xml.sax.InputSource;
>
>
> public class Foo .. extends DefaultHandler
> {
>       public static void main(String argv[])
>       {
>               InputSource is = new InputSource();
>               String enc = is.getEncoding();
>
>
> DefaultHandler dh = new DefaultHandler();
>
>               try
>               {
>                       dh.startDocument();
>               }
>               catch (Exception e)
>               {
>                       System.err.println(e.getMessage());
>               }
>
>
> System.out.println(enc);
>
>       }
> }
>
>
> Has anyone else run into this?
>
> Sooyoung




More information about the Java mailing list