* gcc -o Foo Foo.java Doesn't Produce Foo
@ 2008-07-17 10:52 Eus
2008-07-17 11:36 ` Andrew Haley
0 siblings, 1 reply; 4+ messages in thread
From: Eus @ 2008-07-17 10:52 UTC (permalink / raw)
To: David Daney; +Cc: GCC Help Mailing List
Hi Ho!
--- On Wed, 7/9/08, "David Daney" <ddaney@avtrex.com> wrote:
> 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
I have followed the instruction on the site under "For versions of GCJ before 4.2" because `ls /usr/lib/libgcj*' returned libgcj with version 4.0.0.
All steps are okay but the last one:
gcc -o Foo Foo.o Foomain.i -shared-libgcc -Wl,-non_shared -lgcj -Wl,-call_shared -lsupc++ -Wl,--as-needed -lz -lgcc_s -lpthread -lc -lm -ldl -Wl,--no-as-needed
It does not produce `Foo' even after I have tried the command several times. I also have tried `-o ./Foo' but to no avail.
Do you have any suggestion on how I should attack this problem?
Thank you very much.
> David Daney
Best regards,
Eus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gcc -o Foo Foo.java Doesn't Produce Foo
2008-07-17 10:52 gcc -o Foo Foo.java Doesn't Produce Foo Eus
@ 2008-07-17 11:36 ` Andrew Haley
2008-07-17 15:01 ` Eus
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Haley @ 2008-07-17 11:36 UTC (permalink / raw)
To: eus; +Cc: David Daney, GCC Help Mailing List
Eus wrote:
> Hi Ho!
>
> --- On Wed, 7/9/08, "David Daney" <ddaney@avtrex.com> wrote:
>
>> 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
>
> I have followed the instruction on the site under "For versions of GCJ before 4.2" because `ls /usr/lib/libgcj*' returned libgcj with version 4.0.0.
> All steps are okay but the last one:
>
> gcc -o Foo Foo.o Foomain.i -shared-libgcc -Wl,-non_shared -lgcj -Wl,-call_shared -lsupc++ -Wl,--as-needed -lz -lgcc_s -lpthread -lc -lm -ldl -Wl,--no-as-needed
>
> It does not produce `Foo' even after I have tried the command several times. I also have tried `-o ./Foo' but to no avail.
>
> Do you have any suggestion on how I should attack this problem?
First, make sure you can create a dynamically linked executable.
If that doesn't work either, tell us.
Andrew.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gcc -o Foo Foo.java Doesn't Produce Foo
2008-07-17 11:36 ` Andrew Haley
@ 2008-07-17 15:01 ` Eus
2008-07-17 15:49 ` Andrew Haley
0 siblings, 1 reply; 4+ messages in thread
From: Eus @ 2008-07-17 15:01 UTC (permalink / raw)
To: Andrew Haley; +Cc: David Daney, GCC Help Mailing List
Hi Ho!
--- On Thu, 7/17/08, Andrew Haley <aph@redhat.com> wrote:
> First, make sure you can create a dynamically linked
> executable.
> If that doesn't work either, tell us.
Yes, Foo was produced and could be executed successfully if it was compiled and dynamically linked with the following command:
gcj -o Foo Foo.java --main=Foo
However, when I tried all of the steps given on the wiki once again (this time by copying and pasting), Foo was produced.
Looking at my Bash history, it turned out that I made a mistake when typing the last step:
$ gcc -o Foo ... -Wl,-non_hsared ...
Because of this, Foo was not produced.
Is there a switch that can force GCC to produce an error message for this kind of mis-typed word?
Thank you for your help.
> Andrew.
Best regards,
Eus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gcc -o Foo Foo.java Doesn't Produce Foo
2008-07-17 15:01 ` Eus
@ 2008-07-17 15:49 ` Andrew Haley
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Haley @ 2008-07-17 15:49 UTC (permalink / raw)
To: eus; +Cc: David Daney, GCC Help Mailing List
Eus wrote:
> Hi Ho!
>
> --- On Thu, 7/17/08, Andrew Haley <aph@redhat.com> wrote:
>
>> First, make sure you can create a dynamically linked
>> executable.
>> If that doesn't work either, tell us.
>
> Yes, Foo was produced and could be executed successfully if it was compiled and dynamically linked with the following command:
>
> gcj -o Foo Foo.java --main=Foo
>
> However, when I tried all of the steps given on the wiki once again (this time by copying and pasting), Foo was produced.
>
> Looking at my Bash history, it turned out that I made a mistake when typing the last step:
> $ gcc -o Foo ... -Wl,-non_hsared ...
>
> Because of this, Foo was not produced.
>
> Is there a switch that can force GCC to produce an error message for this kind of mis-typed word?
No. All arguments beginning with -Wl, are passed to the linker.
Andrew.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-17 15:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-17 10:52 gcc -o Foo Foo.java Doesn't Produce Foo Eus
2008-07-17 11:36 ` Andrew Haley
2008-07-17 15:01 ` Eus
2008-07-17 15:49 ` 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).