This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj problem with -static option
David Daney a écrit :
> > > 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.
I already tried exactly what is at the Wiki, and it works.
But my purpose is not having only the libgcj in a static form, I try to have everything in static, due to embedded constraints.
That's why I tried different options, but if the libc and the libpthread have to be dynamic, I will have difficulties to make this work ...
Pascal