diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2021-07-07 21:32:44 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-07-14 15:33:10 -0400 |
commit | 3e128c1bcd8f46a37923271b5b722b378eb72d06 (patch) | |
tree | a7f06794b053144a7ad4307b76b951c663c62504 | |
parent | 4d61693058271667a5f30a92d8f40c96ff1c16ba (diff) | |
download | meta-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>
-rw-r--r-- | recipes-extended/xen/xen-hypervisor.inc | 3 | ||||
-rw-r--r-- | recipes-extended/xen/xen-tools.inc | 3 | ||||
-rw-r--r-- | recipes-extended/xen/xen.inc | 12 |
3 files changed, 14 insertions, 4 deletions
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc index 916bd3ce..9b96d91e 100644 --- a/recipes-extended/xen/xen-hypervisor.inc +++ b/recipes-extended/xen/xen-hypervisor.inc | |||
@@ -49,7 +49,8 @@ do_configure() { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | do_compile() { | 51 | do_compile() { |
52 | oe_runmake xen PYTHON="${PYTHON}" | 52 | oe_runmake xen PYTHON="${PYTHON}" \ |
53 | EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" | ||
53 | } | 54 | } |
54 | 55 | ||
55 | do_install() { | 56 | do_install() { |
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc index 3560e798..2930097c 100644 --- a/recipes-extended/xen/xen-tools.inc +++ b/recipes-extended/xen/xen-tools.inc | |||
@@ -727,7 +727,8 @@ do_configure() { | |||
727 | 727 | ||
728 | do_compile() { | 728 | do_compile() { |
729 | cd ${S} | 729 | cd ${S} |
730 | oe_runmake tools PYTHON="${PYTHON}" | 730 | oe_runmake tools PYTHON="${PYTHON}" \ |
731 | EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" | ||
731 | } | 732 | } |
732 | 733 | ||
733 | do_install() { | 734 | do_install() { |
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: | ||
98 | EXTRA_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. | ||
103 | TUNE_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. |
104 | CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" | 114 | CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" |
105 | EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}" | ||
106 | EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}" | 115 | EXTRA_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. |
109 | CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" | 118 | CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" |
110 | EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}" | ||
111 | EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}" | 119 | EXTRA_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: |