On Mon, May 16, 2011 at 03:59:53PM +0200, Paolo Bonzini wrote: > On 05/16/2011 03:28 PM, Anthony Liguori wrote: > >> > >> > >> *** Warning: Linking the shared library libcacard.la against the > >>non-libtool > >> *** objects ../trace-dtrace.o is not portable! > > > >I don't think slipping in libtool like this is such a good idea. > > I disagree but, the warning is indeed legitimate, so > > NACK > > >Isn't la just a static archive compiled with -fPIC? > > No, .la is a text file pointing (most importantly) to the static > library, the shared library, and the dependencies of the static > library. > > Alon, do you need this to comply with some packaging guidelines > forbidding static libraries? > <Answering both you and Anthony> I'm basically trying to replace the current shared object built by the standalone libcacard project. Since we are deprecating that on account of not wanting to maintain two code bases, I need a replacement shared object producing something somewhere. It seems best to do it within the project and not, say, as spec file for an rpm, for obvious reasons of wanting this to be distribution agnostic. I've settled on libtool as the linker solution since it seems to be the de facto standard, please correct me on this point if I'm wrong. We are not using autoconf, so I've called it directly in it's various modes, compile, link and install.
Regarding your concerns from above: The libcacard.la target produces a shared object with the right version symlinks (libcacard.so.0.0.0, libcacard.so.0 and libcacard.so) thanks to libtool Legitemacy of the warning: basically libtool is concerned about linking in position dependant code. But the trace-dtrace.o contains no .rodata section and is not actually a problem for the linker, I've verfied the resulting library works fine with spicec (the spice client using it). I'd appreciate any suggestion of a replacement for libtool if it is not appropriate. Note that this building of a shared library is not something new - we've talked about this before in relation to libcacard inclusion inside qemu git repository. > Paolo