diff --git a/build/common.mk b/build/common.mk index a6e270f..c22ba9a 100644 --- a/build/common.mk +++ b/build/common.mk @@ -59,8 +59,8 @@ define PERENV_setup AFLAGS_$($(1)_arch) := $$(COMMON_AFLAGS) $$(COMMON_AFLAGS-$($(1)_arch)) CFLAGS_$($(1)_arch) := $$(COMMON_CFLAGS) $$(COMMON_CFLAGS-$($(1)_arch)) -AFLAGS_$(1) := $$(AFLAGS_$($(1)_arch)) $$(COMMON_AFLAGS-$(1)) -DCONFIG_ENV_$(1) -include arch/config.h -CFLAGS_$(1) := $$(CFLAGS_$($(1)_arch)) $$(COMMON_CFLAGS-$(1)) -DCONFIG_ENV_$(1) -include arch/config.h +AFLAGS_$(1) := $$(AFLAGS_$($(1)_arch)) $$(COMMON_AFLAGS-$(1)) -DCONFIG_ENV_$(1) +CFLAGS_$(1) := $$(CFLAGS_$($(1)_arch)) $$(COMMON_CFLAGS-$(1)) -DCONFIG_ENV_$(1) link-$(1) := $(ROOT)/arch/x86/link-$(1).lds diff --git a/include/xtf/compiler.h b/include/xtf/compiler.h index 19d9349..35fb8c4 100644 --- a/include/xtf/compiler.h +++ b/include/xtf/compiler.h @@ -1,6 +1,12 @@ #ifndef XTF_COMPILER_H #define XTF_COMPILER_H +#if defined(CONFIG_ENV_pv64) || defined(CONFIG_ENV_pv32pae) || \ + defined(CONFIG_ENV_hvm64) || defined(CONFIG_ENV_hvm32pae) || \ + defined(CONFIG_ENV_hvm32pse) || defined(CONFIG_ENV_hvm32) +#include +#endif + #ifdef __GNUC__ #include #endif diff --git a/include/xtf/numbers.h b/include/xtf/numbers.h index f5c73b7..9b7747a 100644 --- a/include/xtf/numbers.h +++ b/include/xtf/numbers.h @@ -6,6 +6,12 @@ #ifndef XTF_NUMBERS_H #define XTF_NUMBERS_H +#if defined(CONFIG_ENV_pv64) || defined(CONFIG_ENV_pv32pae) || \ + defined(CONFIG_ENV_hvm64) || defined(CONFIG_ENV_hvm32pae) || \ + defined(CONFIG_ENV_hvm32pse) || defined(CONFIG_ENV_hvm32) +#include +#endif + /** * Create an integer usable in both C and Assembly, even when @p suf is * needed.