public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Trouble with JAR resources
@ 2009-01-07 15:50 Thomas Christensen
  2009-01-07 16:37 ` Andrew Haley
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Christensen @ 2009-01-07 15:50 UTC (permalink / raw)
  To: java

Good day,

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?

		Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trouble with JAR resources
  2009-01-07 15:50 Trouble with JAR resources Thomas Christensen
@ 2009-01-07 16:37 ` Andrew Haley
  2009-01-07 17:45   ` Marco Trudel
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Haley @ 2009-01-07 16:37 UTC (permalink / raw)
  To: Thomas Christensen; +Cc: java

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trouble with JAR resources
  2009-01-07 16:37 ` Andrew Haley
@ 2009-01-07 17:45   ` Marco Trudel
  2009-01-08 11:41     ` Thomas Christensen
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Trudel @ 2009-01-07 17:45 UTC (permalink / raw)
  To: Thomas Christensen; +Cc: java

Andrew Haley wrote:
> 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.

An easy temporary solution might also be -Wl,--allow-multiple-definition.


Marco

> Andrew.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trouble with JAR resources
  2009-01-07 17:45   ` Marco Trudel
@ 2009-01-08 11:41     ` Thomas Christensen
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Christensen @ 2009-01-08 11:41 UTC (permalink / raw)
  To: java

Marco Trudel <marco@mtsystems.ch> writes:

> Andrew Haley wrote:
>> Not easily.  I'd either strip them from the jars before compiling or
>> compile with -findirect-dispatch.
>
> An easy temporary solution might also be -Wl,--allow-multiple-definition.

Thanks

		Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-08 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-07 15:50 Trouble with JAR resources Thomas Christensen
2009-01-07 16:37 ` Andrew Haley
2009-01-07 17:45   ` Marco Trudel
2009-01-08 11:41     ` Thomas Christensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).