summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Clark <christopher.w.clark@gmail.com>2022-07-09 22:42:16 -0700
committerBruce Ashfield <bruce.ashfield@gmail.com>2022-07-10 21:25:42 -0400
commit40a4c292e31b831ef8f311cb0409c5ee751c4628 (patch)
treee82c8a01173219e7e487318176e5de894fed01bd
parentaa0ac74a03da311d3bd4819502c556a184835a84 (diff)
downloadmeta-virtualization-40a4c292e31b831ef8f311cb0409c5ee751c4628.tar.gz
xen, xen-tools: pass prefix maps to fix buildpaths reproducible build issues
To fix warnings when the buildpaths QA test is enabled, pass the file and debug prefix map options that were previously supplied only for reproducible builds, adding them to the DEBUG_PREFIX_MAP variable and supplying that to CC. Testing indicates that passing the prefix maps needs to be via CC rather than the EXTRA_CFLAGS_XEN_CORE/TOOLS variables. Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-extended/xen/xen.inc21
1 files changed, 10 insertions, 11 deletions
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index ed6e6a7b..2bbf1e35 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -88,12 +88,13 @@ export CROSS_COMPILE="${TARGET_PREFIX}"
88# overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'" 88# overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'"
89export LDFLAGS="" 89export LDFLAGS=""
90 90
91# Pass through the Yocto distro compiler flags via the Xen-provided variables. 91# No additional C flags for the main hypervisor build
92# Special handling: 92EXTRA_CFLAGS_XEN_CORE ?= ""
93# - The Yocto distro compiler flags are typically set to be appropriate for 93# Add prefix maps to support buildpaths QA test and reproducibility
94# user-space software rather than for generation of a hypervisor binary, so 94DEBUG_PREFIX_MAP:append = " \
95# only pass the debug prefix map to the hypervisor build: 95 -ffile-prefix-map=${S}=${PN}-source \
96EXTRA_CFLAGS_XEN_CORE="${DEBUG_PREFIX_MAP}" 96 -fdebug-prefix-map=${WORKDIR}=${PN} \
97 "
97 98
98# - The Xen tools build for x86 systems with HVM-mode enabled includes hvmloader 99# - The Xen tools build for x86 systems with HVM-mode enabled includes hvmloader
99# which fails to build when "-m64" is included in flags set via the 100# which fails to build when "-m64" is included in flags set via the
@@ -109,11 +110,11 @@ TUNE_CCARGS:x86-64=""
109# It must not be compiled with SSE compiler options enabled and the Xen build 110# It must not be compiled with SSE compiler options enabled and the Xen build
110# explicitly clears CFLAGS to ensure that, so such options must not be passed 111# explicitly clears CFLAGS to ensure that, so such options must not be passed
111# in via the tool variable. hvmloader is required to run HVM-mode guest VMs. 112# in via the tool variable. hvmloader is required to run HVM-mode guest VMs.
112CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" 113CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP} ${CC_REPRODUCIBLE_OPTIONS}"
113EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}" 114EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}"
114# 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed 115# 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed
115# in CC to ensure that configure can compile binaries for the right arch. 116# in CC to ensure that configure can compile binaries for the right arch.
116CC:arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" 117CC:arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP} ${CC_REPRODUCIBLE_OPTIONS}"
117 118
118# There are no Xen-provided variables for C++, so append to the tool variables: 119# There are no Xen-provided variables for C++, so append to the tool variables:
119CPP:append = " ${CPPFLAGS}" 120CPP:append = " ${CPPFLAGS}"
@@ -158,9 +159,7 @@ EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=$
158 [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}" 159 [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}"
159 160
160# Improve build reproducibility: compiler flags to remove filesystem differences. 161# Improve build reproducibility: compiler flags to remove filesystem differences.
161CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches ' + \ 162CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches'] \
162 '-ffile-prefix-map=${S}=${PN}-source ' + \
163 '-fdebug-prefix-map=${WORKDIR}=${PN}'] \
164 [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}" 163 [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}"
165 164
166# check for XSM in package config to allow XSM_ENABLE to be set 165# check for XSM in package config to allow XSM_ENABLE to be set