public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* using linker flags
@ 2009-04-29  5:50 abhishek desai
  2009-04-29 12:58 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: abhishek desai @ 2009-04-29  5:50 UTC (permalink / raw)
  To: java

Hi,

I am trying to compile a simple HelloWorld.java program using gcj. I
am linking the libgcj library statically to the program using the
command

build_mipsel/staging_dir/bin/mipsel-linux-gcj -static HelloWorld.java
--main=HelloWorld -o HelloWorld -Lbuild_mipsel/staging_dir/lib

This compiles the HelloWorld correctly and I am bale to run it on a
mipsel hardware.

When I try using linker flags using the command

build_mipsel/staging_dir/bin/mipsel-linux-gcj -static HelloWorld.o
--main=HelloWorld -o HelloWorld -Lbuild_mipsel/staging_dir/lib
-Xlinker -M

I get the error
           mipsel-linux-gcj: cannot specify `main' class when not linking


Can someone please tell me how I can specify the linker flags to this.
I also tried it in two stages by making the object file and then
linking but I get the same error.

Please help.

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

* Re: using linker flags
  2009-04-29  5:50 using linker flags abhishek desai
@ 2009-04-29 12:58 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2009-04-29 12:58 UTC (permalink / raw)
  To: abhishek desai; +Cc: java

abhishek desai wrote:

> I am trying to compile a simple HelloWorld.java program using gcj. I
> am linking the libgcj library statically to the program using the
> command
> 
> build_mipsel/staging_dir/bin/mipsel-linux-gcj -static HelloWorld.java
> --main=HelloWorld -o HelloWorld -Lbuild_mipsel/staging_dir/lib
> 
> This compiles the HelloWorld correctly and I am bale to run it on a
> mipsel hardware.
> 
> When I try using linker flags using the command
> 
> build_mipsel/staging_dir/bin/mipsel-linux-gcj -static HelloWorld.o
> --main=HelloWorld -o HelloWorld -Lbuild_mipsel/staging_dir/lib
> -Xlinker -M
> 
> I get the error
>            mipsel-linux-gcj: cannot specify `main' class when not linking
> 
> 
> Can someone please tell me how I can specify the linker flags to this.

-Wl,<linker option>,<linker option>,...

Andrew.

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

end of thread, other threads:[~2009-04-29 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-29  5:50 using linker flags abhishek desai
2009-04-29 12:58 ` Andrew Haley

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