public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcj static link fails
@ 2008-07-08 20:16 J. M. Bogaard
  2008-07-08 20:36 ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: J. M. Bogaard @ 2008-07-08 20:16 UTC (permalink / raw)
  To: gcc-help

When i try to static link a app, compiled with gcj i get:

/usr/bin/ld: cannot find -lgcj
collect2: ld returned 1 exit status

I try to compile it with: gcj --main=HelloWorld -o HelloWorld 
HelloWorld.java --static

My OS is Debian Testing with GCJ 4.3. All relevant packages are installed.

I hope somebody know a solution.

Martijn

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

* Re: gcj static link fails
  2008-07-08 20:16 gcj static link fails J. M. Bogaard
@ 2008-07-08 20:36 ` David Daney
  2008-07-15 13:59   ` J. M. Bogaard
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2008-07-08 20:36 UTC (permalink / raw)
  To: J. M. Bogaard; +Cc: gcc-help

J. M. Bogaard wrote:
> When i try to static link a app, compiled with gcj i get:
> 
> /usr/bin/ld: cannot find -lgcj
> collect2: ld returned 1 exit status
> 
> I try to compile it with: gcj --main=HelloWorld -o HelloWorld 
> HelloWorld.java --static
> 
> My OS is Debian Testing with GCJ 4.3. All relevant packages are installed.
> 
> I hope somebody know a solution.
> 

Do you have libgcj.a installed?  Probably you will want to use -static-libgcj instead of --static.

Also be forewarned that static linking with gcj is very tricky.  You might want to read the Wiki:

http://gcc.gnu.org/wiki/Statically_linking_libgcj

David Daney

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

* Re: gcj static link fails
  2008-07-08 20:36 ` David Daney
@ 2008-07-15 13:59   ` J. M. Bogaard
  0 siblings, 0 replies; 3+ messages in thread
From: J. M. Bogaard @ 2008-07-15 13:59 UTC (permalink / raw)
  To: David Daney; +Cc: gcc-help

Nope... libgcj.a is not provided by the debian package maintainers. Is 
there a way to link it static with only the .so?

Martijn Bogaard

David Daney schreef:
> J. M. Bogaard wrote:
>> When i try to static link a app, compiled with gcj i get:
>>
>> /usr/bin/ld: cannot find -lgcj
>> collect2: ld returned 1 exit status
>>
>> I try to compile it with: gcj --main=HelloWorld -o HelloWorld 
>> HelloWorld.java --static
>>
>> My OS is Debian Testing with GCJ 4.3. All relevant packages are 
>> installed.
>>
>> I hope somebody know a solution.
>>
>
> Do you have libgcj.a installed?  Probably you will want to use 
> -static-libgcj instead of --static.
>
> Also be forewarned that static linking with gcj is very tricky.  You 
> might want to read the Wiki:
>
> http://gcc.gnu.org/wiki/Statically_linking_libgcj
>
> David Daney

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

end of thread, other threads:[~2008-07-15 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-08 20:16 gcj static link fails J. M. Bogaard
2008-07-08 20:36 ` David Daney
2008-07-15 13:59   ` J. M. Bogaard

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).