gcj problem with -static option

David Daney ddaney@avtrex.com
Fri Mar 17 17:05:00 GMT 2006


>  > And if I try :
>  > 
>  > gcc -o HelloWorld HelloWorld.o HelloWorldmain.i -shared-libgcc -Wl,-non_shared -lgcj -lz -lc -lm -ldl -Wl,-call_shared -lgcc_s -lpthread
>  > I have :
>  > ./HelloWorld: relocation error: ./HelloWorld: symbol __pthread_initialize, version GLIBC_PRIVATE not defined in file libpthread.so.0 with link time reference
> 
> Uh, OK.  Don't statically link against libc.
> 
> Andrew.

The -Wl,-non_shared and -Wl,-call_shared should surround only the -lgcj. 
  If you look at the Wiki article, you will see that it does it this way.

Perhaps you should try it *exactly* like the Wiki article, then 
experiment once you have that working.

David Daney.



More information about the Java mailing list