Does gcj pass -dy and -dn to linker?

Bill Bland wjb@netpd.com
Mon Oct 29 06:13:00 GMT 2001


On 2001年10月30日, Bryce McKinlay wrote:
> Bill Bland wrote:
>> >I want to link some libraries statically and others dynamically. The way
> >to do this is to use the -dy and -dn flags, which affect any -l... that
> >follow them so you can do:
> >
> >ld -dy -ldynamiclib -dn -lstaticlib -dy -lalsodynamiclib
> >
> >What I need to know is: does gcj pass these flags correctly to the linker?
> >
>> I have not heard of those flags before. My GCC man page says that the 
> -d* are for various kinds of debugging dumps. I think what you want is 
> "-Wl,-Bstatic" and "-Wl,-Bdynamic"? Hint: Use "gcj -v" to see exactly 
> what commands gcj is passing to the linker.

"info ld" says that -dy and -Bdynamic, and -dn and -Bstatic are aliases.
Your versions work though - thanks! (I think it was the "-Wl," that made
the difference).
> What makes you think its fltk that is crashing? gcj < 3.0.2 has a nasty 
> bug which can cause it to abort instead of giving you a stack trace, 
> maybe for a ClassNotFoundException?

It wasn't fltk causing the problem after all (btw, my gcj == 3.0.2).
I was doing a Class.forName, which as you pointed out would cause problems
when libgcj was linked statically. I now have all libraries apart from
libgcj linked statically and it works great.
Thanks again for your help.
Best wishes,
		Bill.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /