Skip to contentSkip to conversation

QEMU build error with --disable-qcow1

DISCUSSION Thomas Huth 2 participants 2 messages Aug 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

if I run "configure" with --disable-qcow1, I currently get a build error:

Linking target qemu-nbd
libblock.fa(block_qcow2-threads.c.o): In function `qcow2_zlib_compress':
/tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:101:
undefined reference to `deflateInit2_' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:116:
undefined reference to `deflate' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:123:
undefined reference to deflateEnd' libblock.fa(block_qcow2-threads.c.o): In function qcow2_zlib_decompress':
/tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:152:
undefined reference to `inflateInit2_' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:157:
undefined reference to `inflate' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:169:
undefined reference to `inflateEnd'
etc.

Not sure whether this is due to the recent conversion to meson, or a recent change to that file ... anybody got a clue what's going on here?

Thomas

#1 lore raw
Quoted 18 lines · Thomas Huth

Linking target qemu-nbd
libblock.fa(block_qcow2-threads.c.o): In function `qcow2_zlib_compress':
/tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:101:
undefined reference to `deflateInit2_' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:116:
undefined reference to `deflate' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:123:
undefined reference to deflateEnd' libblock.fa(block_qcow2-threads.c.o): In function qcow2_zlib_decompress':
/tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:152:
undefined reference to `inflateInit2_' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:157:
undefined reference to `inflate' /tmp/qemu-test/../../home/thuth/devel/qemu/block/qcow2-threads.c:169:
undefined reference to `inflateEnd'
etc.

Quoted 2 lines

Not sure whether this is due to the recent conversion to meson, or a recent change to that file ... anybody got a clue what's going on here?

It's a missing zlib dependency for the qcow2 files:

block/meson.build +2 -2
index 4dbbfe60b4..a3e56b7cd1 100644
@@ -40,9 +40,9 @@ block_ss.add(files(
   'vmdk.c',
   'vpc.c',
   'write-threshold.c',
-), zstd)
+), zstd, zlib)
 
-block_ss.add(when: [zlib, 'CONFIG_QCOW1'], if_true: files('qcow.c'))
+block_ss.add(when: 'CONFIG_QCOW1', if_true: files('qcow.c'))
 block_ss.add(when: 'CONFIG_VDI', if_true: files('vdi.c'))
 block_ss.add(when: 'CONFIG_CLOOP', if_true: files('cloop.c'))
 block_ss.add(when: 'CONFIG_BOCHS', if_true: files('bochs.c'))

(and then it becomes redundant for qcow1). I'll send a formal patch shortly.

Paolo