Lines Matching +full:- +full:- +full:enable +full:- +full:sparse

15 meson.add_postconf_script(find_program('scripts/symlink-install-tree.py'))
28 config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
35 tmpdir = meson.current_build_dir() / 'meson-private/temp'
66 have_linux_user = have_linux_user or target.endswith('linux-user')
67 have_bsd_user = have_bsd_user or target.endswith('bsd-user')
68 have_system = have_system or target.endswith('-softmmu')
113 …dgen.version() + ' is unsupported. You can install a new version with "cargo install bindgen-cli"')
120 message('To use Rust you can install a new version with "cargo install bindgen-cli"')
128 '--rustc-version', rustc.version(),
129 '--workspace', meson.project_source_root() / 'rust']
131 rustc_args += ['--strict-lints']
136 rustc_lint_args = run_command(rustc_args, '--lints',
141 # is safe; https://github.com/rust-lang/rust/pull/54675 says that
142 # passing -nodefaultlibs to the linker "was more ideological to
145 ['--cfg', 'MESON', '-C', 'default-linker-libraries'],
147 add_project_arguments(rustc_lint_args + ['--cfg', 'MESON'],
159 # instead. QEMU --enable-modules depends on this because the SystemTap
162 add_global_arguments('-DSTAP_SDT_V2',
173 edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu', 'riscv64-softm…
195 args: ['-Werror', '-fsanitize=fuzzer'])
196 error('Your compiler does not support -fsanitize=fuzzer')
213 # Miscellaneous Linux-only features
222 .require(host_os == 'linux', error_message: 'vfio-user server is supported only on Linux') \
233 error_message: 'vhost-user is not available on Windows').allowed()
236 error_message: 'vhost-vdpa is only available on Linux').allowed()
239 error_message: 'vhost-kernel is only available on Linux').allowed()
242 error_message: 'vhost-crypto requires vhost-user to be enabled').allowed()
287 kvm_targets = ['i386-softmmu']
289 kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
291 kvm_targets = ['aarch64-softmmu']
293 kvm_targets = ['s390x-softmmu']
295 kvm_targets = ['ppc-softmmu']
297 kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
299 kvm_targets = ['mips-softmmu', 'mipsel-softmmu']
301 kvm_targets = ['mips-softmmu', 'mipsel-softmmu', 'mips64-softmmu', 'mips64el-softmmu']
303 kvm_targets = ['riscv32-softmmu']
305 kvm_targets = ['riscv64-softmmu']
307 kvm_targets = ['loongarch64-softmmu']
314 xen_targets = ['i386-softmmu']
316 xen_targets = ['i386-softmmu', 'x86_64-softmmu']
319 xen_targets = ['i386-softmmu']
322 xen_targets = ['i386-softmmu', 'x86_64-softmmu', 'aarch64-softmmu']
330 'CONFIG_HVF': ['aarch64-softmmu']
334 'CONFIG_HVF': ['x86_64-softmmu'],
335 'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'],
336 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
367 # We use -fwrapv to tell the compiler that we require a C dialect where
369 # 2s-complement style results. (Both clang and gcc agree that it
373 '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE',
374 '-fno-strict-aliasing', '-fno-common', '-fwrapv' ]
382 qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0'
386 qemu_common_flags += '-D_XOPEN_SOURCE=600'
388 qemu_common_flags += '-D__EXTENSIONS__'
390 qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC']
394 error('On windows, you need to use lld with clang - use msys2 clang64/clangarm64 env')
398 # Choose instruction set (currently x86-only)
402 # __sync_fetch_and_and requires at least -march=i486. Many toolchains
418 qemu_isa_flags += ['-march=i486']
421 # Pick x86-64 baseline version
424 error('x86_64-v1 required for x86-64 hosts')
430 qemu_common_flags = ['-mfpmath=sse'] + qemu_common_flags
433 # x86-64-v1, so only include -mneeded for x86-64 version 2 and above
434 qemu_isa_flags += ['-mcx16']
438 qemu_isa_flags += ['-mpopcnt']
439 qemu_isa_flags += cc.get_supported_arguments('-mneeded')
442 qemu_isa_flags += ['-mmovbe', '-mabm', '-mbmi', '-mbmi2', '-mfma', '-mf16c']
447 qemu_isa_flags += ['-msse2']
449 qemu_isa_flags += ['-msse4.2']
451 qemu_isa_flags += ['-mavx2']
453 qemu_isa_flags += ['-mavx512f', '-mavx512bw', '-mavx512cd', '-mavx512dq', '-mavx512vl']
460 qemu_ldflags += get_option('b_pie') ? '-static-pie' : '-static'
466 # -no-pie is supposedly a linker flag that has no effect on the compiler
469 # a compiler command-line flag.
471 # What about linker flags? For a static build, no PIE is implied by -static
474 # distro and do not use --disable-pie in the meanwhile). For dynamic linking,
475 # instead, we can't add -no-pie because it overrides -shared: the linker then
477 # don't add -no-pie anywhere and cross fingers. :(
479 # Emscripten doesn't support -no-pie but meson can't catch the compiler
482 qemu_common_flags += cc.get_supported_arguments('-fno-pie', '-no-pie')
489 char arr[64], *p = arr, *c = argv[argc - 1];
496 foreach arg : ['-fstack-protector-strong', '-fstack-protector-all']
498 # setups fail only on a .c->.o compile and some only at link time
499 if cc.compiles(stack_protector_probe, args: ['-Werror', arg]) and \
500 cc.links(stack_protector_probe, args: ['-Werror', arg])
553 safe_stack_arg = get_option('safe_stack') ? '-fsanitize=safe-stack' : '-fno-sanitize=safe-stack'
567 if cc.has_argument('-fsanitize=address')
568 qemu_cflags = ['-fsanitize=address'] + qemu_cflags
569 qemu_ldflags = ['-fsanitize=address'] + qemu_ldflags
571 error('Your compiler does not support -fsanitize=address')
579 args: [qemu_ldflags, '-fsanitize=undefined'])
580 qemu_cflags += ['-fsanitize=undefined']
581 qemu_ldflags += ['-fsanitize=undefined']
586 if cc.has_argument('-fno-sanitize=function')
587 qemu_cflags += ['-fno-sanitize=function']
590 error('Your compiler does not support -fsanitize=undefined')
601 args: '-fsanitize=thread',
603 error('Cannot enable TSAN due to missing fiber annotation interface')
607 # "error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’"
608 # https://gcc.gnu.org/gcc-11/changes.html
610 if cc.has_argument('-Wno-tsan')
611 tsan_warn_suppress = ['-Wno-tsan']
613 qemu_cflags = ['-fsanitize=thread'] + tsan_warn_suppress + qemu_cflags
614 qemu_ldflags = ['-fsanitize=thread'] + qemu_ldflags
618 # The combination is known as "full relro", because .got.plt is read-only too.
619 qemu_ldflags += cc.get_supported_link_arguments('-Wl,-z,relro', '-Wl,-z,now')
622 qemu_ldflags += cc.get_supported_link_arguments('-Wl,--no-seh', '-Wl,--nxcompat')
623 qemu_ldflags += cc.get_supported_link_arguments('-Wl,--dynamicbase', '-Wl,--high-entropy-va')
628 # virtual-devices.
629 configure_file(output: 'instrumentation-filter',
630 input: 'scripts/oss-fuzz/instrumentation-filter-template',
634 name: '-fsanitize-coverage-allowlist=/dev/null',
635 args: ['-fsanitize-coverage-allowlist=/dev/null',
636 '-fsanitize-coverage=trace-pc'] )
637 qemu_common_flags += ['-fsanitize-coverage-allowlist=instrumentation-filter']
641 # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
642 # compiled code. To build non-fuzzer binaries with --enable-fuzzing, link
643 # everything with fsanitize=fuzzer-no-link. Otherwise, the linker will be
644 # unable to bind the fuzzer-related callbacks added by instrumentation.
645 qemu_common_flags += ['-fsanitize=fuzzer-no-link']
646 qemu_ldflags += ['-fsanitize=fuzzer-no-link']
648 # library. They need to be configurable, to support OSS-Fuzz
649 fuzz_exe_ldflags = ['-fsanitize=fuzzer']
651 # LIB_FUZZING_ENGINE was set; assume we are running on OSS-Fuzz, and
661 error('Selected Control-Flow Integrity but LTO is disabled')
664 error('Selected Control-Flow Integrity is not compatible with modules')
669 if cc.compiles('int main () { return 0; }', name: '-fsanitize=cfi-icall',
670 args: ['-flto', '-fsanitize=cfi-icall'] )
671 cfi_flags += '-fsanitize=cfi-icall'
673 error('-fsanitize=cfi-icall is not supported by the compiler')
676 name: '-fsanitize-cfi-icall-generalize-pointers',
677 args: ['-flto', '-fsanitize=cfi-icall',
678 '-fsanitize-cfi-icall-generalize-pointers'] )
679 cfi_flags += '-fsanitize-cfi-icall-generalize-pointers'
681 error('-fsanitize-cfi-icall-generalize-pointers is not supported by the compiler')
685 name: '-fno-sanitize-trap=cfi-icall',
686 args: ['-flto', '-fsanitize=cfi-icall',
687 '-fno-sanitize-trap=cfi-icall'] )
688 cfi_flags += '-fno-sanitize-trap=cfi-icall'
690 error('-fno-sanitize-trap=cfi-icall is not supported by the compiler')
703 '-ftrivial-auto-var-init=zero',
711 # https://github.com/llvm/llvm-project/issues/75168
714 # https://gitlab.com/qemu-project/qemu/-/issues/2278
717 name: '-fzero-call-used-regs=used-gpr',
718 args: ['-O2', '-fzero-call-used-regs=used-gpr'])
719 hardening_flags += '-fzero-call-used-regs=used-gpr'
729 # First enable interesting warnings
730 '-Wempty-body',
731 '-Wendif-labels',
732 '-Wexpansion-to-defined',
733 '-Wformat-security',
734 '-Wformat-y2k',
735 '-Wignored-qualifiers',
736 '-Wimplicit-fallthrough=2',
737 '-Winit-self',
738 '-Wmissing-format-attribute',
739 '-Wmissing-prototypes',
740 '-Wnested-externs',
741 '-Wold-style-declaration',
742 '-Wold-style-definition',
743 '-Wredundant-decls',
744 '-Wshadow=local',
745 '-Wstrict-prototypes',
746 '-Wtype-limits',
747 '-Wundef',
748 '-Wvla',
749 '-Wwrite-strings',
752 '-Wno-gnu-variable-sized-type-not-at-end',
753 '-Wno-initializer-overrides',
754 '-Wno-missing-include-dirs',
755 '-Wno-psabi',
756 '-Wno-shift-negative-value',
757 '-Wno-string-plus-int',
758 '-Wno-tautological-type-limit-compare',
759 '-Wno-typedef-redefinition',
772 ''', args: ['-Wthread-safety', '-Werror'])
774 warn_flags += ['-Wthread-safety']
781 …qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + …
791 # Note sanitizer flags are not applied to Objective-C sources!
795 add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
796 '-isystem', 'linux-headers',
800 add_project_arguments('-iquote', '.',
801 '-iquote', meson.current_source_dir(),
802 '-iquote', meson.current_source_dir() / 'include',
805 # If a host-specific include directory exists, list that first...
808 add_project_arguments('-iquote', host_include / host_arch,
812 add_project_arguments('-iquote', host_include / 'generic',
815 sparse = find_program('cgcc', required: get_option('sparse')) variable
816 if sparse.found()
817 run_target('sparse', run
819 'compile_commands.json', sparse.full_path(), '-Wbitwise',
820 '-Wno-transparent-union', '-Wno-old-initializer',
821 '-Wno-non-pointer-null'])
825 # Host-specific libraries and flags #
855 depend_files: files('pc-bios/qemu-nsis.ico'),
875 emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded')
880 # Host-specific configuration of accelerators #
889 error('WHPX requires 64-bit host')
917 error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
921 error('WebAssembly host requires --enable-tcg-interpreter')
927 warning('It is strongly recommended to remove the --enable-tcg-interpreter')
938 add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
960 method: 'pkg-config')
967 method: 'pkg-config',
970 method: 'pkg-config',
973 method: 'pkg-config',
976 method: 'pkg-config',
979 method: 'pkg-config',
983 method: 'pkg-config')])
1008 # Use -D to pick just one of the test programs in scripts/xen-detect.c
1011 ('0' + xen_version[1]).substring(-2) + \
1012 ('0' + xen_version[2]).substring(-2)
1013 if cc.links(files('scripts/xen-detect.c'),
1014 args: '-DCONFIG_XEN_CTRL_INTERFACE_VERSION=' + xen_ctrl_version,
1045 glib_pc = dependency('glib-2.0', version: glib_req_ver, required: true,
1046 method: 'pkg-config')
1049 gmodule = dependency('gmodule-export-2.0', version: glib_req_ver, required: true,
1050 method: 'pkg-config')
1052 gmodule = dependency('gmodule-no-export-2.0', version: glib_req_ver, required: true,
1053 method: 'pkg-config')
1058 # This workaround is required due to a bug in pkg-config file for glib as it
1059 # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static
1061 glib_cflags += ['-DGLIB_STATIC_COMPILATION']
1066 # problems on multi-arch where people try to build
1067 # 32-bit QEMU while pointing at 64-bit glib headers
1074 typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused));
1082 to the right pkg-config files for your build target.''')
1098 meson.override_dependency('glib-2.0', glib)
1106 gdbus_codegen_error = '@0@ requires gdbus-codegen, please install libgio'
1108 gio = dependency('gio-2.0', required: get_option('gio'),
1109 method: 'pkg-config')
1123 gdbus_codegen = find_program('gdbus-codegen',
1125 gio_unix = dependency('gio-unix-2.0', required: get_option('gio'),
1126 method: 'pkg-config')
1133 gdbus_codegen_error = '@0@ uses gdbus-codegen, which does not support control flow integrity'
1136 xml_pp = find_program('scripts/xml-preprocess.py')
1140 lttng = dependency('lttng-ust', required: true, version: '>= 2.1',
1141 method: 'pkg-config')
1145 pixman = dependency('pixman-1', required: get_option('pixman'), version:'>=0.21.8',
1146 method: 'pkg-config')
1167 method: 'pkg-config')
1177 method: 'pkg-config')
1199 cc.links(libattr_test, dependencies: libattr, args: '-DCONFIG_LIBATTR')
1233 method: 'pkg-config')
1243 libcap_ng = cc.find_library('cap-ng', has_headers: ['cap-ng.h'],
1247 #include <cap-ng.h>
1255 error('could not link libcap-ng')
1257 warning('could not link libcap-ng, disabling')
1265 method: 'pkg-config')
1271 method: 'pkg-config')
1274 # When using a system-wide shared libslirp, the type information for the
1277 # with control-flow integrity.
1280 error('Control-Flow Integrity requires libslirp 4.7.')
1282 warning('Cannot use libslirp since Control-Flow Integrity requires libslirp >= 4.7.')
1313 method: 'pkg-config')
1318 method: 'pkg-config')
1323 method: 'pkg-config')
1327 pipewire = dependency('libpipewire-0.3', version: '>=0.3.60',
1329 method: 'pkg-config')
1334 method: 'pkg-config')
1339 spice_protocol = dependency('spice-protocol', version: '>=0.14.0',
1341 method: 'pkg-config')
1347 error_message: 'cannot enable SPICE if pixman is not available') \
1349 spice = dependency('spice-server', version: '>=0.14.0',
1351 method: 'pkg-config')
1361 method: 'pkg-config')
1367 method: 'pkg-config')
1373 method: 'pkg-config')
1379 method: 'pkg-config')
1382 method: 'pkg-config')
1392 method: 'pkg-config')
1400 method: 'pkg-config',
1406 method: 'pkg-config',
1412 method: 'pkg-config',
1418 method: 'pkg-config',
1424 method: 'pkg-config',
1504 method: 'pkg-config')
1506 curses_compile_args = ['-DNCURSES_WIDECHAR=1']
1520 curses_compile_args += ['-I/usr/include/ncursesw']
1541 foreach link_args : [ ['-liconv'], [] ]
1545 # However, without adding glib to the dependencies -L/usr/local/lib will not be
1550 iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
1551 return conv != (iconv_t) -1;
1597 # Some versions of SDL have problems with -Wundef
1602 ''', dependencies: sdl, args: '-Werror=undef')
1603 sdl = declare_dependency(compile_args: '-Wno-undef',
1608 method: 'pkg-config')
1611 error('sdl-image required, but SDL was @0@'.format(
1647 glusterfs = dependency('glusterfs-api', version: '>=3',
1649 method: 'pkg-config')
1697 error('could not enable hv-balloon, update your glib')
1699 warning('could not find glib support for hv-balloon, disabling')
1707 method: 'pkg-config',
1762 dsound = declare_dependency(link_args: ['-lole32', '-ldxguid'])
1780 epoxy = dependency('epoxy', method: 'pkg-config',
1790 gbm = dependency('gbm', method: 'pkg-config', required: false)
1817 method: 'pkg-config',
1824 method: 'pkg-config',
1854 # Debian has removed -lgpg-error from libgcrypt-config
1860 cc.find_library('gpg-error', required: true)],
1888 method: 'pkg-config',
1921 // HMAC-SM3 test
1936 method: 'pkg-config',
1939 # Some versions of capstone have broken pkg-config file
1940 # that reports a wrong -I path, causing the #include to
1952 gmp = dependency('gmp', required: false, method: 'pkg-config')
1955 method: 'pkg-config',
1968 error_message: 'cannot enable GTK if pixman is not available') \
1970 gtk = dependency('gtk+-3.0', version: '>=3.22.0',
1971 method: 'pkg-config',
1974 gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
1975 method: 'pkg-config',
1981 vte = dependency('vte-2.91',
1982 method: 'pkg-config',
1992 x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found())
1997 method: 'pkg-config')
2005 error_message: 'cannot enable VNC if pixman is not available') \
2009 method: 'pkg-config')
2014 compile_args: '-DSTRUCT_IOVEC_DEFINED')
2044 snappy = cc.find_library('snappy', has_headers: ['snappy-c.h'],
2048 #include <snappy-c.h>
2135 version: '>=2.5.1', method: 'pkg-config')
2139 u2f = dependency('u2f-emu', required: get_option('u2f'),
2140 method: 'pkg-config')
2144 canokey = dependency('canokey-qemu', required: get_option('canokey'),
2145 method: 'pkg-config')
2149 usbredir = dependency('libusbredirparser-0.5', required: get_option('usb_redir'),
2150 version: '>=0.6', method: 'pkg-config')
2154 libusb = dependency('libusb-1.0', required: get_option('libusb'),
2155 version: '>=1.0.13', method: 'pkg-config')
2161 method: 'pkg-config')
2166 version: '>=57', method: 'pkg-config')
2172 method: 'pkg-config')
2177 method: 'pkg-config')
2185 method: 'pkg-config')
2202 error('malloc_trim not available with non-libc memory allocator')
2217 * function availability on recentish Mingw-w64 platforms. */
2228 error_message: 'vhost_user_blk_server requires vhost-user support') \
2233 error('Cannot enable fuse-lseek while fuse is disabled')
2237 version: '>=3.1', method: 'pkg-config')
2246 error('fuse-lseek requires libfuse >=3.8, found ' + fuse.version())
2248 error('fuse-lseek requires libfuse, which was not found')
2275 …ependency('libbpf', version: '>=' + bpf_version, required: get_option('bpf'), method: 'pkg-config')
2299 version: '>=1.4.0', method: 'pkg-config')
2312 method: 'pkg-config',
2317 # config-host.h #
2369 error_message: '-display dbus requires glib>=2.64') \
2371 error_message: gdbus_codegen_error.format('-display dbus')) \
2376 error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
2378 … error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \
2380 error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \
2439 meson.current_source_dir() / 'scripts/qemu-stamp.py',
2440 meson.project_version(), get_option('pkgversion'), '--',
2465 error('Cannot enable module-upgrades as modules are not enabled')
2608 ('0' + xen_version[1]).substring(-2) + \
2609 ('0' + xen_version[2]).substring(-2)
2707 args: '-fsanitize=address',
2720 # libinotify-kqueue
2778 # https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/bsd/man/man4/tcp.4#L172
2838 # missing-prototype case, we try again with a definitely-bogus prototype.
2860 # i.e. errno is set and -1 is returned. That's not really how POSIX defines the
2930 int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
2995 }''', args: ['-Werror']))
2997 # See if 64-bit atomic operations are supported.
3033 # "do we have 128-bit atomics which are handled inline and specifically not
3036 # We only care about these operations on 16-byte aligned pointers, so
3037 # force 16-byte alignment of the pointer, which may be greater than
3041 __uint128_t *p = __builtin_assume_aligned(av[ac - 1], 16);
3144 int main(int argc, char *argv[]) { return bar(argv[argc - 1]); }
3156 error('Cannot enable AVX optimizations due to missing intrinsics')
3158 error('Cannot enable AVX512 optimizations due to missing intrinsics')
3164 error('Cannot enable AVX optimizations due to missing cpuid.h')
3261 error('mingw must provide setjmp/longjmp for windows-arm64')
3331 config_target = { 'TARGET_NAME': target.split('-')[0] }
3332 if target.endswith('linux-user')
3340 elif target.endswith('bsd-user')
3352 if target.endswith('-user')
3365 # Disallow 64-bit on 32-bit emulation and virtualization
3420 # Note that TARGET_BASE_ARCH ends up in config-target.h but it is
3435 config_target_h += {target: configure_file(output: target + '-config-target.h',
3438 if target.endswith('-softmmu')
3442 # PVG is not cross-architecture. Use accelerator_targets as a proxy to
3449 config_devices_mak = target + '-config-devices.mak'
3456 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
3466 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
3485 genh += custom_target('config-poison.h',
3487 output: 'config-poison.h',
3489 command: [find_program('scripts/make-config-poison.sh'),
3502 libvfio_user_proj = subproject('libvfio-user', required: true)
3508 libvhost_user = subproject('libvhost-user')
3522 config_host_h = configure_file(output: 'config-host.h', configuration: config_host_data)
3527 qapi_gen = find_program('scripts/qapi-gen.py')
3543 meson.current_source_dir() / 'scripts/qapi-gen.py'
3548 '--backend=' + ','.join(get_option('trace_backends'))
3570 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
3573 qemu_version = custom_target('qemu-version.h',
3574 output: 'qemu-version.h',
3583 ['qemu-options.hx', 'qemu-options.def'],
3584 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
3588 ['hmp-commands.hx', 'hmp-commands.h'],
3589 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
3597 command: [hxtool, '-h', '@INPUT0@'])
3616 trace_events_subdirs += [ 'linux-user' ]
3619 trace_events_subdirs += [ 'bsd-user' ]
3669 'hw/pci-host',
3687 'hw/vfio-user',
3775 …libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_ar…
3776 …ndency(objects: libmodulecommon.extract_all_objects(recursive: false), compile_args: '-DBUILD_DSO')
3786 event_loop_base = files('event-loop-base.c')
3787 event_loop_base = static_library('event-loop-base',
3811 output: 'decode-@BASENAME@.c.inc',
3812 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
3828 'qemu-io-cmds.c',
3840 'blockdev-nbd.c',
3842 'job-qmp.c',
3845 # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
3846 # os-win32.c does not
3848 system_ss.add(files('os-win32.c'))
3850 blockdev_ss.add(files('os-wasm.c'))
3852 blockdev_ss.add(files('os-posix.c'))
3856 common_ss.add(files('cpu-common.c'))
3857 specific_ss.add(files('cpu-target.c'))
3865 # impossible, as the alias is restricted to page-vary-common.c. Indeed,
3866 # without lto, not even the alias is required -- we simply use different
3868 pagevary = files('page-vary-common.c')
3870 pagevary_flags = ['-fno-lto']
3872 pagevary_flags += '-fno-sanitize=cfi-icall'
3874 pagevary = static_library('page-vary-common', sources: pagevary + genh,
3879 specific_ss.add(files('page-target.c', 'page-vary-target.c'))
3881 common_ss.add(files('target-info.c'))
3882 specific_ss.add(files('target-info-stub.c'))
3904 subdir('common-user')
3905 subdir('bsd-user')
3906 subdir('linux-user')
3919 modinfo_collect = find_program('scripts/modinfo-collect.py')
3920 modinfo_generate = find_program('scripts/modinfo-generate.py')
3935 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
3949 modinfo_files += custom_target(d + '-' + m + '.modinfo',
3950 output: d + '-' + m + '.modinfo',
3970 if target.endswith('-softmmu')
3973 c_args = ['-DCOMPILING_PER_TARGET',
3974 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3975 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3978 module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
3996 … command: [modinfo_collect, '--target', target, '@INPUT@'])
4008 if target.endswith('-softmmu')
4010 config_devices_mak = target + '-config-devices.mak'
4011 modinfo_src = custom_target('modinfo-' + target + '.c',
4012 output: 'modinfo-' + target + '.c',
4014 … command: [modinfo_generate, '--devices', config_devices_mak, '@INPUT@'],
4017 modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
4118 c_args: ['-DCONFIG_USER_ONLY',
4119 '-DCOMPILING_SYSTEM_VS_USER'],
4126 c_args: ['-DCONFIG_SOFTMMU',
4127 '-DCOMPILING_SYSTEM_VS_USER'],
4165 target_c_args = ['-DCPU_DEFS_H']
4166 target_system_c_args = target_c_args + ['-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOFTMMU']
4206 # We would like to use --generate-cstr, but it is only available
4208 # is 0.60.x (Debian 12 has 0.60.1) which introduces --allowlist-file.
4210 '--disable-header-comment',
4211 '--raw-line', '// @generated',
4212 '--ctypes-prefix', 'std::os::raw',
4213 '--generate-block',
4214 '--impl-debug',
4215 '--no-doc-comments',
4216 '--with-derive-default',
4217 '--no-layout-tests',
4218 '--no-prepend-enum-name',
4219 '--allowlist-file', meson.project_source_root() + '/include/.*',
4220 '--allowlist-file', meson.project_source_root() + '/.*',
4221 '--allowlist-file', meson.project_build_root() + '/.*'
4225 bindgen_args_common += ['--no-rustfmt-bindings']
4227 bindgen_args_common += ['--formatter', 'none']
4231 bindgen_args_common += ['--rust-target', '1.59']
4235 bindgen_args_common += ['--size_t-is-usize']
4237 bindgen_args_common += ['--merge-extern-blocks']
4258 c_args = ['-DCOMPILING_PER_TARGET',
4259 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
4265 target_inc += include_directories('linux-headers', is_system: true)
4267 if target.endswith('-softmmu')
4280 c_args += ['-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
4293 base_dir = 'linux-user'
4296 base_dir = 'bsd-user'
4297 target_inc += include_directories('bsd-user/' / host_os)
4298 target_inc += include_directories('bsd-user/host/' / host_arch)
4318 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
4319 output: target + '-gdbstub-xml.c',
4390 lib = static_library('qemu-' + target,
4398 if target.endswith('-softmmu')
4400 'name': 'qemu-system-' + target_name,
4407 'name': 'qemu-system-' + target_name + 'w',
4416 'name': 'qemu-fuzz-' + target_name,
4424 'name': 'qemu-' + target_name,
4433 exe_name += '-unsigned'
4446 icon = 'pc-bios/qemu.rsrc'
4464 meson.add_install_script(entitlement, '--install',
4473 'probe-prefix': 'qemu.' + target_type + '.' + target_name,
4482 install_headers('include/qemu/qemu-plugin.h')
4492 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
4495 # used for the update-keymaps target, so include rules even if !have_tools
4496 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
4501 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
4504 qemu_io = executable('qemu-io', files('qemu-io.c'),
4507 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
4512 subdir('storage-daemon')
4514 foreach exe: [ 'qemu-img', 'qemu-io', 'qemu-nbd', 'qemu-storage-daemon']
4517 'probe-prefix': 'qemu.' + exe.substring(5).replace('-', '_')
4523 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
4528 subdir('contrib/vhost-user-blk')
4529 subdir('contrib/vhost-user-gpu')
4530 subdir('contrib/vhost-user-input')
4531 subdir('contrib/vhost-user-scsi')
4535 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
4540 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
4546 executable('qemu-vmsr-helper', files('tools/i386/qemu-vmsr-helper.c'),
4554 subdir('contrib/ivshmem-client')
4555 subdir('contrib/ivshmem-server')
4562 …{'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / t['exe'], 'install': false…
4564 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
4565 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
4568 tracetool, '--group=all', '--format=' + stp['fmt'],
4569 '--binary=' + stp['bin'],
4570 '--probe-prefix=' + t['probe-prefix'],
4587 subdir('pc-bios')
4606 '--',
4607 '-DDISPLAYVERSION=' + meson.project_version(),
4610 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
4613 nsis_cmd += '-DCONFIG_GTK=y'
4617 output: 'qemu-setup-' + meson.project_version() + '.exe',
4658 summary_info += {'sphinx-build': sphinx_build}
4680 summary_info += {'system-mode emulation': have_system}
4681 summary_info += {'user-mode emulation': have_user}
4694 summary_info += {'Trace output file': get_option('trace_file') + '-<pid>'}
4698 summary_info += {'vhost-kernel support': have_vhost_kernel}
4699 summary_info += {'vhost-net support': have_vhost_net}
4700 summary_info += {'vhost-user support': have_vhost_user}
4701 summary_info += {'vhost-user-crypto support': have_vhost_user_crypto}
4702 summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
4703 summary_info += {'vhost-vdpa support': have_vhost_vdpa}
4719 summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
4721 summary_info += {'Objective-C compiler': false}
4732 option_cflags = (get_option('debug') ? ['-g'] : [])
4734 option_cflags += ['-O' + get_option('optimization')]
4755 summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
4773 summary_info += {'sparse': sparse}
4777 # snarf the cross-compilation information for tests
4781 tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 'config-target.mak'
4824 summary_info += {'vfio-user server': vfio_user_server_allowed}
4869 summary_info += {'rng-none': get_option('rng_none')}
4879 summary_info += {'D-Bus display': dbus_display}
4948 summary_info += {'libcap-ng support': libcap_ng}
4966 summary_info += {'hv-balloon support': hv_balloon}
4988 summary_info += {'libinotify-kqueue': inotify}
5014 message('Support for 32-bit CPU host architecture ' + cpu + ' is going')
5034 message('contact the developers at qemu-devel@nongnu.org.')
5052 message('Use --disable-relocatable to remove this warning.')