qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] undefined symbol _nettle_cast5_set_key


From: Programmingkid
Subject: Re: [Qemu-devel] undefined symbol _nettle_cast5_set_key
Date: Fri, 3 Jun 2016 10:02:15 -0400

On Jun 2, 2016, at 1:06 PM, Daniel P. Berrange wrote:

> On Thu, Jun 02, 2016 at 01:01:46PM -0400, Programmingkid wrote:
>> 
>> On May 31, 2016, at 12:00 PM, Daniel P. Berrange wrote:
>> 
>>> 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.
>> 
>> Maybe we can change things so that we only use the highest version of nettle 
>> detected.
> 
> AFAIK, it is the linker that would have todo that, not something under
> our direct control. We just tell the linker what directories to look
> in and in your case you have different copies of the same lib in multiple
> places and the linker picks the first that it finds.
> 
>> 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?
> 
> Of course, you can always use the --disable-nettle flag to configure
> or force use of gcrypt instead with --enable-gcrypt
> 
> Regards,
> Daniel

Thank you very much for your help.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]