Lines Matching +full:x86 +full:- +full:openbsd
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'
52 bsd_oses = ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly', 'darwin']
53 supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux', 'emscripte…
54 supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
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()
258 .require(host_os in ['sunos', 'linux', 'windows', 'freebsd', 'netbsd', 'openbsd'],
276 elif cpu == 'x86'
286 if cpu == 'x86'
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']
313 if cpu == 'x86'
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',
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
713 # NB2: This clashes with the "retguard" extension of OpenBSD's Clang
714 # https://gitlab.com/qemu-project/qemu/-/issues/2278
715 if host_os != 'openbsd' and \
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'
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 #
858 depend_files: files('pc-bios/qemu-nsis.ico'),
875 elif host_os == 'openbsd'
877 # Disable OpenBSD W^X if available
878 emulator_link_args = cc.get_supported_link_arguments('-Wl,-z,wxneeded')
883 # Host-specific configuration of accelerators #
892 error('WHPX requires 64-bit host')
920 error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu))
924 error('WebAssembly host requires --enable-tcg-interpreter')
930 warning('It is strongly recommended to remove the --enable-tcg-interpreter')
941 add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
963 method: 'pkg-config')
970 method: 'pkg-config',
973 method: 'pkg-config',
976 method: 'pkg-config',
979 method: 'pkg-config',
982 method: 'pkg-config',
986 method: 'pkg-config')])
1011 # Use -D to pick just one of the test programs in scripts/xen-detect.c
1014 ('0' + xen_version[1]).substring(-2) + \
1015 ('0' + xen_version[2]).substring(-2)
1016 if cc.links(files('scripts/xen-detect.c'),
1017 args: '-DCONFIG_XEN_CTRL_INTERFACE_VERSION=' + xen_ctrl_version,
1035 .require(cpu == 'x86' or cpu == 'x86_64',
1048 glib_pc = dependency('glib-2.0', version: glib_req_ver, required: true,
1049 method: 'pkg-config')
1052 gmodule = dependency('gmodule-export-2.0', version: glib_req_ver, required: true,
1053 method: 'pkg-config')
1055 gmodule = dependency('gmodule-no-export-2.0', version: glib_req_ver, required: true,
1056 method: 'pkg-config')
1061 # This workaround is required due to a bug in pkg-config file for glib as it
1062 # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static
1064 glib_cflags += ['-DGLIB_STATIC_COMPILATION']
1069 # problems on multi-arch where people try to build
1070 # 32-bit QEMU while pointing at 64-bit glib headers
1077 typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused));
1085 to the right pkg-config files for your build target.''')
1101 meson.override_dependency('glib-2.0', glib)
1109 gdbus_codegen_error = '@0@ requires gdbus-codegen, please install libgio'
1111 gio = dependency('gio-2.0', required: get_option('gio'),
1112 method: 'pkg-config')
1126 gdbus_codegen = find_program('gdbus-codegen',
1128 gio_unix = dependency('gio-unix-2.0', required: get_option('gio'),
1129 method: 'pkg-config')
1136 gdbus_codegen_error = '@0@ uses gdbus-codegen, which does not support control flow integrity'
1139 xml_pp = find_program('scripts/xml-preprocess.py')
1143 lttng = dependency('lttng-ust', required: true, version: '>= 2.1',
1144 method: 'pkg-config')
1148 pixman = dependency('pixman-1', required: get_option('pixman'), version:'>=0.21.8',
1149 method: 'pkg-config')
1170 method: 'pkg-config')
1180 method: 'pkg-config')
1202 cc.links(libattr_test, dependencies: libattr, args: '-DCONFIG_LIBATTR')
1236 method: 'pkg-config')
1246 libcap_ng = cc.find_library('cap-ng', has_headers: ['cap-ng.h'],
1250 #include <cap-ng.h>
1258 error('could not link libcap-ng')
1260 warning('could not link libcap-ng, disabling')
1268 method: 'pkg-config')
1274 method: 'pkg-config')
1277 # When using a system-wide shared libslirp, the type information for the
1280 # with control-flow integrity.
1283 error('Control-Flow Integrity requires libslirp 4.7.')
1285 warning('Cannot use libslirp since Control-Flow Integrity requires libslirp >= 4.7.')
1316 method: 'pkg-config')
1321 method: 'pkg-config')
1326 method: 'pkg-config')
1330 pipewire = dependency('libpipewire-0.3', version: '>=0.3.60',
1332 method: 'pkg-config')
1337 method: 'pkg-config')
1342 spice_protocol = dependency('spice-protocol', version: '>=0.14.0',
1344 method: 'pkg-config')
1352 spice = dependency('spice-server', version: '>=0.14.0',
1354 method: 'pkg-config')
1364 method: 'pkg-config')
1370 method: 'pkg-config')
1376 method: 'pkg-config')
1382 method: 'pkg-config')
1385 method: 'pkg-config')
1395 method: 'pkg-config')
1403 method: 'pkg-config',
1409 method: 'pkg-config',
1415 method: 'pkg-config',
1421 method: 'pkg-config',
1427 method: 'pkg-config',
1507 method: 'pkg-config')
1509 curses_compile_args = ['-DNCURSES_WIDECHAR=1']
1523 curses_compile_args += ['-I/usr/include/ncursesw']
1544 foreach link_args : [ ['-liconv'], [] ]
1548 # However, without adding glib to the dependencies -L/usr/local/lib will not be
1553 iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
1554 return conv != (iconv_t) -1;
1600 # Some versions of SDL have problems with -Wundef
1605 ''', dependencies: sdl, args: '-Werror=undef')
1606 sdl = declare_dependency(compile_args: '-Wno-undef',
1611 method: 'pkg-config')
1614 error('sdl-image required, but SDL was @0@'.format(
1650 glusterfs = dependency('glusterfs-api', version: '>=3',
1652 method: 'pkg-config')
1700 error('could not enable hv-balloon, update your glib')
1702 warning('could not find glib support for hv-balloon, disabling')
1710 method: 'pkg-config',
1765 dsound = declare_dependency(link_args: ['-lole32', '-ldxguid'])
1783 epoxy = dependency('epoxy', method: 'pkg-config',
1793 gbm = dependency('gbm', method: 'pkg-config', required: false)
1820 method: 'pkg-config',
1827 method: 'pkg-config',
1857 # Debian has removed -lgpg-error from libgcrypt-config
1863 cc.find_library('gpg-error', required: true)],
1891 method: 'pkg-config',
1924 // HMAC-SM3 test
1939 method: 'pkg-config',
1942 # Some versions of capstone have broken pkg-config file
1943 # that reports a wrong -I path, causing the #include to
1955 gmp = dependency('gmp', required: false, method: 'pkg-config')
1958 method: 'pkg-config',
1973 gtk = dependency('gtk+-3.0', version: '>=3.22.0',
1974 method: 'pkg-config',
1977 gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0',
1978 method: 'pkg-config',
1984 vte = dependency('vte-2.91',
1985 method: 'pkg-config',
1995 x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found())
2000 method: 'pkg-config')
2012 method: 'pkg-config')
2017 compile_args: '-DSTRUCT_IOVEC_DEFINED')
2047 snappy = cc.find_library('snappy', has_headers: ['snappy-c.h'],
2051 #include <snappy-c.h>
2138 version: '>=2.5.1', method: 'pkg-config')
2142 u2f = dependency('u2f-emu', required: get_option('u2f'),
2143 method: 'pkg-config')
2147 canokey = dependency('canokey-qemu', required: get_option('canokey'),
2148 method: 'pkg-config')
2152 usbredir = dependency('libusbredirparser-0.5', required: get_option('usb_redir'),
2153 version: '>=0.6', method: 'pkg-config')
2157 libusb = dependency('libusb-1.0', required: get_option('libusb'),
2158 version: '>=1.0.13', method: 'pkg-config')
2164 method: 'pkg-config')
2169 version: '>=57', method: 'pkg-config')
2175 method: 'pkg-config')
2180 method: 'pkg-config')
2188 method: 'pkg-config')
2205 error('malloc_trim not available with non-libc memory allocator')
2220 * function availability on recentish Mingw-w64 platforms. */
2231 error_message: 'vhost_user_blk_server requires vhost-user support') \
2236 error('Cannot enable fuse-lseek while fuse is disabled')
2240 version: '>=3.1', method: 'pkg-config')
2249 error('fuse-lseek requires libfuse >=3.8, found ' + fuse.version())
2251 error('fuse-lseek requires libfuse, which was not found')
2278 …ependency('libbpf', version: '>=' + bpf_version, required: get_option('bpf'), method: 'pkg-config')
2302 version: '>=1.4.0', method: 'pkg-config')
2315 method: 'pkg-config',
2320 # config-host.h #
2372 error_message: '-display dbus requires glib>=2.64') \
2374 error_message: gdbus_codegen_error.format('-display dbus')) \
2379 error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
2381 … error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \
2383 error_message: 'virtio-9p (virtfs) on Linux requires libattr-devel') \
2442 meson.current_source_dir() / 'scripts/qemu-stamp.py',
2443 meson.project_version(), get_option('pkgversion'), '--',
2468 error('Cannot enable module-upgrades as modules are not enabled')
2611 ('0' + xen_version[1]).substring(-2) + \
2612 ('0' + xen_version[2]).substring(-2)
2710 args: '-fsanitize=address',
2723 # libinotify-kqueue
2781 # https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/bsd/man/man4/tcp.4#L172
2841 # missing-prototype case, we try again with a definitely-bogus prototype.
2863 # i.e. errno is set and -1 is returned. That's not really how POSIX defines the
2933 int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
2998 }''', args: ['-Werror']))
3000 # See if 64-bit atomic operations are supported.
3036 # "do we have 128-bit atomics which are handled inline and specifically not
3039 # We only care about these operations on 16-byte aligned pointers, so
3040 # force 16-byte alignment of the pointer, which may be greater than
3044 __uint128_t *p = __builtin_assume_aligned(av[ac - 1], 16);
3147 int main(int argc, char *argv[]) { return bar(argv[argc - 1]); }
3264 error('mingw must provide setjmp/longjmp for windows-arm64')
3334 config_target = { 'TARGET_NAME': target.split('-')[0] }
3335 if target.endswith('linux-user')
3343 elif target.endswith('bsd-user')
3355 if target.endswith('-user')
3368 # Disallow 64-bit on 32-bit emulation and virtualization
3423 # Note that TARGET_BASE_ARCH ends up in config-target.h but it is
3438 config_target_h += {target: configure_file(output: target + '-config-target.h',
3441 if target.endswith('-softmmu')
3445 # PVG is not cross-architecture. Use accelerator_targets as a proxy to
3452 config_devices_mak = target + '-config-devices.mak'
3459 get_option('default_devices') ? '--defconfig' : '--allnoconfig',
3469 config_devices_h += {target: configure_file(output: target + '-config-devices.h',
3488 genh += custom_target('config-poison.h',
3490 output: 'config-poison.h',
3492 command: [find_program('scripts/make-config-poison.sh'),
3505 libvfio_user_proj = subproject('libvfio-user', required: true)
3511 libvhost_user = subproject('libvhost-user')
3525 config_host_h = configure_file(output: 'config-host.h', configuration: config_host_data)
3530 qapi_gen = find_program('scripts/qapi-gen.py')
3546 meson.current_source_dir() / 'scripts/qapi-gen.py'
3551 '--backend=' + ','.join(get_option('trace_backends'))
3573 qemu_version_cmd = [find_program('scripts/qemu-version.sh'),
3576 qemu_version = custom_target('qemu-version.h',
3577 output: 'qemu-version.h',
3586 ['qemu-options.hx', 'qemu-options.def'],
3587 ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
3591 ['hmp-commands.hx', 'hmp-commands.h'],
3592 ['hmp-commands-info.hx', 'hmp-commands-info.h'],
3600 command: [hxtool, '-h', '@INPUT0@'])
3619 trace_events_subdirs += [ 'linux-user' ]
3622 trace_events_subdirs += [ 'bsd-user' ]
3671 'hw/pci-host',
3776 …libmodulecommon = static_library('module-common', files('module-common.c') + genh, pic: true, c_ar…
3777 …ndency(objects: libmodulecommon.extract_all_objects(recursive: false), compile_args: '-DBUILD_DSO')
3787 event_loop_base = files('event-loop-base.c')
3788 event_loop_base = static_library('event-loop-base',
3812 output: 'decode-@BASENAME@.c.inc',
3813 arguments: ['@INPUT@', '@EXTRA_ARGS@', '-o', '@OUTPUT@'])
3829 'qemu-io-cmds.c',
3841 'blockdev-nbd.c',
3843 'job-qmp.c',
3846 # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
3847 # os-win32.c does not
3849 system_ss.add(files('os-win32.c'))
3851 blockdev_ss.add(files('os-wasm.c'))
3853 blockdev_ss.add(files('os-posix.c'))
3857 common_ss.add(files('cpu-common.c'))
3858 specific_ss.add(files('cpu-target.c'))
3866 # impossible, as the alias is restricted to page-vary-common.c. Indeed,
3867 # without lto, not even the alias is required -- we simply use different
3869 pagevary = files('page-vary-common.c')
3871 pagevary_flags = ['-fno-lto']
3873 pagevary_flags += '-fno-sanitize=cfi-icall'
3875 pagevary = static_library('page-vary-common', sources: pagevary + genh,
3880 specific_ss.add(files('page-target.c', 'page-vary-target.c'))
3882 common_ss.add(files('target-info.c'))
3883 specific_ss.add(files('target-info-stub.c'))
3905 subdir('common-user')
3906 subdir('bsd-user')
3907 subdir('linux-user')
3920 modinfo_collect = find_program('scripts/modinfo-collect.py')
3921 modinfo_generate = find_program('scripts/modinfo-generate.py')
3936 sl = static_library(d + '-' + m, [genh, module_ss.sources()],
3950 modinfo_files += custom_target(d + '-' + m + '.modinfo',
3951 output: d + '-' + m + '.modinfo',
3971 if target.endswith('-softmmu')
3974 c_args = ['-DCOMPILING_PER_TARGET',
3975 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
3976 '-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
3979 module_name = d + '-' + m + '-' + config_target['TARGET_NAME']
3997 … command: [modinfo_collect, '--target', target, '@INPUT@'])
4009 if target.endswith('-softmmu')
4011 config_devices_mak = target + '-config-devices.mak'
4012 modinfo_src = custom_target('modinfo-' + target + '.c',
4013 output: 'modinfo-' + target + '.c',
4015 … command: [modinfo_generate, '--devices', config_devices_mak, '@INPUT@'],
4018 modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
4119 c_args: ['-DCONFIG_USER_ONLY',
4120 '-DCOMPILING_SYSTEM_VS_USER'],
4127 c_args: ['-DCONFIG_SOFTMMU',
4128 '-DCOMPILING_SYSTEM_VS_USER'],
4166 target_c_args = ['-DCPU_DEFS_H']
4167 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 += ['--no-rustfmt-bindings']
4227 bindgen_args += ['--formatter', 'none']
4231 bindgen_args += ['--rust-target', '1.59']
4235 bindgen_args += ['--size_t-is-usize']
4237 bindgen_args += ['--merge-extern-blocks']
4253 bindgen_args += ['--rustified-enum', enum]
4260 bindgen_args += ['--bitfield-enum', enum]
4297 c_args = ['-DCOMPILING_PER_TARGET',
4298 '-DCONFIG_TARGET="@0@-config-target.h"'.format(target),
4304 target_inc += include_directories('linux-headers', is_system: true)
4306 if target.endswith('-softmmu')
4319 c_args += ['-DCONFIG_DEVICES="@0@-config-devices.h"'.format(target)]
4332 base_dir = 'linux-user'
4335 base_dir = 'bsd-user'
4336 target_inc += include_directories('bsd-user/' / host_os)
4337 target_inc += include_directories('bsd-user/host/' / host_arch)
4357 gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
4358 output: target + '-gdbstub-xml.c',
4429 lib = static_library('qemu-' + target,
4437 if target.endswith('-softmmu')
4439 'name': 'qemu-system-' + target_name,
4446 'name': 'qemu-system-' + target_name + 'w',
4455 'name': 'qemu-fuzz-' + target_name,
4463 'name': 'qemu-' + target_name,
4472 exe_name += '-unsigned'
4485 icon = 'pc-bios/qemu.rsrc'
4503 meson.add_install_script(entitlement, '--install',
4512 'probe-prefix': 'qemu.' + target_type + '.' + target_name,
4521 install_headers('include/qemu/qemu-plugin.h')
4531 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
4534 # used for the update-keymaps target, so include rules even if !have_tools
4535 qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
4540 qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep],
4543 qemu_io = executable('qemu-io', files('qemu-io.c'),
4546 qemu_nbd = executable('qemu-nbd', files('qemu-nbd.c'),
4551 subdir('storage-daemon')
4553 foreach exe: [ 'qemu-img', 'qemu-io', 'qemu-nbd', 'qemu-storage-daemon']
4556 'probe-prefix': 'qemu.' + exe.substring(5).replace('-', '_')
4562 executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'),
4567 subdir('contrib/vhost-user-blk')
4568 subdir('contrib/vhost-user-gpu')
4569 subdir('contrib/vhost-user-input')
4570 subdir('contrib/vhost-user-scsi')
4574 executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
4579 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'),
4584 if cpu in ['x86', 'x86_64']
4585 executable('qemu-vmsr-helper', files('tools/i386/qemu-vmsr-helper.c'),
4593 subdir('contrib/ivshmem-client')
4594 subdir('contrib/ivshmem-server')
4601 …{'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / t['exe'], 'install': false…
4603 {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '', 'install': true},
4604 {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
4607 tracetool, '--group=all', '--format=' + stp['fmt'],
4608 '--binary=' + stp['bin'],
4609 '--probe-prefix=' + t['probe-prefix'],
4626 subdir('pc-bios')
4645 '--',
4646 '-DDISPLAYVERSION=' + meson.project_version(),
4649 nsis_cmd += '-DCONFIG_DOCUMENTATION=y'
4652 nsis_cmd += '-DCONFIG_GTK=y'
4656 output: 'qemu-setup-' + meson.project_version() + '.exe',
4697 summary_info += {'sphinx-build': sphinx_build}
4719 summary_info += {'system-mode emulation': have_system}
4720 summary_info += {'user-mode emulation': have_user}
4733 summary_info += {'Trace output file': get_option('trace_file') + '-<pid>'}
4737 summary_info += {'vhost-kernel support': have_vhost_kernel}
4738 summary_info += {'vhost-net support': have_vhost_net}
4739 summary_info += {'vhost-user support': have_vhost_user}
4740 summary_info += {'vhost-user-crypto support': have_vhost_user_crypto}
4741 summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
4742 summary_info += {'vhost-vdpa support': have_vhost_vdpa}
4758 summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
4760 summary_info += {'Objective-C compiler': false}
4771 option_cflags = (get_option('debug') ? ['-g'] : [])
4773 option_cflags += ['-O' + get_option('optimization')]
4794 summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
4816 # snarf the cross-compilation information for tests
4820 tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 'config-target.mak'
4863 summary_info += {'vfio-user server': vfio_user_server_allowed}
4908 summary_info += {'rng-none': get_option('rng_none')}
4918 summary_info += {'D-Bus display': dbus_display}
4987 summary_info += {'libcap-ng support': libcap_ng}
5005 summary_info += {'hv-balloon support': hv_balloon}
5027 summary_info += {'libinotify-kqueue': inotify}
5053 message('Support for 32-bit CPU host architecture ' + cpu + ' is going')
5073 message('contact the developers at qemu-devel@nongnu.org.')
5091 message('Use --disable-relocatable to remove this warning.')