Received: from eggs.gnu.org ([2001:4830:134:3::10]:43385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8W0J-0001gF-P3 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 13:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8W0E-00083R-BP for qemu-devel@nongnu.org; Thu, 02 Jun 2016 13:01:54 -0400 Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]:35735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8W0E-00083E-3s for qemu-devel@nongnu.org; Thu, 02 Jun 2016 13:01:50 -0400 Received: by mail-io0-x229.google.com with SMTP id o189so41360046ioe.2 for ; Thu, 02 Jun 2016 10:01:49 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <20160531160006.GC21628@redhat.com> Date: Thu, 2 Jun 2016 13:01:46 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <8EB55DC3-47A4-488C-8956-57E3A0CF82E1@gmail.com> References: <0322B7E6-88DD-436E-884A-F0F78B8209BE@gmail.com> <573F9327.9000808@redhat.com> <20160531140017.GX21628@redhat.com> <7C849EF0-8AA5-4F3D-BA33-48890797DAD2@gmail.com> <20160531145148.GY21628@redhat.com> <6B2013C2-D322-4648-AFFB-D6B33F2BC2C5@gmail.com> <20160531160006.GC21628@redhat.com> Subject: Re: [Qemu-devel] undefined symbol _nettle_cast5_set_key List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Eric Blake , qemu-devel qemu-devel On May 31, 2016, at 12:00 PM, Daniel P. Berrange wrote: > On Tue, May 31, 2016 at 11:48:45AM -0400, Programmingkid wrote: >>=20 >> On May 31, 2016, at 10:51 AM, Daniel P. Berrange wrote: >>>> gcc-4.9 -I/opt/local/include/pixman-1 = -I/Users/john/Documents/Development/Projects/Qemu/qemu-git/dtc/libfdt = -m64 -DOS_OBJECT_USE_OBJC=3D0 -arch x86_64 -D_GNU_SOURCE = -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -Wstrict-prototypes = -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes = -fno-strict-aliasing -fno-common -Wendif-labels -Wmissing-include-dirs = -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self = -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition = -Wtype-limits -fstack-protector-strong = -I/usr/local/Cellar/gnutls/3.4.11/include = -I/usr/local/Cellar/nettle/3.2/include = -I/usr/local/Cellar/libtasn1/4.8/include -I/opt/local/include = -I/usr/local/Cellar/nettle/3.2/include -I/opt/local/include/libpng16 = -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 = -I/usr/local/Cellar/usbredir/0.7.1/include = -I/Users/john/Documents/Development/Projects/Qemu/qemu-git/tests -O2 = -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 -D_REENTRANT = -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 = -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include = -I/usr/local/opt/gettext/include -g -m64 -framework CoreFoundation = -framework IOKit -arch x86_64 -g -o qemu-nbd qemu-nbd.o async.o = thread-pool.o block.o blockjob.o main-loop.o iohandler.o qemu-timer.o = aio-posix.o qemu-io-cmds.o block/raw_bsd.o block/qcow.o block/vdi.o = block/vmdk.o block/cloop.o block/bochs.o block/vpc.o block/vvfat.o = block/qcow2.o block/qcow2-refcount.o block/qcow2-cluster.o = block/qcow2-snapshot.o block/qcow2-cache.o block/qed.o block/qed-gencb.o = block/qed-l2-cache.o block/qed-table.o block/qed-cluster.o = block/qed-check.o block/vhdx.o block/vhdx-endian.o block/vhdx-log.o = block/quorum.o block/parallels.o block/blkdebug.o block/blkverify.o = block/blkreplay.o block/block-backend.o block/snapshot.o block/qapi.o = block/raw-posix.o block/null.o block/mirror.o block/io.o = block/throttle-groups.o block/nbd.o block/nbd-client.o block/sheepdog.o = block/accounting.o block/dirty-bitmap.o block/write-threshold.o = block/crypto.o nbd/server.o nbd/client.o nbd/common.o block/curl.o = block/dmg.o crypto/init.o crypto/hash.o crypto/aes.o crypto/desrfb.o = crypto/cipher.o crypto/tlscreds.o crypto/tlscredsanon.o = crypto/tlscredsx509.o crypto/tlssession.o crypto/secret.o = crypto/random-gnutls.o crypto/pbkdf.o crypto/pbkdf-nettle.o = crypto/ivgen.o crypto/ivgen-essiv.o crypto/ivgen-plain.o = crypto/ivgen-plain64.o crypto/afsplit.o crypto/xts.o crypto/block.o = crypto/block-qcow.o crypto/block-luks.o io/channel.o io/channel-buffer.o = io/channel-command.o io/channel-file.o io/channel-socket.o = io/channel-tls.o io/channel-watch.o io/channel-websock.o = io/channel-util.o io/task.o qom/object.o qom/container.o = qom/qom-qobject.o qom/object_interfaces.o libqemuutil.a libqemustub.a = -lz -L/opt/local/lib -lcurl -lbz2 -L/usr/local/Cellar/glib/2.46.2/lib = -L/usr/local/opt/gettext/lib -lgthread-2.0 -lglib-2.0 -lintl -lz -lz = -L/usr/local/Cellar/nettle/3.2/lib -lnettle = -L/usr/local/Cellar/gnutls/3.4.11/lib -lgnutls -lutil >>>> Undefined symbols for architecture x86_64: >>>> "_nettle_cast5_set_key", referenced from: >>>> _qcrypto_cipher_new in cipher.o >>>> ld: symbol(s) not found for architecture x86_64 >>>> collect2: error: ld returned 1 exit status >>>> make: *** [qemu-nbd] Error 1 >>>=20 >>> This linker line again looks basically sound. It is still passing = the >>> correct -lnettle arg, and the -I and -L args to point to the nettle >>> 3.2 installation. >>>=20 >>> Given that we found the "KDF" support in nettle, we know that it is >>> new enough to support the "nettle_cast5_set_key" function too so >>> we ought to link correctly. >>>=20 >>> The only thing that occurs to me is that we have a number of other >>> -L args present - eg -L/opt/local/lib. >>>=20 >>> I wonder if one of those other search paths has a differnet version >>> of nettle installed in it, causing gcc to link to the wrong one. >>=20 >> I did a search and found libnettle.4.7.dylib in /opt/local/lib. I >> also found libnettle.6.2.dylib in /usr/local/Cellar/nettle/3.2/lib. >=20 > Ah ha, that sounds like it could well be the cause of the problems. >=20 > I'm not sure if there's a reason you have nettle in both = /opt/local/lib > and /usr/local/Cellar/nettle/3.2/lib. The -L/opt/local/lib arg = appears > before the -L/usr/loca/Cellar/nettle/3.2/lib arg, so I expect that = means > it will be picking up the older libnettle.4.7.dylib first :-( >=20 > Changing the order of the -L arg that QEMU uses is not exactly a > straightforward / practical thing todo. If its possible for you > to get rid of the older 4.7.dylib file i expect that would fix > the QEMU build, but not sure if that'll break something else on > your OS-X system. >=20 > I'm not really sure there's much we can do to detect this problem > in QEMU's configure script either. The config.log file seems to > show that at the time we probe for nettle & test linking with it, > we've not yet detected the later that uses -L/opt/local/lib. Maybe we can change things so that we only use the highest version of = nettle detected.=20 Nettle is a library that deals with cryptography which I don't need or = use. Is there a way to turn off its inclusion into QEMU?