Lines Matching +full:build +full:- +full:libvhost +full:- +full:user

10 meson.add_postconf_script(find_program('scripts/symlink-install-tree.py'))
23 config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
26 # configure runs. Since it is in the build directory
30 tmpdir = meson.current_build_dir() / 'meson-private/temp'
56 # type of binaries to build
61 have_linux_user = have_linux_user or target.endswith('linux-user')
62 have_bsd_user = have_bsd_user or target.endswith('bsd-user')
63 have_system = have_system or target.endswith('-softmmu')
107 …dgen.version() + ' is unsupported. You can install a new version with "cargo install bindgen-cli"')
114 message('To use Rust you can install a new version with "cargo install bindgen-cli"')
132 # instead. QEMU --enable-modules depends on this because the SystemTap
135 add_global_arguments('-DSTAP_SDT_V2',
146 edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu', 'riscv64-softm…
168 args: ['-Werror', '-fsanitize=fuzzer'])
169 error('Your compiler does not support -fsanitize=fuzzer')
186 # Miscellaneous Linux-only features
195 .require(host_os == 'linux', error_message: 'vfio-user server is supported only on Linux') \
206 error_message: 'vhost-user is not available on Windows').allowed()
209 error_message: 'vhost-vdpa is only available on Linux').allowed()
212 error_message: 'vhost-kernel is only available on Linux').allowed()
215 error_message: 'vhost-crypto requires vhost-user to be enabled').allowed()
258 kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
260 kvm_targets = ['aarch64-softmmu']
262 kvm_targets = ['s390x-softmmu']
264 kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
266 kvm_targets = ['mips-softmmu', 'mipsel-softmmu', 'mips64-softmmu', 'mips64el-softmmu']
268 kvm_targets = ['riscv32-softmmu']
270 kvm_targets = ['riscv64-softmmu']
272 kvm_targets = ['loongarch64-softmmu']
279 xen_targets = ['i386-softmmu', 'x86_64-softmmu']
282 xen_targets = ['i386-softmmu', 'x86_64-softmmu', 'aarch64-softmmu']
290 'CONFIG_HVF': ['aarch64-softmmu']
296 'CONFIG_HVF': ['x86_64-softmmu'],
297 'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'],
298 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
303 # Darwin does not support references to thread-local variables in modules
305 modular_tcg = ['i386-softmmu', 'x86_64-softmmu']
333 # We use -fwrapv to tell the compiler that we require a C dialect where
335 # 2s-complement style results. (Both clang and gcc agree that it
339 '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE',
340 '-fno-strict-aliasing', '-fno-common', '-fwrapv' ]
348 qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0'
352 qemu_common_flags += '-D_XOPEN_SOURCE=600'
354 qemu_common_flags += '-D__EXTENSIONS__'
356 qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC']
359 args: '-Werror')
360 …error('Your compiler does not support __attribute__((gcc_struct)) - please use GCC instead of Clan…
364 # Choose instruction set (currently x86-only)
368 # __sync_fetch_and_and requires at least -march=i486. Many toolchains
384 qemu_isa_flags += ['-march=i486']
387 # Pick x86-64 baseline version
390 error('x86_64-v1 required for x86-64 hosts')
396 qemu_common_flags = ['-mfpmath=sse'] + qemu_common_flags
399 # x86-64-v1, so only include -mneeded for x86-64 version 2 and above
400 qemu_isa_flags += ['-mcx16']
404 qemu_isa_flags += ['-mpopcnt']
405 qemu_isa_flags += cc.get_supported_arguments('-mneeded')
408 qemu_isa_flags += ['-mmovbe', '-mabm', '-mbmi', '-mbmi2', '-mfma', '-mf16c']
413 qemu_isa_flags += ['-msse2']
415 qemu_isa_flags += ['-msse4.2']
417 qemu_isa_flags += ['-mavx2']
419 qemu_isa_flags += ['-mavx512f', '-mavx512bw', '-mavx512cd', '-mavx512dq', '-mavx512vl']
426 qemu_ldflags += get_option('b_pie') ? '-static-pie' : '-static'
429 # Meson currently only handles pie as a boolean for now, so if the user
432 # -no-pie is supposedly a linker flag that has no effect on the compiler
435 # a compiler command-line flag.
437 # What about linker flags? For a static build, no PIE is implied by -static
440 # distro and do not use --disable-pie in the meanwhile). For dynamic linking,
441 # instead, we can't add -no-pie because it overrides -shared: the linker then
442 # tries to build an executable instead of a shared library and fails. So
443 # don't add -no-pie anywhere and cross fingers. :(
445 qemu_common_flags += cc.get_supported_arguments('-fno-pie', '-no-pie')
452 char arr[64], *p = arr, *c = argv[argc - 1];
459 foreach arg : ['-fstack-protector-strong', '-fstack-protector-all']
461 # setups fail only on a .c->.o compile and some only at link time
462 if cc.compiles(stack_protector_probe, args: ['-Werror', arg]) and \
463 cc.links(stack_protector_probe, args: ['-Werror', arg])
514 safe_stack_arg = get_option('safe_stack') ? '-fsanitize=safe-stack' : '-fno-sanitize=safe-stack'
528 if cc.has_argument('-fsanitize=address')
529 qemu_cflags = ['-fsanitize=address'] + qemu_cflags
530 qemu_ldflags = ['-fsanitize=address'] + qemu_ldflags
532 error('Your compiler does not support -fsanitize=address')
540 args: [qemu_ldflags, '-fsanitize=undefined'])
541 qemu_cflags += ['-fsanitize=undefined']
542 qemu_ldflags += ['-fsanitize=undefined']
547 if cc.has_argument('-fno-sanitize=function')
548 qemu_cflags += ['-fno-sanitize=function']
551 error('Your compiler does not support -fsanitize=undefined')
562 args: '-fsanitize=thread',
568 # "error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’"
569 # https://gcc.gnu.org/gcc-11/changes.html
571 if cc.has_argument('-Wno-tsan')
572 tsan_warn_suppress = ['-Wno-tsan']
574 qemu_cflags = ['-fsanitize=thread'] + tsan_warn_suppress + qemu_cflags
575 qemu_ldflags = ['-fsanitize=thread'] + qemu_ldflags
579 # The combination is known as "full relro", because .got.plt is read-only too.
580 qemu_ldflags += cc.get_supported_link_arguments('-Wl,-z,relro', '-Wl,-z,now')
583 qemu_ldflags += cc.get_supported_link_arguments('-Wl,--no-seh', '-Wl,--nxcompat')
584 qemu_ldflags += cc.get_supported_link_arguments('-Wl,--dynamicbase', '-Wl,--high-entropy-va')
589 # virtual-devices.
590 configure_file(output: 'instrumentation-filter',
591 input: 'scripts/oss-fuzz/instrumentation-filter-template',
595 name: '-fsanitize-coverage-allowlist=/dev/null',
596 args: ['-fsanitize-coverage-allowlist=/dev/null',
597 '-fsanitize-coverage=trace-pc'] )
598 qemu_common_flags += ['-fsanitize-coverage-allowlist=instrumentation-filter']
602 # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
603 # compiled code. To build non-fuzzer binaries with --enable-fuzzing, link
604 # everything with fsanitize=fuzzer-no-link. Otherwise, the linker will be
605 # unable to bind the fuzzer-related callbacks added by instrumentation.
606 qemu_common_flags += ['-fsanitize=fuzzer-no-link']
607 qemu_ldflags += ['-fsanitize=fuzzer-no-link']
609 # library. They need to be configurable, to support OSS-Fuzz
610 fuzz_exe_ldflags = ['-fsanitize=fuzzer']
612 # LIB_FUZZING_ENGINE was set; assume we are running on OSS-Fuzz, and
622 error('Selected Control-Flow Integrity but LTO is disabled')
625 error('Selected Control-Flow Integrity is not compatible with modules')
630 if cc.compiles('int main () { return 0; }', name: '-fsanitize=cfi-icall',
631 args: ['-flto', '-fsanitize=cfi-icall'] )
632 cfi_flags += '-fsanitize=cfi-icall'
634 error('-fsanitize=cfi-icall is not supported by the compiler')
637 name: '-fsanitize-cfi-icall-generalize-pointers',
638 args: ['-flto', '-fsanitize=cfi-icall',
639 '-fsanitize-cfi-icall-generalize-pointers'] )
640 cfi_flags += '-fsanitize-cfi-icall-generalize-pointers'
642 error('-fsanitize-cfi-icall-generalize-pointers is not supported by the compiler')
646 name: '-fno-sanitize-trap=cfi-icall',
647 args: ['-flto', '-fsanitize=cfi-icall',
648 '-fno-sanitize-trap=cfi-icall'] )
649 cfi_flags += '-fno-sanitize-trap=cfi-icall'
651 error('-fno-sanitize-trap=cfi-icall is not supported by the compiler')
664 '-ftrivial-auto-var-init=zero',
672 # https://github.com/llvm/llvm-project/issues/75168
675 # https://gitlab.com/qemu-project/qemu/-/issues/2278
678 name: '-fzero-call-used-regs=used-gpr',
679 args: ['-O2', '-fzero-call-used-regs=used-gpr'])
680 hardening_flags += '-fzero-call-used-regs=used-gpr'
691 '-Wempty-body',
692 '-Wendif-labels',
693 '-Wexpansion-to-defined',
694 '-Wformat-security',
695 '-Wformat-y2k',
696 '-Wignored-qualifiers',
697 '-Wimplicit-fallthrough=2',
698 '-Winit-self',
699 '-Wmissing-format-attribute',
700 '-Wmissing-prototypes',
701 '-Wnested-externs',
702 '-Wold-style-declaration',
703 '-Wold-style-definition',
704 '-Wredundant-decls',
705 '-Wshadow=local',
706 '-Wstrict-prototypes',
707 '-Wtype-limits',
708 '-Wundef',
709 '-Wvla',
710 '-Wwrite-strings',
713 '-Wno-gnu-variable-sized-type-not-at-end',
714 '-Wno-initializer-overrides',
715 '-Wno-missing-include-dirs',
716 '-Wno-psabi',
717 '-Wno-shift-negative-value',
718 '-Wno-string-plus-int',
719 '-Wno-tautological-type-limit-compare',
720 '-Wno-typedef-redefinition',
733 ''', args: ['-Wthread-safety', '-Werror'])
735 warn_flags += ['-Wthread-safety']
742 …qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + …
752 # Note sanitizer flags are not applied to Objective-C sources!
756 add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
757 '-isystem', 'linux-headers',
761 add_project_arguments('-iquote', '.',
762 '-iquote', meson.current_source_dir(),
763 '-iquote', meson.current_source_dir() / 'include',
766 # If a host-specific include directory exists, list that first...
769 add_project_arguments('-iquote', host_include / host_arch,
773 add_project_arguments('-iquote', host_include / 'generic',
780 'compile_commands.json', sparse.full_path(), '-Wbitwise',
781 '-Wno-transparent-union', '-Wno-old-initializer',
782 '-Wno-non-pointer-null'])
786 # Host-specific libraries and flags #
811 depend_files: files('pc-bios/qemu-nsis.ico'),
829 emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded')
834 # Host-specific configuration of accelerators #
843 error('WHPX requires 64-bit host')
871 error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
877 warning('It is strongly recommended to remove the --enable-tcg-interpreter')
888 add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
910 method: 'pkg-config')
917 method: 'pkg-config',
920 method: 'pkg-config',
923 method: 'pkg-config',
926 method: 'pkg-config',
929 method: 'pkg-config',
933 method: 'pkg-config')])
958 # Use -D to pick just one of the test programs in scripts/xen-detect.c
961 ('0' + xen_version[1]).substring(-2) + \
962 ('0' + xen_version[2]).substring(-2)
963 if cc.links(files('scripts/xen-detect.c'),
964 args: '-DCONFIG_XEN_CTRL_INTERFACE_VERSION=' + xen_ctrl_version,
995 glib_pc = dependency('glib-2.0', version: glib_req_ver, required: true,
996 method: 'pkg-config')
999 gmodule = dependency('gmodule-export-2.0', version: glib_req_ver, required: true,
1000 method: 'pkg-config')
1002 gmodule = dependency('gmodule-no-export-2.0', version: glib_req_ver, required: true,
1003 method: 'pkg-config')
1008 # This workaround is required due to a bug in pkg-config file for glib as it
1009 # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static
1011 glib_cflags += ['-DGLIB_STATIC_COMPILATION']
1016 # problems on multi-arch where people try to build
1017 # 32-bit QEMU while pointing at 64-bit glib headers
1024 typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused));
1032 to the right pkg-config files for your build target.''')
1048 meson.override_dependency('glib-2.0', glib)
1056 gdbus_codegen_error = '@0@ requires gdbus-codegen, please install libgio'
1058 gio = dependency('gio-2.0', required: get_option('gio'),
1059 method: 'pkg-config')
1073 gdbus_codegen = find_program('gdbus-codegen',
1075 gio_unix = dependency('gio-unix-2.0', required: get_option('gio'),
1076 method: 'pkg-config')
1083 gdbus_codegen_error = '@0@ uses gdbus-codegen, which does not support control flow integrity'
1086 xml_pp = find_program('scripts/xml-preprocess.py')
1090 lttng = dependency('lttng-ust', required: true, version: '>= 2.1',
1091 method: 'pkg-config')
1095 pixman = dependency('pixman-1', required: get_option('pixman'), version:'>=0.21.8',
1096 method: 'pkg-config')
1117 method: 'pkg-config')
1127 method: 'pkg-config')
1149 cc.links(libattr_test, dependencies: libattr, args: '-DCONFIG_LIBATTR')
1183 method: 'pkg-config')
1193 libcap_ng = cc.find_library('cap-ng', has_headers: ['cap-ng.h'],
1197 #include <cap-ng.h>
1205 error('could not link libcap-ng')
1207 warning('could not link libcap-ng, disabling')
1215 method: 'pkg-config')
1221 method: 'pkg-config')
1224 # When using a system-wide shared libslirp, the type information for the
1227 # with control-flow integrity.
1230 error('Control-Flow Integrity requires libslirp 4.7.')
1232 warning('Cannot use libslirp since Control-Flow Integrity requires libslirp >= 4.7.')
1263 method: 'pkg-config')
1268 method: 'pkg-config')
1273 method: 'pkg-config')
1277 pipewire = dependency('libpipewire-0.3', version: '>=0.3.60',
1279 method: 'pkg-config')
1284 method: 'pkg-config')
1289 spice_protocol = dependency('spice-protocol', version: '>=0.14.0',
1291 method: 'pkg-config')
1299 spice = dependency('spice-server', version: '>=0.14.0',
1301 method: 'pkg-config')
1311 method: 'pkg-config')
1317 method: 'pkg-config')
1323 method: 'pkg-config')
1329 method: 'pkg-config')
1332 method: 'pkg-config')
1342 method: 'pkg-config')
1350 method: 'pkg-config',
1356 method: 'pkg-config',
1362 method: 'pkg-config',
1368 method: 'pkg-config',
1374 method: 'pkg-config',
1454 method: 'pkg-config')
1456 curses_compile_args = ['-DNCURSES_WIDECHAR=1']
1470 curses_compile_args += ['-I/usr/include/ncursesw']
1491 foreach link_args : [ ['-liconv'], [] ]
1495 # However, without adding glib to the dependencies -L/usr/local/lib will not be
1500 iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
1501 return conv != (iconv_t) -1;
1547 # Some versions of SDL have problems with -Wundef
1552 ''', dependencies: sdl, args: '-Werror=undef')
1553 sdl = declare_dependency(compile_args: '-Wno-undef',
1558 method: 'pkg-config')
1561 error('sdl-image required, but SDL was @0@'.format(
1597 glusterfs = dependency('glusterfs-api', version: '>=3',
1599 method: 'pkg-config')
1647 error('could not enable hv-balloon, update your glib')
1649 warning('could not find glib support for hv-balloon, disabling')
1657 method: 'pkg-config',
1712 dsound = declare_dependency(link_args: ['-lole32', '-ldxguid'])
1730 epoxy = dependency('epoxy', method: 'pkg-config',
1740 gbm = dependency('gbm', method: 'pkg-config', required: false)
1767 method: 'pkg-config',
1774 method: 'pkg-config',
1804 # Debian has removed -lgpg-error from libgcrypt-config
1810 cc.find_library('gpg-error', required: true)],
1838 method: 'pkg-config',
1871 // HMAC-SM3 test
1886 method: 'pkg-config',
1889 # Some versions of capstone have broken pkg-config file
1890 # that reports a wrong -I path, causing the #include to
1902 gmp = dependency('gmp', required: false, method: 'pkg-config')
1905 method: 'pkg-config',
1920 gtk = dependency('gtk+-3.0', version: '>=3.22.0',
1921 method: 'pkg-config',
1924 gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
1925 method: 'pkg-config',
1931 vte = dependency('vte-2.91',
1932 method: 'pkg-config',
1942 x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found())
1947 method: 'pkg-config')
1959 method: 'pkg-config')
1964 compile_args: '-DSTRUCT_IOVEC_DEFINED')
1978 const char *user = "frank";
1981 pam_start(service_name, user, &pam_conv, &pamh);
1994 snappy = cc.find_library('snappy', has_headers: ['snappy-c.h'],
1998 #include <snappy-c.h>
2085 version: '>=2.5.1', method: 'pkg-config')
2089 u2f = dependency('u2f-emu', required: get_option('u2f'),
2090 method: 'pkg-config')
2094 canokey = dependency('canokey-qemu', required: get_option('canokey'),
2095 method: 'pkg-config')
2099 usbredir = dependency('libusbredirparser-0.5', required: get_option('usb_redir'),
2100 version: '>=0.6', method: 'pkg-config')
2104 libusb = dependency('libusb-1.0', required: get_option('libusb'),
2105 version: '>=1.0.13', method: 'pkg-config')
2111 method: 'pkg-config')
2116 version: '>=57', method: 'pkg-config')
2122 method: 'pkg-config')
2127 method: 'pkg-config')
2135 method: 'pkg-config')
2152 error('malloc_trim not available with non-libc memory allocator')
2174 error_message: 'vhost_user_blk_server requires vhost-user support') \
2179 error('Cannot enable fuse-lseek while fuse is disabled')
2183 version: '>=3.1', method: 'pkg-config')
2192 error('fuse-lseek requires libfuse >=3.8, found ' + fuse.version())
2194 error('fuse-lseek requires libfuse, which was not found')
2221 …ependency('libbpf', version: '>=' + bpf_version, required: get_option('bpf'), method: 'pkg-config')
2245 version: '>=1.4.0', method: 'pkg-config')
2258 method: 'pkg-config',
2263 # config-host.h #
2315 error_message: '-display dbus requires glib>=2.64') \
2317 error_message: gdbus_codegen_error.format('-display dbus')) \
2322 error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
2324 … error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \
2326 error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \
2385 meson.current_source_dir() / 'scripts/qemu-stamp.py',
2386 meson.project_version(), get_option('pkgversion'), '--',
2411 error('Cannot enable module-upgrades as modules are not enabled')
2556 ('0' + xen_version[1]).substring(-2) + \
2557 ('0' + xen_version[2]).substring(-2)
2645 args: '-fsanitize=address',
2658 # libinotify-kqueue
2739 # missing-prototype case, we try again with a definitely-bogus prototype.
2764 # i.e. errno is set and -1 is returned. That's not really how POSIX defines the
2837 int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
2900 }''', args: ['-Werror']))
2902 # See if 64-bit atomic operations are supported.
2936 # "do we have 128-bit atomics which are handled inline and specifically not
2939 # We only care about these operations on 16-byte aligned pointers, so
2940 # force 16-byte alignment of the pointer, which may be greater than
2944 __uint128_t *p = __builtin_assume_aligned(av[ac - 1], 16);
3049 int main(int argc, char *argv[]) { return bar(argv[argc - 1]); }
3153 error('mingw must provide setjmp/longjmp for windows-arm64')
3219 config_target = { 'TARGET_NAME': target.split('-')[0] }
3220 if target.endswith('linux-user')
3228 elif target.endswith('bsd-user')
3240 if target.endswith('-user')
3309 # Note that TARGET_BASE_ARCH ends up in config-target.h but it is
3324 config_target_h += {target: configure_file(output: target + '-config-target.h',
3327 if target.endswith('-softmmu')
3332 config_devices_mak = target + '-config-devices.mak'
3339 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
3349 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
3363 genh += custom_target('config-poison.h',
3365 output: 'config-poison.h',
3367 command: [find_program('scripts/make-config-poison.sh'),
3380 libvfio_user_proj = subproject('libvfio-user', required: true)
3386 libvhost_user = subproject('libvhost-user') project
3400 genh += configure_file(output: 'config-host.h', configuration: config_host_data)
3405 '--config-headers', meson.project_build_root() / 'config-host.h',
3410 rustc_args += ['-D', 'unsafe_op_in_unsafe_fn']
3417 rustc_args += ['-A', 'unknown_lints']
3422 # is safe; https://github.com/rust-lang/rust/pull/54675 says that
3423 # passing -nodefaultlibs to the linker "was more ideological to
3425 add_project_arguments(rustc_args + ['-C', 'default-linker-libraries'],
3433 qapi_gen = find_program('scripts/qapi-gen.py')
3448 meson.current_source_dir() / 'scripts/qapi-gen.py'
3453 '--backend=' + ','.join(get_option('trace_backends'))
3475 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
3478 qemu_version = custom_target('qemu-version.h',
3479 output: 'qemu-version.h',
3488 ['qemu-options.hx', 'qemu-options.def'],
3489 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
3493 ['hmp-commands.hx', 'hmp-commands.h'],
3494 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
3502 command: [hxtool, '-h', '@INPUT0@'])
3510 # TODO: add each directory to the subdirs from its own meson.build, once
3521 trace_events_subdirs += [ 'linux-user' ]
3524 trace_events_subdirs += [ 'bsd-user' ]
3574 'hw/pci-host',
3674 …libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_ar…
3675 …ndency(objects: libmodulecommon.extract_all_objects(recursive: false), compile_args: '-DBUILD_DSO')
3685 event_loop_base = files('event-loop-base.c')
3686 event_loop_base = static_library('event-loop-base',
3706 output: 'decode-@BASENAME@.c.inc',
3707 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
3723 'qemu-io-cmds.c',
3735 'blockdev-nbd.c',
3737 'job-qmp.c',
3740 # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
3741 # os-win32.c does not
3743 system_ss.add(files('os-win32.c'))
3745 blockdev_ss.add(files('os-posix.c'))
3749 common_ss.add(files('cpu-common.c'))
3750 specific_ss.add(files('cpu-target.c'))
3758 # impossible, as the alias is restricted to page-vary-common.c. Indeed,
3759 # without lto, not even the alias is required -- we simply use different
3761 pagevary = files('page-vary-common.c')
3763 pagevary_flags = ['-fno-lto']
3765 pagevary_flags += '-fno-sanitize=cfi-icall'
3767 pagevary = static_library('page-vary-common', sources: pagevary + genh,
3772 specific_ss.add(files('page-target.c', 'page-vary-target.c'))
3794 subdir('common-user')
3795 subdir('bsd-user')
3796 subdir('linux-user')
3813 modinfo_collect = find_program('scripts/modinfo-collect.py')
3814 modinfo_generate = find_program('scripts/modinfo-generate.py')
3829 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
3848 modinfo_files += custom_target(d + '-' + m + '.modinfo',
3849 output: d + '-' + m + '.modinfo',
3869 if target.endswith('-softmmu')
3872 c_args = ['-DCOMPILING_PER_TARGET',
3873 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3874 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3877 module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
3896 … command: [modinfo_collect, '--target', target, target_module_ss.sources()])
3908 if target.endswith('-softmmu')
3910 config_devices_mak = target + '-config-devices.mak'
3911 modinfo_src = custom_target('modinfo-' + target + '.c',
3912 output: 'modinfo-' + target + '.c',
3914 … command: [modinfo_generate, '--devices', config_devices_mak, '@INPUT@'],
3917 modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
4020 # and is not built by default; therefore, source files not used by the build
4021 # configuration will be in build.ninja, but are never built by default.
4030 # We would like to use --generate-cstr, but it is only available
4032 # is 0.60.x (Debian 12 has 0.60.1) which introduces --allowlist-file.
4034 '--disable-header-comment',
4035 '--raw-line', '// @generated',
4036 '--ctypes-prefix', 'std::os::raw',
4037 '--generate-block',
4038 '--impl-debug',
4039 '--no-doc-comments',
4040 '--with-derive-default',
4041 '--no-layout-tests',
4042 '--no-prepend-enum-name',
4043 '--allowlist-file', meson.project_source_root() + '/include/.*',
4044 '--allowlist-file', meson.project_source_root() + '/.*',
4045 '--allowlist-file', meson.project_build_root() + '/.*'
4049 bindgen_args += ['--no-rustfmt-bindings']
4051 bindgen_args += ['--formatter', 'none']
4056 bindgen_args += ['--size_t-is-usize']
4058 bindgen_args += ['--merge-extern-blocks']
4073 bindgen_args += ['--rustified-enum', enum]
4080 bindgen_args += ['--bitfield-enum', enum]
4087 # this case you must pass the path to `clang` and `libclang` to your build
4117 c_args = ['-DCOMPILING_PER_TARGET',
4118 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
4119 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
4124 target_inc += include_directories('linux-headers', is_system: true)
4126 if target.endswith('-softmmu')
4143 target_type='user'
4151 base_dir = 'linux-user'
4154 base_dir = 'bsd-user'
4155 target_inc += include_directories('bsd-user/' / host_os)
4156 target_inc += include_directories('bsd-user/host/' / host_arch)
4176 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
4177 output: target + '-gdbstub-xml.c',
4212 override_options: ['rust_std=2021', 'build.rust_std=2021'],
4226 lib = static_library('qemu-' + target,
4234 if target.endswith('-softmmu')
4236 'name': 'qemu-system-' + target_name,
4243 'name': 'qemu-system-' + target_name + 'w',
4252 'name': 'qemu-fuzz-' + target_name,
4260 'name': 'qemu-' + target_name,
4269 exe_name += '-unsigned'
4282 icon = 'pc-bios/qemu.rsrc'
4300 meson.add_install_script(entitlement, '--install',
4309 'probe-prefix': 'qemu.' + target_type + '.' + target_name,
4315 # Other build targets
4318 install_headers('include/qemu/qemu-plugin.h')
4328 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
4329 # when we don't build tools or system
4331 # used for the update-keymaps target, so include rules even if !have_tools
4332 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
4337 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
4340 qemu_io = executable('qemu-io', files('qemu-io.c'),
4343 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
4348 subdir('storage-daemon')
4350 foreach exe: [ 'qemu-img', 'qemu-io', 'qemu-nbd', 'qemu-storage-daemon']
4353 'probe-prefix': 'qemu.' + exe.substring(5).replace('-', '_')
4359 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
4364 subdir('contrib/vhost-user-blk')
4365 subdir('contrib/vhost-user-gpu')
4366 subdir('contrib/vhost-user-input')
4367 subdir('contrib/vhost-user-scsi')
4371 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
4376 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
4382 executable('qemu-vmsr-helper', files('tools/i386/qemu-vmsr-helper.c'),
4390 subdir('contrib/ivshmem-client')
4391 subdir('contrib/ivshmem-server')
4398 …{'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / t['exe'], 'install': false…
4400 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
4401 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
4404 tracetool, '--group=all', '--format=' + stp['fmt'],
4405 '--binary=' + stp['bin'],
4406 '--probe-prefix=' + t['probe-prefix'],
4423 subdir('pc-bios')
4438 '--',
4439 '-DDISPLAYVERSION=' + meson.project_version(),
4442 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
4445 nsis_cmd += '-DCONFIG_GTK=y'
4449 output: 'qemu-setup-' + meson.project_version() + '.exe',
4460 # Build environment
4462 summary_info += {'Build directory': meson.current_build_dir()}
4465 summary(summary_info, bool_yn: true, section: 'Build environment')
4490 summary_info += {'sphinx-build': sphinx_build}
4512 summary_info += {'system-mode emulation': have_system}
4513 summary_info += {'user-mode emulation': have_user}
4526 summary_info += {'Trace output file': get_option('trace_file') + '-<pid>'}
4528 summary_info += {'D-Bus display': dbus_display}
4531 summary_info += {'vhost-kernel support': have_vhost_kernel}
4532 summary_info += {'vhost-net support': have_vhost_net}
4533 summary_info += {'vhost-user support': have_vhost_user}
4534 summary_info += {'vhost-user-crypto support': have_vhost_user_crypto}
4535 summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
4536 summary_info += {'vhost-vdpa support': have_vhost_vdpa}
4537 summary_info += {'build guest agent': have_ga}
4552 summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
4554 summary_info += {'Objective-C compiler': false}
4564 option_cflags = (get_option('debug') ? ['-g'] : [])
4566 option_cflags += ['-O' + get_option('optimization')]
4587 summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
4589 summary_info += {'static build': get_option('prefer_static')}
4609 # snarf the cross-compilation information for tests
4613 tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 'config-target.mak'
4656 summary_info += {'vfio-user server': vfio_user_server_allowed}
4701 summary_info += {'rng-none': get_option('rng_none')}
4728 summary(summary_info, bool_yn: true, section: 'User interface')
4779 summary_info += {'libcap-ng support': libcap_ng}
4797 summary_info += {'hv-balloon support': hv_balloon}
4819 summary_info += {'libinotify-kqueue': inotify}
4830 message('to maintain it and providing a build host for our continuous')
4834 message('configure has succeeded and you can continue to build, but')
4852 message('configure has succeeded and you can continue to build, but')
4855 message('to maintain it and providing a build host for our continuous')
4863 message('contact the developers at qemu-devel@nongnu.org.')
4881 message('Use --disable-relocatable to remove this warning.')