-project('qemu', ['c'], meson_version: '>=0.59.3',
+project('qemu', ['c'], meson_version: '>=0.61.3',
default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
'b_staticpic=false', 'stdsplit=false', 'optimization=2', 'b_pie=true'],
version: files('VERSION'))
add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
+meson.add_postconf_script(find_program('scripts/symlink-install-tree.py'))
+
not_found = dependency('', required: false)
keyval = import('keyval')
ss = import('sourceset')
##################
qemu_cflags = config_host['QEMU_CFLAGS'].split()
-qemu_cxxflags = config_host['QEMU_CXXFLAGS'].split()
qemu_objcflags = config_host['QEMU_OBJCFLAGS'].split()
qemu_ldflags = config_host['QEMU_LDFLAGS'].split()
+if enable_static
+ qemu_ldflags += get_option('b_pie') ? '-static-pie' : '-static'
+endif
+
+# Detect support for PT_GNU_RELRO + DT_BIND_NOW.
+# The combination is known as "full relro", because .got.plt is read-only too.
+qemu_ldflags += cc.get_supported_link_arguments('-Wl,-z,relro', '-Wl,-z,now')
+
if targetos == 'windows'
qemu_ldflags += cc.get_supported_link_arguments('-Wl,--no-seh', '-Wl,--nxcompat')
# Disable ASLR for debug builds to allow debugging with gdb
if get_option('gprof')
qemu_cflags += ['-p']
- qemu_cxxflags += ['-p']
qemu_objcflags += ['-p']
qemu_ldflags += ['-p']
endif
configure_file(output: 'instrumentation-filter',
input: 'scripts/oss-fuzz/instrumentation-filter-template',
copy: true)
- add_global_arguments(
- cc.get_supported_arguments('-fsanitize-coverage-allowlist=instrumentation-filter'),
- native: false, language: ['c', 'cpp', 'objc'])
+
+ if cc.compiles('int main () { return 0; }',
+ name: '-fsanitize-coverage-allowlist=/dev/null',
+ args: ['-fsanitize-coverage-allowlist=/dev/null',
+ '-fsanitize-coverage=trace-pc'] )
+ add_global_arguments('-fsanitize-coverage-allowlist=instrumentation-filter',
+ native: false, language: ['c', 'cpp', 'objc'])
+ endif
if get_option('fuzzing_engine') == ''
# Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
endif
add_global_arguments(qemu_cflags, native: false, language: ['c'])
-add_global_arguments(qemu_cxxflags, native: false, language: ['cpp'])
add_global_arguments(qemu_objcflags, native: false, language: ['objc'])
+
+# Check that the C++ compiler exists and works with the C compiler.
+link_language = 'c'
+linker = cc
+qemu_cxxflags = []
+if add_languages('cpp', required: false, native: false)
+ cxx = meson.get_compiler('cpp')
+ add_global_arguments(['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'],
+ native: false, language: 'cpp')
+ foreach k: qemu_cflags
+ if k not in ['-Wstrict-prototypes', '-Wmissing-prototypes', '-Wnested-externs',
+ '-Wold-style-declaration', '-Wold-style-definition', '-Wredundant-decls']
+ qemu_cxxflags += [k]
+ endif
+ endforeach
+ add_global_arguments(qemu_cxxflags, native: false, language: 'cpp')
+
+ if cxx.links(files('scripts/main.c'), args: qemu_cflags)
+ link_language = 'cpp'
+ linker = cxx
+ else
+ message('C++ compiler does not work with C compiler')
+ message('Disabling C++-specific optional code')
+ endif
+endif
+
+# Exclude --warn-common with TSan to suppress warnings from the TSan libraries.
+if targetos != 'sunos' and not config_host.has_key('CONFIG_TSAN')
+ qemu_ldflags += linker.get_supported_link_arguments('-Wl,--warn-common')
+endif
+
add_global_link_arguments(qemu_ldflags, native: false, language: ['c', 'cpp', 'objc'])
if targetos == 'linux'
add_project_arguments('-iquote', '.',
'-iquote', meson.current_source_dir(),
'-iquote', meson.current_source_dir() / 'include',
- '-iquote', meson.current_source_dir() / 'disas/libvixl',
language: ['c', 'cpp', 'objc'])
-link_language = meson.get_external_property('link_language', 'cpp')
-if link_language == 'cpp'
- add_languages('cpp', required: true, native: false)
- cxx = meson.get_compiler('cpp')
- linker = cxx
-else
- linker = cc
-endif
if host_machine.system() == 'darwin'
add_languages('objc', required: false, native: false)
endif
.require(targetos == 'linux', error_message: 'Multiprocess QEMU is supported only on Linux') \
.allowed()
+vfio_user_server_allowed = get_option('vfio_user_server') \
+ .require(targetos == 'linux', error_message: 'vfio-user server is supported only on Linux') \
+ .allowed()
+
have_tpm = get_option('tpm') \
.require(targetos != 'windows', error_message: 'TPM emulation only available on POSIX systems') \
.allowed()
hvf = not_found
midl = not_found
widl = not_found
+pathcch = not_found
host_dsosuf = '.so'
if targetos == 'windows'
midl = find_program('midl', required: false)
widl = find_program('widl', required: false)
+ pathcch = cc.find_library('pathcch')
socket = cc.find_library('ws2_32')
winmm = cc.find_library('winmm')
native: false, language: ['c', 'cpp', 'objc'])
glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
link_args: config_host['GLIB_LIBS'].split(),
- version: config_host['GLIB_VERSION'])
+ version: config_host['GLIB_VERSION'],
+ variables: {
+ 'bindir': config_host['GLIB_BINDIR'],
+ })
# override glib dep with the configure results (for subprojects)
meson.override_dependency('glib-2.0', glib)
gio = not_found
gdbus_codegen = not_found
+gdbus_codegen_error = '@0@ requires gdbus-codegen, please install libgio'
if not get_option('gio').auto() or have_system
gio = dependency('gio-2.0', required: get_option('gio'),
method: 'pkg-config', kwargs: static_kwargs)
version: gio.version())
endif
endif
+if gdbus_codegen.found() and get_option('cfi')
+ gdbus_codegen = not_found
+ gdbus_codegen_error = '@0@ uses gdbus-codegen, which does not support control flow integrity'
+endif
lttng = not_found
if 'ust' in get_option('trace_backends')
endif
endif
-cocoa = dependency('appleframeworks', modules: 'Cocoa', required: get_option('cocoa'))
-if cocoa.found() and get_option('sdl').enabled()
- error('Cocoa and SDL cannot be enabled at the same time')
-endif
-if cocoa.found() and get_option('gtk').enabled()
- error('Cocoa and GTK+ cannot be enabled at the same time')
+cocoa = dependency('appleframeworks', modules: ['Cocoa', 'CoreVideo'],
+ required: get_option('cocoa'))
+
+vmnet = dependency('appleframeworks', modules: 'vmnet', required: get_option('vmnet'))
+if vmnet.found() and not cc.has_header_symbol('vmnet/vmnet.h',
+ 'VMNET_BRIDGED_MODE',
+ dependencies: vmnet)
+ vmnet = not_found
+ if get_option('vmnet').enabled()
+ error('vmnet.framework API is outdated')
+ else
+ warning('vmnet.framework API is outdated, disabling')
+ endif
endif
seccomp = not_found
method: 'pkg-config', kwargs: static_kwargs)
endif
+slirp = not_found
+if not get_option('slirp').auto() or have_system
+ slirp = dependency('slirp', required: get_option('slirp'),
+ method: 'pkg-config', kwargs: static_kwargs)
+ # slirp < 4.7 is incompatible with CFI support in QEMU. This is because
+ # it passes function pointers within libslirp as callbacks for timers.
+ # When using a system-wide shared libslirp, the type information for the
+ # callback is missing and the timer call produces a false positive with CFI.
+ # Do not use the "version" keyword argument to produce a better error.
+ # with control-flow integrity.
+ if get_option('cfi') and slirp.found() and slirp.version().version_compare('<4.7')
+ if get_option('slirp').enabled()
+ error('Control-Flow Integrity requires libslirp 4.7.')
+ else
+ warning('Cannot use libslirp since Control-Flow Integrity requires libslirp >= 4.7.')
+ slirp = not_found
+ endif
+ endif
+endif
+
vde = not_found
if not get_option('vde').auto() or have_system or have_tools
vde = cc.find_library('vdeplug', has_headers: ['libvdeplug.h'],
jack = dependency('jack', required: get_option('jack'),
method: 'pkg-config', kwargs: static_kwargs)
endif
+sndio = not_found
+if not get_option('sndio').auto() or have_system
+ sndio = dependency('sndio', required: get_option('sndio'),
+ method: 'pkg-config', kwargs: static_kwargs)
+endif
spice_protocol = not_found
if not get_option('spice_protocol').auto() or have_system
}'''
curses_dep_list = targetos == 'windows' ? ['ncurses', 'ncursesw'] : ['ncursesw']
- foreach curses_dep : curses_dep_list
- if not curses.found()
- curses = dependency(curses_dep,
- required: false,
- method: 'pkg-config',
- kwargs: static_kwargs)
- endif
- endforeach
+ curses = dependency(curses_dep_list,
+ required: false,
+ method: 'pkg-config',
+ kwargs: static_kwargs)
msg = get_option('curses').enabled() ? 'curses library not found' : ''
curses_compile_args = ['-DNCURSES_WIDECHAR=1']
if curses.found()
endif
sdl = not_found
-if not get_option('sdl').auto() or (have_system and not cocoa.found())
+if not get_option('sdl').auto() or have_system
sdl = dependency('sdl2', required: get_option('sdl'), kwargs: static_kwargs)
sdl_image = not_found
endif
gbm = dependency('gbm', method: 'pkg-config', required: false,
kwargs: static_kwargs)
endif
-have_vhost_user_gpu = have_vhost_user_gpu and virgl.found() and gbm.found()
+have_vhost_user_gpu = have_vhost_user_gpu and virgl.found() and opengl.found() and gbm.found()
gnutls = not_found
gnutls_crypto = not_found
# gcrypt over nettle for performance reasons.
gcrypt = not_found
nettle = not_found
+hogweed = not_found
xts = 'none'
if get_option('nettle').enabled() and get_option('gcrypt').enabled()
endif
endif
+gmp = dependency('gmp', required: false, method: 'pkg-config', kwargs: static_kwargs)
+if nettle.found() and gmp.found()
+ hogweed = dependency('hogweed', version: '>=3.4',
+ method: 'pkg-config',
+ required: get_option('nettle'),
+ kwargs: static_kwargs)
+endif
+
+
gtk = not_found
gtkx11 = not_found
vte = not_found
-if not get_option('gtk').auto() or (have_system and not cocoa.found())
+if not get_option('gtk').auto() or have_system
gtk = dependency('gtk+-3.0', version: '>=3.22.0',
method: 'pkg-config',
required: get_option('gtk'),
endif
png = not_found
if get_option('png').allowed() and have_system
- png = dependency('libpng', required: get_option('png'),
+ png = dependency('libpng', version: '>=1.6.34', required: get_option('png'),
method: 'pkg-config', kwargs: static_kwargs)
endif
vnc = not_found
method: 'pkg-config',
kwargs: static_kwargs)
endif
+canokey = not_found
+if have_system
+ canokey = dependency('canokey-qemu', required: get_option('canokey'),
+ method: 'pkg-config',
+ kwargs: static_kwargs)
+endif
usbredir = not_found
if not get_option('usb_redir').auto() or have_system
usbredir = dependency('libusbredirparser-0.5', required: get_option('usb_redir'),
error_message: 'vhost_user_blk_server requires linux') \
.require(have_vhost_user,
error_message: 'vhost_user_blk_server requires vhost-user support') \
- .disable_auto_if(not have_system) \
+ .disable_auto_if(not have_tools and not have_system) \
.allowed()
if get_option('fuse').disabled() and get_option('fuse_lseek').enabled()
endif
endif
+have_libvduse = (targetos == 'linux')
+if get_option('libvduse').enabled()
+ if targetos != 'linux'
+ error('libvduse requires linux')
+ endif
+elif get_option('libvduse').disabled()
+ have_libvduse = false
+endif
+
+have_vduse_blk_export = (have_libvduse and targetos == 'linux')
+if get_option('vduse_blk_export').enabled()
+ if targetos != 'linux'
+ error('vduse_blk_export requires linux')
+ elif not have_libvduse
+ error('vduse_blk_export requires libvduse support')
+ endif
+elif get_option('vduse_blk_export').disabled()
+ have_vduse_blk_export = false
+endif
+
# libbpf
libbpf = dependency('libbpf', required: get_option('bpf'), method: 'pkg-config')
if libbpf.found() and not cc.links('''
'oss': oss.found(),
'pa': pulse.found(),
'sdl': sdl.found(),
+ 'sndio': sndio.found(),
}
foreach k, v: audio_drivers_available
config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v)
# Default to native drivers first, OSS second, SDL third
audio_drivers_priority = \
- [ 'pa', 'coreaudio', 'dsound', 'oss' ] + \
+ [ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \
(targetos == 'linux' ? [] : [ 'sdl' ])
audio_drivers_default = []
foreach k: audio_drivers_priority
have_host_block_device = (targetos != 'darwin' or
cc.has_header('IOKit/storage/IOMedia.h'))
-# FIXME enable_modules shouldn't be necessary, but: https://github.com/mesonbuild/meson/issues/8333
dbus_display = get_option('dbus_display') \
.require(gio.version().version_compare('>=2.64'),
error_message: '-display dbus requires glib>=2.64') \
- .require(enable_modules,
- error_message: '-display dbus requires --enable-modules') \
.require(gdbus_codegen.found(),
- error_message: '-display dbus requires gdbus-codegen') \
+ error_message: gdbus_codegen_error.format('-display dbus')) \
+ .require(opengl.found() and gbm.found(),
+ error_message: '-display dbus requires epoxy/egl and gbm') \
.allowed()
have_virtfs = get_option('virtfs') \
config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)
config_host_data.set_quoted('CONFIG_QEMU_DATADIR', get_option('prefix') / qemu_datadir)
config_host_data.set_quoted('CONFIG_QEMU_DESKTOPDIR', get_option('prefix') / qemu_desktopdir)
-config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH', get_option('prefix') / get_option('qemu_firmwarepath'))
+
+qemu_firmwarepath = ''
+foreach k : get_option('qemu_firmwarepath')
+ qemu_firmwarepath += '"' + get_option('prefix') / k + '", '
+endforeach
+config_host_data.set('CONFIG_QEMU_FIRMWAREPATH', qemu_firmwarepath)
+
config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('prefix') / get_option('libexecdir'))
config_host_data.set_quoted('CONFIG_QEMU_ICONDIR', get_option('prefix') / qemu_icondir)
config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('prefix') / get_option('localedir'))
config_host_data.set('CONFIG_LIBSSH', libssh.found())
config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
+config_host_data.set('CONFIG_LIBURING_REGISTER_RING_FD', cc.has_function('io_uring_register_ring_fd', prefix: '#include <liburing.h>', dependencies:linux_io_uring))
config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
config_host_data.set('CONFIG_NUMA', numa.found())
config_host_data.set('CONFIG_OPENGL', opengl.found())
config_host_data.set('CONFIG_VHOST_USER', have_vhost_user)
config_host_data.set('CONFIG_VHOST_CRYPTO', have_vhost_user_crypto)
config_host_data.set('CONFIG_VHOST_VDPA', have_vhost_vdpa)
+config_host_data.set('CONFIG_VMNET', vmnet.found())
config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
+config_host_data.set('CONFIG_VDUSE_BLK_EXPORT', have_vduse_blk_export)
config_host_data.set('CONFIG_PNG', png.found())
config_host_data.set('CONFIG_VNC', vnc.found())
config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
config_host_data.set('CONFIG_TASN1', tasn1.found())
config_host_data.set('CONFIG_GCRYPT', gcrypt.found())
config_host_data.set('CONFIG_NETTLE', nettle.found())
+config_host_data.set('CONFIG_HOGWEED', hogweed.found())
config_host_data.set('CONFIG_QEMU_PRIVATE_XTS', xts == 'private')
config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)
config_host_data.set('CONFIG_STATX', has_statx)
config_host_data.set('CONFIG_GPROF', get_option('gprof'))
config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed())
config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
-config_host_data.set('CONFIG_REPLICATION', get_option('live_block_migration').allowed())
+config_host_data.set('CONFIG_REPLICATION', get_option('replication').allowed())
# has_header
config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
config_host_data.set('HAVE_SYS_DISK_H', cc.has_header('sys/disk.h'))
config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h'))
config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h'))
+if targetos == 'windows'
+ config_host_data.set('HAVE_AFUNIX_H', cc.has_header('afunix.h'))
+endif
# has_function
config_host_data.set('CONFIG_ACCEPT4', cc.has_function('accept4'))
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
+if rbd.found()
+ config_host_data.set('HAVE_RBD_NAMESPACE_EXISTS',
+ cc.has_function('rbd_namespace_exists',
+ dependencies: rbd,
+ prefix: '#include <rbd/librbd.h>'))
+endif
if rdma.found()
config_host_data.set('HAVE_IBV_ADVISE_MR',
cc.has_function('ibv_advise_mr',
cc.has_header_symbol('getopt.h', 'optreset'))
config_host_data.set('HAVE_IPPROTO_MPTCP',
cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
+config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
+ cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
# has_member
config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
#else
int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
#endif'''))
-config_host_data.set('CONFIG_PIPE2', cc.links(gnu_source_prefix + '''
- #include <unistd.h>
- #include <fcntl.h>
-
- int main(void)
- {
- int pipefd[2];
- return pipe2(pipefd, O_CLOEXEC);
- }'''))
config_host_data.set('CONFIG_POSIX_MADVISE', cc.links(gnu_source_prefix + '''
#include <sys/mman.h>
#include <stddef.h>
disassemblers = {
'alpha' : ['CONFIG_ALPHA_DIS'],
- 'arm' : ['CONFIG_ARM_DIS'],
'avr' : ['CONFIG_AVR_DIS'],
'cris' : ['CONFIG_CRIS_DIS'],
'hexagon' : ['CONFIG_HEXAGON_DIS'],
'sh4' : ['CONFIG_SH4_DIS'],
'sparc' : ['CONFIG_SPARC_DIS'],
'xtensa' : ['CONFIG_XTENSA_DIS'],
+ 'loongarch' : ['CONFIG_LOONGARCH_DIS'],
}
if link_language == 'cpp'
disassemblers += {
- 'aarch64' : [ 'CONFIG_ARM_A64_DIS'],
- 'arm' : [ 'CONFIG_ARM_DIS', 'CONFIG_ARM_A64_DIS'],
'mips' : [ 'CONFIG_MIPS_DIS', 'CONFIG_NANOMIPS_DIS'],
}
endif
(have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
(have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \
- (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : [])
+ (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \
+ (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : [])
ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]
##############
capstone = not_found
-capstone_opt = get_option('capstone')
-if capstone_opt in ['enabled', 'auto', 'system']
- have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')
+if not get_option('capstone').auto() or have_system or have_user
capstone = dependency('capstone', version: '>=3.0.5',
kwargs: static_kwargs, method: 'pkg-config',
- required: capstone_opt == 'system' or
- capstone_opt == 'enabled' and not have_internal)
+ required: get_option('capstone'))
# Some versions of capstone have broken pkg-config file
# that reports a wrong -I path, causing the #include to
if capstone.found() and not cc.compiles('#include <capstone.h>',
dependencies: [capstone])
capstone = not_found
- if capstone_opt == 'system'
- error('system capstone requested, it does not appear to work')
+ if get_option('capstone').enabled()
+ error('capstone requested, but it does not appear to work')
endif
endif
+endif
- if capstone.found()
- capstone_opt = 'system'
- elif have_internal
- capstone_opt = 'internal'
- else
- capstone_opt = 'disabled'
- endif
-endif
-if capstone_opt == 'internal'
- capstone_data = configuration_data()
- capstone_data.set('CAPSTONE_USE_SYS_DYN_MEM', '1')
-
- capstone_files = files(
- 'capstone/cs.c',
- 'capstone/MCInst.c',
- 'capstone/MCInstrDesc.c',
- 'capstone/MCRegisterInfo.c',
- 'capstone/SStream.c',
- 'capstone/utils.c'
- )
-
- if 'CONFIG_ARM_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_ARM', '1')
- capstone_files += files(
- 'capstone/arch/ARM/ARMDisassembler.c',
- 'capstone/arch/ARM/ARMInstPrinter.c',
- 'capstone/arch/ARM/ARMMapping.c',
- 'capstone/arch/ARM/ARMModule.c'
- )
- endif
-
- # FIXME: This config entry currently depends on a c++ compiler.
- # Which is needed for building libvixl, but not for capstone.
- if 'CONFIG_ARM_A64_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_ARM64', '1')
- capstone_files += files(
- 'capstone/arch/AArch64/AArch64BaseInfo.c',
- 'capstone/arch/AArch64/AArch64Disassembler.c',
- 'capstone/arch/AArch64/AArch64InstPrinter.c',
- 'capstone/arch/AArch64/AArch64Mapping.c',
- 'capstone/arch/AArch64/AArch64Module.c'
- )
- endif
-
- if 'CONFIG_PPC_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_POWERPC', '1')
- capstone_files += files(
- 'capstone/arch/PowerPC/PPCDisassembler.c',
- 'capstone/arch/PowerPC/PPCInstPrinter.c',
- 'capstone/arch/PowerPC/PPCMapping.c',
- 'capstone/arch/PowerPC/PPCModule.c'
- )
- endif
-
- if 'CONFIG_S390_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_SYSZ', '1')
- capstone_files += files(
- 'capstone/arch/SystemZ/SystemZDisassembler.c',
- 'capstone/arch/SystemZ/SystemZInstPrinter.c',
- 'capstone/arch/SystemZ/SystemZMapping.c',
- 'capstone/arch/SystemZ/SystemZModule.c',
- 'capstone/arch/SystemZ/SystemZMCTargetDesc.c'
- )
- endif
+libvfio_user_dep = not_found
+if have_system and vfio_user_server_allowed
+ have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libvfio-user/meson.build')
- if 'CONFIG_I386_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_X86', 1)
- capstone_files += files(
- 'capstone/arch/X86/X86Disassembler.c',
- 'capstone/arch/X86/X86DisassemblerDecoder.c',
- 'capstone/arch/X86/X86ATTInstPrinter.c',
- 'capstone/arch/X86/X86IntelInstPrinter.c',
- 'capstone/arch/X86/X86InstPrinterCommon.c',
- 'capstone/arch/X86/X86Mapping.c',
- 'capstone/arch/X86/X86Module.c'
- )
+ if not have_internal
+ error('libvfio-user source not found - please pull git submodule')
endif
- configure_file(output: 'capstone-defs.h', configuration: capstone_data)
+ libvfio_user_proj = subproject('libvfio-user')
- capstone_cargs = [
- # FIXME: There does not seem to be a way to completely replace the c_args
- # that come from add_project_arguments() -- we can only add to them.
- # So: disable all warnings with a big hammer.
- '-Wno-error', '-w',
-
- # Include all configuration defines via a header file, which will wind up
- # as a dependency on the object file, and thus changes here will result
- # in a rebuild.
- '-include', 'capstone-defs.h'
- ]
+ libvfio_user_lib = libvfio_user_proj.get_variable('libvfio_user_dep')
- libcapstone = static_library('capstone',
- build_by_default: false,
- sources: capstone_files,
- c_args: capstone_cargs,
- include_directories: 'capstone/include')
- capstone = declare_dependency(link_with: libcapstone,
- include_directories: 'capstone/include/capstone')
-endif
-
-slirp = not_found
-slirp_opt = 'disabled'
-if have_system
- slirp_opt = get_option('slirp')
- if slirp_opt in ['enabled', 'auto', 'system']
- have_internal = fs.exists(meson.current_source_dir() / 'slirp/meson.build')
- slirp_dep_required = (slirp_opt == 'system' or
- slirp_opt == 'enabled' and not have_internal)
- slirp = dependency('slirp', kwargs: static_kwargs,
- method: 'pkg-config', version: '>=4.1.0',
- required: slirp_dep_required)
- # slirp <4.7 is incompatible with CFI support in QEMU. This is because
- # it passes function pointers within libslirp as callbacks for timers.
- # When using a system-wide shared libslirp, the type information for the
- # callback is missing and the timer call produces a false positive with CFI.
- # Do not use the "version" keyword argument to produce a better error.
- # with control-flow integrity.
- if get_option('cfi') and slirp.found() and slirp.version().version_compare('<4.7')
- if slirp_dep_required
- error('Control-Flow Integrity requires libslirp 4.7.')
- else
- warning('Control-Flow Integrity requires libslirp 4.7, not using system-wide libslirp.')
- slirp = not_found
- endif
- endif
- if slirp.found()
- slirp_opt = 'system'
- elif have_internal
- slirp_opt = 'internal'
- else
- slirp_opt = 'disabled'
- endif
- endif
- if slirp_opt == 'internal'
- slirp_deps = []
- if targetos == 'windows'
- slirp_deps = cc.find_library('iphlpapi')
- elif targetos == 'darwin'
- slirp_deps = cc.find_library('resolv')
- endif
- slirp_conf = configuration_data()
- slirp_conf.set('SLIRP_MAJOR_VERSION', meson.project_version().split('.')[0])
- slirp_conf.set('SLIRP_MINOR_VERSION', meson.project_version().split('.')[1])
- slirp_conf.set('SLIRP_MICRO_VERSION', meson.project_version().split('.')[2])
- slirp_conf.set_quoted('SLIRP_VERSION_STRING', meson.project_version())
- slirp_cargs = ['-DG_LOG_DOMAIN="Slirp"']
- slirp_files = [
- 'slirp/src/arp_table.c',
- 'slirp/src/bootp.c',
- 'slirp/src/cksum.c',
- 'slirp/src/dhcpv6.c',
- 'slirp/src/dnssearch.c',
- 'slirp/src/if.c',
- 'slirp/src/ip6_icmp.c',
- 'slirp/src/ip6_input.c',
- 'slirp/src/ip6_output.c',
- 'slirp/src/ip_icmp.c',
- 'slirp/src/ip_input.c',
- 'slirp/src/ip_output.c',
- 'slirp/src/mbuf.c',
- 'slirp/src/misc.c',
- 'slirp/src/ncsi.c',
- 'slirp/src/ndp_table.c',
- 'slirp/src/sbuf.c',
- 'slirp/src/slirp.c',
- 'slirp/src/socket.c',
- 'slirp/src/state.c',
- 'slirp/src/stream.c',
- 'slirp/src/tcp_input.c',
- 'slirp/src/tcp_output.c',
- 'slirp/src/tcp_subr.c',
- 'slirp/src/tcp_timer.c',
- 'slirp/src/tftp.c',
- 'slirp/src/udp.c',
- 'slirp/src/udp6.c',
- 'slirp/src/util.c',
- 'slirp/src/version.c',
- 'slirp/src/vmstate.c',
- ]
-
- configure_file(
- input : 'slirp/src/libslirp-version.h.in',
- output : 'libslirp-version.h',
- configuration: slirp_conf)
-
- slirp_inc = include_directories('slirp', 'slirp/src')
- libslirp = static_library('slirp',
- build_by_default: false,
- sources: slirp_files,
- c_args: slirp_cargs,
- include_directories: slirp_inc)
- slirp = declare_dependency(link_with: libslirp,
- dependencies: slirp_deps,
- include_directories: slirp_inc)
- endif
+ libvfio_user_dep = declare_dependency(dependencies: [libvfio_user_lib])
endif
fdt = not_found
'qom',
'monitor',
'util',
+ 'gdbstub',
]
if have_linux_user
trace_events_subdirs += [ 'linux-user' ]
vhost_user = libvhost_user.get_variable('vhost_user_dep')
endif
+libvduse = not_found
+if have_libvduse
+ libvduse_proj = subproject('libvduse')
+ libvduse = libvduse_proj.get_variable('libvduse_dep')
+endif
+
# NOTE: the trace/ subdirectory needs the qapi_trace_events variable
# that is filled in by qapi/.
subdir('qapi')
subdir('crypto')
subdir('ui')
subdir('hw')
+subdir('gdbstub')
if enable_modules
subdir('softmmu')
common_ss.add(capstone)
-specific_ss.add(files('cpu.c', 'disas.c', 'gdbstub.c'), capstone)
+specific_ss.add(files('cpu.c', 'disas.c'), capstone)
# Work around a gcc bug/misfeature wherein constant propagation looks
# through an alias:
endforeach
if enable_modules
- modinfo_src = custom_target('modinfo.c',
- output: 'modinfo.c',
- input: modinfo_files,
- command: [modinfo_generate, '@INPUT@'],
- capture: true)
- modinfo_lib = static_library('modinfo', modinfo_src)
- modinfo_dep = declare_dependency(link_whole: modinfo_lib)
- softmmu_ss.add(modinfo_dep)
+ foreach target : target_dirs
+ if target.endswith('-softmmu')
+ config_target = config_target_mak[target]
+ config_devices_mak = target + '-config-devices.mak'
+ modinfo_src = custom_target('modinfo-' + target + '.c',
+ output: 'modinfo-' + target + '.c',
+ input: modinfo_files,
+ command: [modinfo_generate, '--devices', config_devices_mak, '@INPUT@'],
+ capture: true)
+
+ modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
+ modinfo_dep = declare_dependency(link_with: modinfo_lib)
+
+ arch = config_target['TARGET_NAME'] == 'sparc64' ? 'sparc64' : config_target['TARGET_BASE_ARCH']
+ hw_arch[arch].add(modinfo_dep)
+ endif
+ endforeach
endif
nm = find_program('nm')
install: true,
install_dir: qemu_moddir)
endforeach
+if emulator_modules.length() > 0
+ alias_target('modules', emulator_modules)
+endif
softmmu_ss.add(authz, blockdev, chardev, crypto, io, qmp)
common_ss.add(qom, qemuutil)
target_inc += include_directories('linux-headers', is_system: true)
endif
if target.endswith('-softmmu')
- qemu_target_name = 'qemu-system-' + target_name
target_type='system'
t = target_softmmu_arch[target_base_arch].apply(config_target, strict: false)
arch_srcs += t.sources()
abi = config_target['TARGET_ABI_DIR']
target_type='user'
target_inc += common_user_inc
- qemu_target_name = 'qemu-' + target_name
if target_base_arch in target_user_arch
t = target_user_arch[target_base_arch].apply(config_target, strict: false)
arch_srcs += t.sources()
summary_info = {}
summary_info += {'Install prefix': get_option('prefix')}
summary_info += {'BIOS directory': qemu_datadir}
-summary_info += {'firmware path': get_option('prefix') / get_option('qemu_firmwarepath')}
+pathsep = targetos == 'windows' ? ';' : ':'
+summary_info += {'firmware path': pathsep.join(get_option('qemu_firmwarepath'))}
summary_info += {'binary directory': get_option('prefix') / get_option('bindir')}
summary_info += {'library directory': get_option('prefix') / get_option('libdir')}
summary_info += {'module directory': qemu_moddir}
if targetos == 'windows' and have_ga
summary_info += {'wixl': wixl}
endif
-if slirp_opt != 'disabled' and have_system
+if slirp.found() and have_system
summary_info += {'smbd': have_slirp_smbd ? smbd_path : false}
endif
summary(summary_info, bool_yn: true, section: 'Host binaries')
summary_info += {'strip binaries': get_option('strip')}
summary_info += {'sparse': sparse}
summary_info += {'mingw32 support': targetos == 'windows'}
+summary(summary_info, bool_yn: true, section: 'Compilation')
# snarf the cross-compilation information for tests
+summary_info = {}
+have_cross = false
foreach target: target_dirs
- tcg_mak = meson.current_build_dir() / 'tests/tcg' / 'config-' + target + '.mak'
+ tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 'config-target.mak'
if fs.exists(tcg_mak)
config_cross_tcg = keyval.load(tcg_mak)
- target = config_cross_tcg['TARGET_NAME']
- compiler = ''
- if 'DOCKER_CROSS_CC_GUEST' in config_cross_tcg
- summary_info += {target + ' tests': config_cross_tcg['DOCKER_CROSS_CC_GUEST'] +
- ' via ' + config_cross_tcg['DOCKER_IMAGE']}
- elif 'CROSS_CC_GUEST' in config_cross_tcg
- summary_info += {target + ' tests'
- : config_cross_tcg['CROSS_CC_GUEST'] }
+ if 'CC' in config_cross_tcg
+ summary_info += {config_cross_tcg['TARGET_NAME']: config_cross_tcg['CC']}
+ have_cross = true
endif
- endif
+ endif
endforeach
-
-summary(summary_info, bool_yn: true, section: 'Compilation')
+if have_cross
+ summary(summary_info, bool_yn: true, section: 'Cross compilers')
+endif
# Targets and accelerators
summary_info = {}
if have_system
summary_info += {'default devices': get_option('default_devices')}
summary_info += {'out of process emulation': multiprocess_allowed}
+ summary_info += {'vfio-user server': vfio_user_server_allowed}
endif
summary(summary_info, bool_yn: true, section: 'Targets and accelerators')
summary_info += {'qed support': get_option('qed').allowed()}
summary_info += {'parallels support': get_option('parallels').allowed()}
summary_info += {'FUSE exports': fuse}
+ summary_info += {'VDUSE block exports': have_vduse_blk_export}
endif
summary(summary_info, bool_yn: true, section: 'Block layer support')
# Libraries
summary_info = {}
if targetos == 'darwin'
- summary_info += {'Cocoa support': cocoa}
+ summary_info += {'Cocoa support': cocoa}
+ summary_info += {'vmnet.framework support': vmnet}
endif
summary_info += {'SDL support': sdl}
summary_info += {'SDL image support': sdl_image}
summary_info += {'GTK support': gtk}
summary_info += {'pixman': pixman}
summary_info += {'VTE support': vte}
-summary_info += {'slirp support': slirp_opt == 'internal' ? slirp_opt : slirp}
+summary_info += {'slirp support': slirp}
summary_info += {'libtasn1': tasn1}
summary_info += {'PAM': pam}
summary_info += {'iconv support': iconv}
endif
if targetos not in ['darwin', 'haiku', 'windows']
summary_info += {'OSS support': oss}
+ summary_info += {'sndio support': sndio}
elif targetos == 'darwin'
summary_info += {'CoreAudio support': coreaudio}
elif targetos == 'windows'
summary_info += {'lzfse support': liblzfse}
summary_info += {'zstd support': zstd}
summary_info += {'NUMA host support': numa}
-summary_info += {'capstone': capstone_opt == 'internal' ? capstone_opt : capstone}
+summary_info += {'capstone': capstone}
summary_info += {'libpmem support': libpmem}
summary_info += {'libdaxctl support': libdaxctl}
summary_info += {'libudev': libudev}