This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Trouble with JAR resources
- From: Andrew Haley <aph at redhat dot com>
- To: Thomas Christensen <thomasc at thomaschristensen dot org>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 07 Jan 2009 16:36:55 +0000
- Subject: Re: Trouble with JAR resources
- References: <871vvf2k3t.fsf@thomaschristensen.org>
Thomas Christensen wrote:
> I have compiled SWT/JFACE jars to object files without any issues, but I
> have a little trouble linking them with my app.
>
> It seems I have compiled some resources from the jars into the objects,
> and they conflict, since they are present in multiple jars.
>
> The jars in question are:
>
> org.eclipse.core.commands_3.4.0.I20080509-2000.jar
> org.eclipse.equinox.common_3.4.0.v20080421-2006.jar
> org.eclipse.jface_3.4.1.M20080827-2000.jar
> org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
> org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar
>
> from Eclipse Classic 3.4.1.
>
> I issue the command:
>
> $ gcj --main=Foo org.eclipse.core.commands_3.4.0.I20080509-2000.o org.eclipse.equinox.common_3.4.0.v20080421-2006.o org.eclipse.jface_3.4.1.M20080827-2000.o org.eclipse.osgi_3.4.2.R34x_v20080826-1230.o org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.o Foo.o -o foo
>
> and get multiple link errors like these:
>
> org.eclipse.equinox.common_3.4.0.v20080421-2006.o:(.rodata+0x0): multiple definition of `java resource META__U2d_INF/ECLIPSE.SF'
> /usr/bin/ld: Warning: size of symbol `java resource META__U2d_INF/ECLIPSE.SF' changed from 9564 in org.eclipse.core.commands_3.4.0.I20080509-2000.o to 6528 in org.eclipse.equinox.common_3.4.0.v20080421-2006.o
>
> Can I avoid adding these resources when compiling the jars? Or maybe
> strip them from the object files?
Not easily. I'd either strip them from the jars before compiling or
compile with -findirect-dispatch.
Andrew.