From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKp07-0004on-0x for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:35:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKp00-0005pO-Mj for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:35:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKp00-0005og-Dx for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:35:24 -0400 Date: Fri, 22 Aug 2014 14:35:19 +0100 From: Stefan Hajnoczi Message-ID: <20140822133519.GC14126@stefanha-thinkpad.redhat.com> References: <1408704863-12343-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TYecfFk8j8mZq+dy" Content-Disposition: inline In-Reply-To: <1408704863-12343-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 0/7] build-sys: Fix iscsi module loading failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pbonzini@redhat.com, peter.crosthwaite@xilinx.com, mjt@tls.msk.ru, qemu-devel@nongnu.org --TYecfFk8j8mZq+dy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 22, 2014 at 06:54:16PM +0800, Fam Zheng wrote: > The iscsi driver doesn't work if built with --enable-modules: >=20 > $ ~/build/last/qemu-img > Failed to open module: /home/fam/build/master/block-iscsi.so: undefined s= ymbol: qmp_query_uuid > qemu-img: Not enough arguments > Try 'qemu-img --help' for more information >=20 > This fixes it by completely linking libqemuutil.a (now qemuutil.o) rather= than > on demand. >=20 > A few stub functions are added into libqemustub to make linker happy. >=20 > Lastly, iqn generation code is moved from iscsi.c to util, so that > qmp_query_uuid or its stub is not missed. Did you try ld --just-symbols=3Dfilename to include module symbol dependencies when linking the QEMU binary? The advantage is that the QEMU binary stays smaller. And (depending on whether you consider this a feature or not) it discourages people from building out-of-tree modules. Did you compare the before/after binary size with your patch? Please use size(1). It's unfortunate to bloat the binary, not just from a code size perspective, but also from a security perspective less code is better (cannot be abused in return-oriented-programming). Stefan --TYecfFk8j8mZq+dy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT90cXAAoJEJykq7OBq3PIBM8IAKEMuFPsUVknmrU58igslfSg iTmT58Fxzu7Ebhbzdw+QFS0pfID3O7ErFI5dYCCs5/92TrivjaoRFczkWqSIx0WQ 2ZAB2X3ztN6Yi0O+WX6hcZQFyyX1FAsBgz/0wn21V5XxcTpNpNR/ikDqqFMUX6mj d/7YNEkb1rVwn1l29TVO30aanQME/EmriaHfvYjp9VAKUEry5nTQqjR4Qv78iYQw uev/HlDDQYTTvWwxuGhZzPzGiiNCOqoSRcAox8i5c5R37NGFqLW0wH4rqu6bd9Gl DSwrIMoHAdfrhKexGx1nKccFxg+ES25lM3LT6GUtS2maU0tUfIGqLwJqvPniJjE= =5DTc -----END PGP SIGNATURE----- --TYecfFk8j8mZq+dy--