Re: [Qemu-devel] [PATCH] libcacard: actually use symbols file
27.04.2014 19:11, Andreas Färber wrote: > Am 27.04.2014 16:37, schrieb Michael Tokarev: >> libtool has an argument for .syms file, which is -export-symbols. >> There's no argument `-export-syms', and it looks like at least on >> linux, -export-syms is just ignored. Use the correct argument, >> -export-symbols, to actually get the right export list. >> >> But it turns out that vscclient binary, which also uses qemu >> privitives for sockets, mutexes and some other stuff, but only > > "primitives"? > >> linked with libcacard, does not link after hiding extra symbols >> previously exported by libcacard. So while at it, link it with >> libqemuutil.a and libqemustub.a. This makes the binary as twice > > "twice as large" (without leading "as") Ok. Typos-typos... [] >> -vscclient$(EXESUF): libcacard/vscclient.o libcacard.la >> +vscclient$(EXESUF): libcacard/vscclient.o libcacard.la libqemuutil.a >> libqemustub.a > > No objection, but what symbol(s) is libqemustub.a needed for? It is needed for many things on which libqemuutil.a depends, -- stuff like monitor_fd and other. But I think I've a much better idea in two subsequent patches I just submitted - one for vscclient and another for libcacard: it is to eliminate the need to use any qemu internals to start with, because all that is already provided by glib. After that, the first version of this patch (the one-liner, which replaces -export-syms with -export-symbols) can be applied instead, and everything will be much saner. See emails from me titled "vscclient: use glib thread primitives not qemu" "libcacard: replace qemu thread primitives with glib ones". But please note: compile-time tested only. I don't even know what this stuff _is_ ;) Thanks, /mjt
Re: [Qemu-devel] [PATCH] libcacard: actually use symbols file
Am 27.04.2014 16:37, schrieb Michael Tokarev: > libtool has an argument for .syms file, which is -export-symbols. > There's no argument `-export-syms', and it looks like at least on > linux, -export-syms is just ignored. Use the correct argument, > -export-symbols, to actually get the right export list. > > But it turns out that vscclient binary, which also uses qemu > privitives for sockets, mutexes and some other stuff, but only "primitives"? > linked with libcacard, does not link after hiding extra symbols > previously exported by libcacard. So while at it, link it with > libqemuutil.a and libqemustub.a. This makes the binary as twice "twice as large" (without leading "as") > as large, but allows to have cleaner export table for libcacard.so. > > Signed-off-by: Michael Tokarev > --- > libcacard/Makefile |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libcacard/Makefile b/libcacard/Makefile > index 6b06448..bb00c94 100644 > --- a/libcacard/Makefile > +++ b/libcacard/Makefile > @@ -17,14 +17,14 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) > > all: libcacard.la libcacard.pc > > -vscclient$(EXESUF): libcacard/vscclient.o libcacard.la > +vscclient$(EXESUF): libcacard/vscclient.o libcacard.la libqemuutil.a > libqemustub.a No objection, but what symbol(s) is libqemustub.a needed for? Cheers, Andreas > $(call LINK,$^) > > # > # Rules for building libcacard standalone library > > libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \ > - -export-syms $(SRC_PATH)/libcacard/libcacard.syms > + -export-symbols $(SRC_PATH)/libcacard/libcacard.syms > libcacard.la: LIBS = $(libcacard_libs) > libcacard.la: $(libcacard-lobj-y) > $(call LINK,$^) > -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH] libcacard: actually use symbols file
27.04.2014 18:53, Alon Levy wrote: > On 04/27/2014 05:37 PM, Michael Tokarev wrote: >> libtool has an argument for .syms file, which is -export-symbols. >> There's no argument `-export-syms', and it looks like at least on >> linux, -export-syms is just ignored. Use the correct argument, >> -export-symbols, to actually get the right export list. >> >> But it turns out that vscclient binary, which also uses qemu >> privitives for sockets, mutexes and some other stuff, but only >> linked with libcacard, does not link after hiding extra symbols >> previously exported by libcacard. So while at it, link it with >> libqemuutil.a and libqemustub.a. This makes the binary as twice >> as large, but allows to have cleaner export table for libcacard.so. >> > > Reviewed-by: Alon Levy > > Any chance to get this through the trivial patch queue? Well sure. Except that un-exporting internal symbols like this from libcacard.so might have non-trivial consequences, like we've seen with vscclient ;) I've added it to the trivial-patches queue for now. Thanks! /mjt
Re: [Qemu-devel] [PATCH] libcacard: actually use symbols file
On 04/27/2014 05:37 PM, Michael Tokarev wrote: > libtool has an argument for .syms file, which is -export-symbols. > There's no argument `-export-syms', and it looks like at least on > linux, -export-syms is just ignored. Use the correct argument, > -export-symbols, to actually get the right export list. > > But it turns out that vscclient binary, which also uses qemu > privitives for sockets, mutexes and some other stuff, but only > linked with libcacard, does not link after hiding extra symbols > previously exported by libcacard. So while at it, link it with > libqemuutil.a and libqemustub.a. This makes the binary as twice > as large, but allows to have cleaner export table for libcacard.so. > Reviewed-by: Alon Levy Any chance to get this through the trivial patch queue? > Signed-off-by: Michael Tokarev > --- > libcacard/Makefile |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libcacard/Makefile b/libcacard/Makefile > index 6b06448..bb00c94 100644 > --- a/libcacard/Makefile > +++ b/libcacard/Makefile > @@ -17,14 +17,14 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) > > all: libcacard.la libcacard.pc > > -vscclient$(EXESUF): libcacard/vscclient.o libcacard.la > +vscclient$(EXESUF): libcacard/vscclient.o libcacard.la libqemuutil.a > libqemustub.a > $(call LINK,$^) > > # > # Rules for building libcacard standalone library > > libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \ > - -export-syms $(SRC_PATH)/libcacard/libcacard.syms > + -export-symbols $(SRC_PATH)/libcacard/libcacard.syms > libcacard.la: LIBS = $(libcacard_libs) > libcacard.la: $(libcacard-lobj-y) > $(call LINK,$^) >
[Qemu-devel] [PATCH] libcacard: actually use symbols file
libtool has an argument for .syms file, which is -export-symbols. There's no argument `-export-syms', and it looks like at least on linux, -export-syms is just ignored. Use the correct argument, -export-symbols, to actually get the right export list. But it turns out that vscclient binary, which also uses qemu privitives for sockets, mutexes and some other stuff, but only linked with libcacard, does not link after hiding extra symbols previously exported by libcacard. So while at it, link it with libqemuutil.a and libqemustub.a. This makes the binary as twice as large, but allows to have cleaner export table for libcacard.so. Signed-off-by: Michael Tokarev --- libcacard/Makefile |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcacard/Makefile b/libcacard/Makefile index 6b06448..bb00c94 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -17,14 +17,14 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) all: libcacard.la libcacard.pc -vscclient$(EXESUF): libcacard/vscclient.o libcacard.la +vscclient$(EXESUF): libcacard/vscclient.o libcacard.la libqemuutil.a libqemustub.a $(call LINK,$^) # # Rules for building libcacard standalone library libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \ - -export-syms $(SRC_PATH)/libcacard/libcacard.syms + -export-symbols $(SRC_PATH)/libcacard/libcacard.syms libcacard.la: LIBS = $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) $(call LINK,$^) -- 1.7.10.4