This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj problem with -static option
FERANDELLE Pascal writes:
>
> 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.
> >
> > 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.
Well, you're trying to do something pretty hard, and to use these
components in ways that they were not designed to be used.
> 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 ...
This is GNU/Linux, right? You really need libc and libpthread to be
statically linked with your executable?
Andrew.