mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-26 19:42:33 -06:00
meson: Only allow CONFIG_USER_ONLY from certain source sets
Poison CONFIG_USER_ONLY and CONFIG_SOFTMMU unless the compilation unit is in specific_ss, libuser_ss, or libsystem_ss. This is intended to prevent files being incorrectly added to common_ss. Remove #ifndef CONFIG_USER_ONLY / #error / #endif blocks. All they do is trigger the poison error. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
e4610f3809
commit
8916c373a3
6 changed files with 9 additions and 18 deletions
|
@ -66,4 +66,9 @@
|
||||||
#pragma GCC poison CONFIG_WHPX
|
#pragma GCC poison CONFIG_WHPX
|
||||||
#pragma GCC poison CONFIG_XEN
|
#pragma GCC poison CONFIG_XEN
|
||||||
|
|
||||||
|
#ifndef COMPILING_SYSTEM_VS_USER
|
||||||
|
#pragma GCC poison CONFIG_USER_ONLY
|
||||||
|
#pragma GCC poison CONFIG_SOFTMMU
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
#ifndef QEMU_HW_H
|
#ifndef QEMU_HW_H
|
||||||
#define QEMU_HW_H
|
#define QEMU_HW_H
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
|
||||||
#error Cannot include hw/hw.h from user emulation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
G_NORETURN void hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
|
G_NORETURN void hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
#ifndef QEMU_CONFIDENTIAL_GUEST_SUPPORT_H
|
#ifndef QEMU_CONFIDENTIAL_GUEST_SUPPORT_H
|
||||||
#define QEMU_CONFIDENTIAL_GUEST_SUPPORT_H
|
#define QEMU_CONFIDENTIAL_GUEST_SUPPORT_H
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
|
||||||
#error Cannot include system/confidential-guest-support.h from user emulation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
|
|
||||||
#define TYPE_CONFIDENTIAL_GUEST_SUPPORT "confidential-guest-support"
|
#define TYPE_CONFIDENTIAL_GUEST_SUPPORT "confidential-guest-support"
|
||||||
|
|
|
@ -11,10 +11,6 @@
|
||||||
#ifndef SYSTEM_REPLAY_H
|
#ifndef SYSTEM_REPLAY_H
|
||||||
#define SYSTEM_REPLAY_H
|
#define SYSTEM_REPLAY_H
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
|
||||||
#error Cannot include this header from user emulation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "exec/replay-core.h"
|
#include "exec/replay-core.h"
|
||||||
#include "qapi/qapi-types-misc.h"
|
#include "qapi/qapi-types-misc.h"
|
||||||
#include "qapi/qapi-types-run-state.h"
|
#include "qapi/qapi-types-run-state.h"
|
||||||
|
|
|
@ -10,10 +10,6 @@
|
||||||
#ifndef SYSTEM_XEN_H
|
#ifndef SYSTEM_XEN_H
|
||||||
#define SYSTEM_XEN_H
|
#define SYSTEM_XEN_H
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
|
||||||
#error Cannot include system/xen.h from user emulation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "exec/cpu-common.h"
|
#include "exec/cpu-common.h"
|
||||||
|
|
||||||
#ifdef COMPILING_PER_TARGET
|
#ifdef COMPILING_PER_TARGET
|
||||||
|
|
|
@ -4050,7 +4050,8 @@ common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
|
||||||
libuser_ss = libuser_ss.apply({})
|
libuser_ss = libuser_ss.apply({})
|
||||||
libuser = static_library('user',
|
libuser = static_library('user',
|
||||||
libuser_ss.sources() + genh,
|
libuser_ss.sources() + genh,
|
||||||
c_args: '-DCONFIG_USER_ONLY',
|
c_args: ['-DCONFIG_USER_ONLY',
|
||||||
|
'-DCOMPILING_SYSTEM_VS_USER'],
|
||||||
dependencies: libuser_ss.dependencies(),
|
dependencies: libuser_ss.dependencies(),
|
||||||
build_by_default: false)
|
build_by_default: false)
|
||||||
libuser = declare_dependency(objects: libuser.extract_all_objects(recursive: false),
|
libuser = declare_dependency(objects: libuser.extract_all_objects(recursive: false),
|
||||||
|
@ -4060,7 +4061,8 @@ common_ss.add(when: 'CONFIG_USER_ONLY', if_true: libuser)
|
||||||
libsystem_ss = libsystem_ss.apply({})
|
libsystem_ss = libsystem_ss.apply({})
|
||||||
libsystem = static_library('system',
|
libsystem = static_library('system',
|
||||||
libsystem_ss.sources() + genh,
|
libsystem_ss.sources() + genh,
|
||||||
c_args: '-DCONFIG_SOFTMMU',
|
c_args: ['-DCONFIG_SOFTMMU',
|
||||||
|
'-DCOMPILING_SYSTEM_VS_USER'],
|
||||||
dependencies: libsystem_ss.dependencies(),
|
dependencies: libsystem_ss.dependencies(),
|
||||||
build_by_default: false)
|
build_by_default: false)
|
||||||
libsystem = declare_dependency(objects: libsystem.extract_all_objects(recursive: false),
|
libsystem = declare_dependency(objects: libsystem.extract_all_objects(recursive: false),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue