Currently we link individual object files from libcacard to qemu-system binaries, this way (from Makefile.objs):
libcacard-y += libcacard/cac.o libcacard/event.o libcacard-y += libcacard/vcard.o libcacard/vreader.o ... common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y) Why can't we use the actual library, and just add the linker flag, -Ilibcacard -lcacard? libcacard is built only when libtool is found, which is kinda illogical since libtool is not needed to link these object files with qemu. And libtool is already used (if found) to link qemu binaries, so using it to link binaries with libcacard is already done. How about replacing these common-obj-$(CONFIG_SMARTCARD_NSS) with appropriate linker flags, and doing that only for these binaries which actually need libcacard? Thanks, /mjt