compile failure if gnutls headers not on default include path

Bug #1909256 reported by Peter Maydell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Roman Bolshakov

Bug Description

If the gnutls headers are not on the default compiler include path, then configure correctly finds them and config-host.mak sets up the variables:

GNUTLS_CFLAGS=-I/opt/homebrew/Cellar/gnutls/3.6.15/include -I/opt/homebrew/Cellar/nettle/3.6/include -I/opt/homebrew/Cellar/libtasn1/4.16.0/include -I/opt/homebrew/Cellar/libidn2/2.3.0/include -I/opt/homebrew/Cellar/p11-kit/0.23.22/include/p11-kit-1
GNUTLS_LIBS=-L/opt/homebrew/Cellar/gnutls/3.6.15/lib -lgnutls

but meson fails to put GNUTLS_CFLAGS in the compiler arguments and so you get compile failures like:

[2/1865] Compiling C object qemu-nbd.p/qemu-nbd.c.o
FAILED: qemu-nbd.p/qemu-nbd.c.o
cc -Iqemu-nbd.p -I. -I../.. -Iqapi -Itrace -Iui -Iui/shader -I/opt/homebrew/Cellar/glib/2.66.4/include -I/opt/homebrew/Cellar/glib/2.66.4/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.66.4/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.44/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -std=gnu99 -g -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -fstack-protector-strong -iquote /Users/pm215/qemu/tcg/aarch64 -iquote . -iquote /Users/pm215/qemu -iquote /Users/pm215/qemu/accel/tcg -iquote /Users/pm215/qemu/include -iquote /Users/pm215/qemu/disas/libvixl -MD -MQ qemu-nbd.p/qemu-nbd.c.o -MF qemu-nbd.p/qemu-nbd.c.o.d -o qemu-nbd.p/qemu-nbd.c.o -c ../../qemu-nbd.c
In file included from ../../qemu-nbd.c:30:
In file included from /Users/pm215/qemu/include/block/nbd.h:25:
/Users/pm215/qemu/include/crypto/tlscreds.h:28:10: fatal error: 'gnutls/gnutls.h' file not found
#include <gnutls/gnutls.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.

The compiler errors happen for any .c file that includes block/nbd.h and also for files in tests that include gnutls.h directly, and for files that directly or indirectly include crypto/tlssession.c.

My meson-foo is insufficient to suggest the correct fix...

Revision history for this message
Roman Bolshakov (roolebo) wrote :

The fix is committed in 3eacf70bb5a8.

Changed in qemu:
assignee: nobody → Roman Bolshakov (roolebo)
status: New → Fix Committed
Thomas Huth (th-huth)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.