summaryrefslogtreecommitdiffstats
path: root/recipes-extended/xen/xen.inc
diff options
context:
space:
mode:
authorChristopher Clark <christopher.w.clark@gmail.com>2021-07-07 21:32:44 -0700
committerBruce Ashfield <bruce.ashfield@gmail.com>2021-07-14 15:33:10 -0400
commit3e128c1bcd8f46a37923271b5b722b378eb72d06 (patch)
treea7f06794b053144a7ad4307b76b951c663c62504 /recipes-extended/xen/xen.inc
parent4d61693058271667a5f30a92d8f40c96ff1c16ba (diff)
downloadmeta-virtualization-3e128c1bcd8f46a37923271b5b722b378eb72d06.tar.gz
xen, xen-tools: fix build and passing of CFLAGS via Xen vars
Ensure that the Xen build system variables EXTRA_CFLAGS_XEN_CORE and EXTRA_CFLAGS_XEN_TOOLS are passed into the compile steps. Update the hypervisor compilation to avoid passing in most compile flags from the build environment via EXTRA_CFLAGS_XEN_CORE -- prefer the compiler defaults and the flags set by the Xen build system, so only the debug prefix flags are provided. Observeration derived from the prior commit e99974aa, so: Reported-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/xen/xen.inc')
-rw-r--r--recipes-extended/xen/xen.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 2fbdb3a4..5aa2d5a5 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -92,6 +92,16 @@ export LDFLAGS=""
92 92
93# Pass through the Yocto distro compiler flags via the Xen-provided variables. 93# Pass through the Yocto distro compiler flags via the Xen-provided variables.
94# Special handling: 94# Special handling:
95# - The Yocto distro compiler flags are typically set to be appropriate for
96# user-space software rather than for generation of a hypervisor binary, so
97# only pass the debug prefix map to the hypervisor build:
98EXTRA_CFLAGS_XEN_CORE="${DEBUG_PREFIX_MAP}"
99
100# - The Xen tools build for x86 systems with HVM-mode enabled includes hvmloader
101# which fails to build when "-m64" is included in flags set via the
102# EXTRA_CFLAGS_XEN_TOOLS: so clear TUNE_CCARGS on x86 to prevent that.
103TUNE_CCARGS_x86-64=""
104
95# - Yocto supplies the _FORTIFY_SOURCE flag via CC/CPP/CXX but then passes the 105# - Yocto supplies the _FORTIFY_SOURCE flag via CC/CPP/CXX but then passes the
96# optimization -O via C*FLAGS which is problematic when the CFLAGS are cleared 106# optimization -O via C*FLAGS which is problematic when the CFLAGS are cleared
97# within the build because compilation fails with the compiler stating 107# within the build because compilation fails with the compiler stating
@@ -102,12 +112,10 @@ export LDFLAGS=""
102# explicitly clears CFLAGS to ensure that, so such options must not be passed 112# explicitly clears CFLAGS to ensure that, so such options must not be passed
103# in via the tool variable. hvmloader is required to run HVM-mode guest VMs. 113# in via the tool variable. hvmloader is required to run HVM-mode guest VMs.
104CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" 114CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}"
105EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}"
106EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}" 115EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}"
107# 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed 116# 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed
108# in CC to ensure that configure can compile binaries for the right arch. 117# in CC to ensure that configure can compile binaries for the right arch.
109CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" 118CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}"
110EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}"
111EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}" 119EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}"
112 120
113# There are no Xen-provided variables for C++, so append to the tool variables: 121# There are no Xen-provided variables for C++, so append to the tool variables: