Lines Matching +full:- +full:- +full:enable +full:- +full:safe +full:- +full:stack
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])
508 .require(have_stack_protector, error_message: 'Stack protector not supported')
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')
700 # Initialize all stack variables to zero. This makes
701 # it harder to take advantage of uninitialized stack
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',
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.')
1318 method: 'pkg-config')
1323 method: 'pkg-config')
1328 method: 'pkg-config')
1332 pipewire = dependency('libpipewire-0.3', version: '>=0.3.60',
1334 method: 'pkg-config')
1339 method: 'pkg-config')
1344 spice_protocol = dependency('spice-protocol', version: '>=0.14.0',
1346 method: 'pkg-config')
1352 error_message: 'cannot enable SPICE if pixman is not available') \
1354 spice = dependency('spice-server', version: '>=0.14.0',
1356 method: 'pkg-config')
1366 method: 'pkg-config')
1372 method: 'pkg-config')
1378 method: 'pkg-config')
1384 method: 'pkg-config')
1387 method: 'pkg-config')
1397 method: 'pkg-config')
1405 method: 'pkg-config',
1411 method: 'pkg-config',
1417 method: 'pkg-config',
1423 method: 'pkg-config',
1429 method: 'pkg-config',
1435 method: 'pkg-config',
1515 method: 'pkg-config')
1517 curses_compile_args = ['-DNCURSES_WIDECHAR=1']
1531 curses_compile_args += ['-I/usr/include/ncursesw']
1552 foreach link_args : [ ['-liconv'], [] ]
1556 # However, without adding glib to the dependencies -L/usr/local/lib will not be
1561 iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
1562 return conv != (iconv_t) -1;
1610 # Some versions of SDL have problems with -Wundef
1615 ''', dependencies: sdl, args: '-Werror=undef')
1616 sdl = declare_dependency(compile_args: '-Wno-undef',
1621 method: 'pkg-config')
1624 error('sdl-image required, but SDL was @0@'.format(
1660 glusterfs = dependency('glusterfs-api', version: '>=3',
1662 method: 'pkg-config')
1710 error('could not enable hv-balloon, update your glib')
1712 warning('could not find glib support for hv-balloon, disabling')
1720 method: 'pkg-config',
1775 dsound = declare_dependency(link_args: ['-lole32', '-ldxguid'])
1793 epoxy = dependency('epoxy', method: 'pkg-config',
1803 gbm = dependency('gbm', method: 'pkg-config', required: false)
1831 method: 'pkg-config',
1838 method: 'pkg-config',
1842 #if gnutls.found() and not get_option('gnutls-bug1717-workaround').disabled()
1874 # Debian has removed -lgpg-error from libgcrypt-config
1880 cc.find_library('gpg-error', required: true)],
1908 method: 'pkg-config',
1941 // HMAC-SM3 test
1956 method: 'pkg-config',
1959 # Some versions of capstone have broken pkg-config file
1960 # that reports a wrong -I path, causing the #include to
1972 gmp = dependency('gmp', required: false, method: 'pkg-config')
1975 method: 'pkg-config',
1988 error_message: 'cannot enable GTK if pixman is not available') \
1990 gtk = dependency('gtk+-3.0', version: '>=3.22.0',
1991 method: 'pkg-config',
1994 gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
1995 method: 'pkg-config',
2001 vte = dependency('vte-2.91',
2002 method: 'pkg-config',
2012 x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found())
2017 method: 'pkg-config')
2025 error_message: 'cannot enable VNC if pixman is not available') \
2029 method: 'pkg-config')
2034 compile_args: '-DSTRUCT_IOVEC_DEFINED')
2064 snappy = cc.find_library('snappy', has_headers: ['snappy-c.h'],
2068 #include <snappy-c.h>
2155 version: '>=2.5.1', method: 'pkg-config')
2159 u2f = dependency('u2f-emu', required: get_option('u2f'),
2160 method: 'pkg-config')
2164 canokey = dependency('canokey-qemu', required: get_option('canokey'),
2165 method: 'pkg-config')
2169 usbredir = dependency('libusbredirparser-0.5', required: get_option('usb_redir'),
2170 version: '>=0.6', method: 'pkg-config')
2174 libusb = dependency('libusb-1.0', required: get_option('libusb'),
2175 version: '>=1.0.13', method: 'pkg-config')
2181 method: 'pkg-config')
2186 version: '>=57', method: 'pkg-config')
2192 method: 'pkg-config')
2197 method: 'pkg-config')
2205 method: 'pkg-config')
2222 error('malloc_trim not available with non-libc memory allocator')
2237 * function availability on recentish Mingw-w64 platforms. */
2248 error_message: 'vhost_user_blk_server requires vhost-user support') \
2253 error('Cannot enable fuse-lseek while fuse is disabled')
2257 version: '>=3.1', method: 'pkg-config')
2266 error('fuse-lseek requires libfuse >=3.8, found ' + fuse.version())
2268 error('fuse-lseek requires libfuse, which was not found')
2295 …ependency('libbpf', version: '>=' + bpf_version, required: get_option('bpf'), method: 'pkg-config')
2319 version: '>=1.4.0', method: 'pkg-config')
2332 method: 'pkg-config',
2337 # config-host.h #
2389 error_message: '-display dbus requires glib>=2.64') \
2391 error_message: gdbus_codegen_error.format('-display dbus')) \
2396 error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
2398 … error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \
2400 error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \
2459 meson.current_source_dir() / 'scripts/qemu-stamp.py',
2460 meson.project_version(), get_option('pkgversion'), '--',
2485 error('Cannot enable module-upgrades as modules are not enabled')
2631 ('0' + xen_version[1]).substring(-2) + \
2632 ('0' + xen_version[2]).substring(-2)
2645 message('Disabling coroutine pool to measure stack usage')
2730 args: '-fsanitize=address',
2743 # libinotify-kqueue
2801 # https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/bsd/man/man4/tcp.4#L172
2861 # missing-prototype case, we try again with a definitely-bogus prototype.
2883 # i.e. errno is set and -1 is returned. That's not really how POSIX defines the
2953 int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
3018 }''', args: ['-Werror']))
3020 # See if 64-bit atomic operations are supported.
3056 # "do we have 128-bit atomics which are handled inline and specifically not
3059 # We only care about these operations on 16-byte aligned pointers, so
3060 # force 16-byte alignment of the pointer, which may be greater than
3064 __uint128_t *p = __builtin_assume_aligned(av[ac - 1], 16);
3167 int main(int argc, char *argv[]) { return bar(argv[argc - 1]); }
3179 error('Cannot enable AVX optimizations due to missing intrinsics')
3181 error('Cannot enable AVX512 optimizations due to missing intrinsics')
3187 error('Cannot enable AVX optimizations due to missing cpuid.h')
3284 error('mingw must provide setjmp/longjmp for windows-arm64')
3354 config_target = { 'TARGET_NAME': target.split('-')[0] }
3355 if target.endswith('linux-user')
3363 elif target.endswith('bsd-user')
3375 if target.endswith('-user')
3388 # Disallow 64-bit on 32-bit emulation and virtualization
3443 # Note that TARGET_BASE_ARCH ends up in config-target.h but it is
3458 config_target_h += {target: configure_file(output: target + '-config-target.h',
3461 if target.endswith('-softmmu')
3465 # PVG is not cross-architecture. Use accelerator_targets as a proxy to
3472 config_devices_mak = target + '-config-devices.mak'
3479 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
3489 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
3508 genh += custom_target('config-poison.h',
3510 output: 'config-poison.h',
3512 command: [find_program('scripts/make-config-poison.sh'),
3525 libvfio_user_proj = subproject('libvfio-user', required: true)
3531 libvhost_user = subproject('libvhost-user')
3545 config_host_h = configure_file(output: 'config-host.h', configuration: config_host_data)
3550 qapi_gen = find_program('scripts/qapi-gen.py')
3566 meson.current_source_dir() / 'scripts/qapi-gen.py'
3571 '--backend=' + ','.join(get_option('trace_backends'))
3593 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
3596 qemu_version = custom_target('qemu-version.h',
3597 output: 'qemu-version.h',
3606 ['qemu-options.hx', 'qemu-options.def'],
3607 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
3611 ['hmp-commands.hx', 'hmp-commands.h'],
3612 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
3620 command: [hxtool, '-h', '@INPUT0@'])
3639 trace_events_subdirs += [ 'linux-user' ]
3642 trace_events_subdirs += [ 'bsd-user' ]
3693 'hw/pci-host',
3711 'hw/vfio-user',
3799 …libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_ar…
3800 …ndency(objects: libmodulecommon.extract_all_objects(recursive: false), compile_args: '-DBUILD_DSO')
3810 event_loop_base = files('event-loop-base.c')
3811 event_loop_base = static_library('event-loop-base',
3835 output: 'decode-@BASENAME@.c.inc',
3836 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
3852 'qemu-io-cmds.c',
3864 'blockdev-nbd.c',
3866 'job-qmp.c',
3869 # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
3870 # os-win32.c does not
3872 system_ss.add(files('os-win32.c'))
3874 blockdev_ss.add(files('os-wasm.c'))
3876 blockdev_ss.add(files('os-posix.c'))
3880 common_ss.add(files('cpu-common.c'))
3881 specific_ss.add(files('cpu-target.c'))
3889 # impossible, as the alias is restricted to page-vary-common.c. Indeed,
3890 # without lto, not even the alias is required -- we simply use different
3892 pagevary = files('page-vary-common.c')
3894 pagevary_flags = ['-fno-lto']
3896 pagevary_flags += '-fno-sanitize=cfi-icall'
3898 pagevary = static_library('page-vary-common', sources: pagevary + genh,
3903 specific_ss.add(files('page-target.c', 'page-vary-target.c'))
3905 common_ss.add(files('target-info.c'))
3906 specific_ss.add(files('target-info-stub.c'))
3928 subdir('common-user')
3929 subdir('bsd-user')
3930 subdir('linux-user')
3943 modinfo_collect = find_program('scripts/modinfo-collect.py')
3944 modinfo_generate = find_program('scripts/modinfo-generate.py')
3959 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
3973 modinfo_files += custom_target(d + '-' + m + '.modinfo',
3974 output: d + '-' + m + '.modinfo',
3994 if target.endswith('-softmmu')
3997 c_args = ['-DCOMPILING_PER_TARGET',
3998 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3999 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
4002 module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
4020 … command: [modinfo_collect, '--target', target, '@INPUT@'])
4032 if target.endswith('-softmmu')
4034 config_devices_mak = target + '-config-devices.mak'
4035 modinfo_src = custom_target('modinfo-' + target + '.c',
4036 output: 'modinfo-' + target + '.c',
4038 … command: [modinfo_generate, '--devices', config_devices_mak, '@INPUT@'],
4041 modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
4142 c_args: ['-DCONFIG_USER_ONLY',
4143 '-DCOMPILING_SYSTEM_VS_USER'],
4150 c_args: ['-DCONFIG_SOFTMMU',
4151 '-DCOMPILING_SYSTEM_VS_USER'],
4189 target_c_args = ['-DCPU_DEFS_H']
4190 target_system_c_args = target_c_args + ['-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOFTMMU']
4230 # We would like to use --generate-cstr, but it is only available
4232 # is 0.60.x (Debian 12 has 0.60.1) which introduces --allowlist-file.
4234 '--disable-header-comment',
4235 '--raw-line', '// @generated',
4236 '--ctypes-prefix', 'std::os::raw',
4237 '--generate-block',
4238 '--impl-debug',
4239 '--no-doc-comments',
4240 '--with-derive-default',
4241 '--no-layout-tests',
4242 '--no-prepend-enum-name',
4243 '--allowlist-file', meson.project_source_root() + '/include/.*',
4244 '--allowlist-file', meson.project_source_root() + '/.*',
4245 '--allowlist-file', meson.project_build_root() + '/.*'
4249 bindgen_args_common += ['--no-rustfmt-bindings']
4251 bindgen_args_common += ['--formatter', 'none']
4255 bindgen_args_common += ['--rust-target', '1.59']
4259 bindgen_args_common += ['--size_t-is-usize']
4261 bindgen_args_common += ['--merge-extern-blocks']
4282 c_args = ['-DCOMPILING_PER_TARGET',
4283 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
4289 target_inc += include_directories('linux-headers', is_system: true)
4291 if target.endswith('-softmmu')
4304 c_args += ['-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
4317 base_dir = 'linux-user'
4320 base_dir = 'bsd-user'
4321 target_inc += include_directories('bsd-user/' / host_os)
4322 target_inc += include_directories('bsd-user/host/' / host_arch)
4342 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
4343 output: target + '-gdbstub-xml.c',
4414 lib = static_library('qemu-' + target,
4422 if target.endswith('-softmmu')
4424 'name': 'qemu-system-' + target_name,
4431 'name': 'qemu-system-' + target_name + 'w',
4440 'name': 'qemu-fuzz-' + target_name,
4448 'name': 'qemu-' + target_name,
4457 exe_name += '-unsigned'
4470 icon = 'pc-bios/qemu.rsrc'
4488 meson.add_install_script(entitlement, '--install',
4497 'probe-prefix': 'qemu.' + target_type + '.' + target_name,
4506 install_headers('include/qemu/qemu-plugin.h')
4516 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
4519 # used for the update-keymaps target, so include rules even if !have_tools
4520 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
4525 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
4528 qemu_io = executable('qemu-io', files('qemu-io.c'),
4531 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
4536 subdir('storage-daemon')
4538 foreach exe: [ 'qemu-img', 'qemu-io', 'qemu-nbd', 'qemu-storage-daemon']
4541 'probe-prefix': 'qemu.' + exe.substring(5).replace('-', '_')
4547 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
4552 subdir('contrib/vhost-user-blk')
4553 subdir('contrib/vhost-user-gpu')
4554 subdir('contrib/vhost-user-input')
4555 subdir('contrib/vhost-user-scsi')
4559 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
4564 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
4570 executable('qemu-vmsr-helper', files('tools/i386/qemu-vmsr-helper.c'),
4578 subdir('contrib/ivshmem-client')
4579 subdir('contrib/ivshmem-server')
4586 …{'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / t['exe'], 'install': false…
4588 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
4589 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
4592 tracetool, '--group=all', '--format=' + stp['fmt'],
4593 '--binary=' + stp['bin'],
4594 '--probe-prefix=' + t['probe-prefix'],
4611 subdir('pc-bios')
4630 '--',
4631 '-DDISPLAYVERSION=' + meson.project_version(),
4634 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
4637 nsis_cmd += '-DCONFIG_GTK=y'
4641 output: 'qemu-setup-' + meson.project_version() + '.exe',
4682 summary_info += {'sphinx-build': sphinx_build}
4704 summary_info += {'system-mode emulation': have_system}
4705 summary_info += {'user-mode emulation': have_user}
4718 summary_info += {'Trace output file': get_option('trace_file') + '-<pid>'}
4722 summary_info += {'vhost-kernel support': have_vhost_kernel}
4723 summary_info += {'vhost-net support': have_vhost_net}
4724 summary_info += {'vhost-user support': have_vhost_user}
4725 summary_info += {'vhost-user-crypto support': have_vhost_user_crypto}
4726 summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
4727 summary_info += {'vhost-vdpa support': have_vhost_vdpa}
4743 summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
4745 summary_info += {'Objective-C compiler': false}
4756 option_cflags = (get_option('debug') ? ['-g'] : [])
4758 option_cflags += ['-O' + get_option('optimization')]
4779 summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
4785 summary_info += {'debug stack usage': get_option('debug_stack_usage')}
4801 # snarf the cross-compilation information for tests
4805 tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 'config-target.mak'
4848 summary_info += {'vfio-user server': vfio_user_server_allowed}
4894 summary_info += {'rng-none': get_option('rng_none')}
4904 summary_info += {'D-Bus display': dbus_display}
4974 summary_info += {'libcap-ng support': libcap_ng}
4992 summary_info += {'hv-balloon support': hv_balloon}
5015 summary_info += {'libinotify-kqueue': inotify}
5041 message('Support for 32-bit CPU host architecture ' + cpu + ' is going')
5061 message('contact the developers at qemu-devel@nongnu.org.')
5079 message('Use --disable-relocatable to remove this warning.')