Hi On Wed, Dec 16, 2015 at 3:02 PM, Frediano Ziglio <fziglio@xxxxxxxxxx> wrote: >> > > >> > > Hi >> > > >> > > On Wed, Dec 16, 2015 at 10:44 AM, Frediano Ziglio <fziglio@xxxxxxxxxx> >> > > wrote: >> > > > You are not... convenient library should not be linked to programs! >> > > > Is in libtool documentation. >> > > >> > > https://www.gnu.org/software/libtool/manual/html_node/Static-libraries.html >> > > "The key is remembering that a convenience library contains PIC >> > > objects, and can be linked where a list of PIC objects makes sense; >> > > i.e. into a shared library. A static convenience library contains >> > > non-PIC objects, so can be linked into an old static library, or a >> > > program. " >> > > >> > >> > Yes, I was referring to this. >> > >> > > Having -static or not doesn't change the result. All objects are >> > > compiled with -fPIC. And ar of PIC objects + ld/elf is fine linking a >> > > program or a library that way. Searching a bit over the web, it seems >> > > to be a common practice for quite a while. Do we care so much about >> > > other non-elf compilers/linkers that could in theory have issues? Even >> > > win32 dll are fine with this (I created a small project to test this >> > > attached). Do you know an arch/compiler that wouldn't support this? >> > > >> > > What are the alternatives? To compile the library twice and pass all >> > > the needed library flags when linking? I don't think we need to do all >> > > that for something hypotetical we can't test. >> > > >> > >> > Why using a static library is so bad? >> > Here would be perfect and working on all possible (and impossible) >> > platforms. >> >> That's worse, you get a warning from libtool: >> >> libspice_server_la_LIBADD = libserver.a >> >> CCLD libspice-server.la >> *** Warning: Linking the shared library libspice-server.la against the >> *** static library libserver.a is not portable! >> > > This patch refers to libtest, not libserver! > libserver is a convenience library used (correctly) to make a shared > library. I thought you were refering to the usage of libtool static libraries in general. The following patch, the test links with libserver.a: stream_test_LDADD = libtest.la ../libserver.la Furthermore, as I tried to explain before: - mixing libtool and non-libtool libs is recipe for more issues than using all libtool - libtool lib carry all the flags needed to link against the lib, this avoid duplicating the libserver flags around So I'd still prefer to stay consistent as long as no issue are reproducible. -- Marc-André Lureau _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel