From: "Daniel P. Berrange" <berrange@redhat.com>
To: Programmingkid <programmingkidx@gmail.com>
Cc: Eric Blake <eblake@redhat.com>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] undefined symbol _nettle_cast5_set_key
Date: Tue, 31 May 2016 17:00:06 +0100 [thread overview]
Message-ID: <20160531160006.GC21628@redhat.com> (raw)
In-Reply-To: <6B2013C2-D322-4648-AFFB-D6B33F2BC2C5@gmail.com>
On Tue, May 31, 2016 at 11:48:45AM -0400, Programmingkid wrote:
>
> 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=0 -arch x86_64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -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=2 -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
> >
> > 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.
> >
> > 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.
> >
> > The only thing that occurs to me is that we have a number of other
> > -L args present - eg -L/opt/local/lib.
> >
> > 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.
>
> 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.
Ah ha, that sounds like it could well be the cause of the problems.
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 :-(
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.
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.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2016-05-31 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 19:15 [Qemu-devel] undefined symbol _nettle_cast5_set_key Programmingkid
2016-05-20 22:43 ` Eric Blake
2016-05-20 22:46 ` Programmingkid
2016-05-20 22:50 ` Eric Blake
2016-05-20 23:04 ` Programmingkid
2016-05-21 13:14 ` Peter Maydell
2016-05-21 14:18 ` Programmingkid
2016-05-31 9:18 ` Daniel P. Berrange
2016-05-31 14:00 ` Daniel P. Berrange
2016-05-31 14:25 ` Programmingkid
2016-05-31 14:51 ` Daniel P. Berrange
2016-05-31 15:48 ` Programmingkid
2016-05-31 16:00 ` Daniel P. Berrange [this message]
2016-06-02 17:01 ` Programmingkid
2016-06-02 17:06 ` Daniel P. Berrange
2016-06-03 14:02 ` Programmingkid
2016-05-31 14:36 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160531160006.GC21628@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=programmingkidx@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).