From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnnlZ-0004SG-QC for qemu-devel@nongnu.org; Fri, 23 May 2014 07:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnnlT-0005Ik-Kp for qemu-devel@nongnu.org; Fri, 23 May 2014 07:36:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnnlT-0005Ib-B0 for qemu-devel@nongnu.org; Fri, 23 May 2014 07:35:55 -0400 Message-ID: <537F3291.2000908@redhat.com> Date: Fri, 23 May 2014 13:35:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1400814150-31666-1-git-send-email-famz@redhat.com> <537F1BE4.50506@msgid.tls.msk.ru> In-Reply-To: <537F1BE4.50506@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/4] buildsys: Fix module build for block-iscsi.so List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , Fam Zheng , qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Weil , Michael Roth , Christophe Fergeau , Alon Levy , Stefan Hajnoczi , =?ISO-8859-1?Q?Alex_Benn=E9e?= , Richard Henderson Il 23/05/2014 11:59, Michael Tokarev ha scritto: > 23.05.2014 07:02, Fam Zheng wrote: >> We get: >> >> $ qemu-img >> Failed to open module: /home/fam/build/master/block-iscsi.so: undefined symbol: bitmap_set >> qemu-img: Not enough arguments >> Try 'qemu-img --help' for more information >> >> Because since commit b03c38 (block/iscsi: speed up read for unallocated >> sectors), block/iscsi.c calls utils/bitmap.c:bitmap_* functions, which is not >> linked to qemu-img nor shared objects. > > Heh. This is a very fun situation. > > For the first time I've had it with postfix in about 2002, > when I tried to make postfix modular, and it didn't work, > because modules sometimes used symbols which are not present > in all executables who used the modules. > > The solution is not link modules with missing symbols. The > solution is to make libpostfix.so with all ths support functions, > and link all programs to it instead of using all support funcs > statically. Another solution is to turn libqemuutil.a into a libtool convenience library, which is a portable way to wrap it with --whole-archive/--no-whole-archive. This will make libtool mandatory for compilation of QEMU. Paolo