diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2020-03-08 21:56:56 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-03-13 21:53:20 -0400 |
commit | e57cf80d54ad929db7e4e677fbbd9e5a3dee22fe (patch) | |
tree | 51ba8d3e5d4f06518efa1ca74a1e67102ddd324b | |
parent | bbbda2aff9282b1615fcf6b2ec4c7e4e347a8f01 (diff) | |
download | meta-virtualization-e57cf80d54ad929db7e4e677fbbd9e5a3dee22fe.tar.gz |
xen, xen-tools: reproducible build compiler flags
The change to the method of passing compiler flags into the Xen build
system in 6b697676 omitted passing the compiler flags for improving
build reproducibility, so this commit returns them and includes a change
to use the -ffile-prefix-map compiler option to remove host filesystem
artefacts instead of the prior method of redefining the __FILE__ builtin
macro.
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.inc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index d863c8f0..2a02805f 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc | |||
@@ -101,12 +101,12 @@ export LDFLAGS="" | |||
101 | # It must not be compiled with SSE compiler options enabled and the Xen build | 101 | # It must not be compiled with SSE compiler options enabled and the Xen build |
102 | # explicitly clears CFLAGS to ensure that, so such options must not be passed | 102 | # 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. | 103 | # in via the tool variable. hvmloader is required to run HVM-mode guest VMs. |
104 | CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" | 104 | CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" |
105 | EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}" | 105 | EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}" |
106 | EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}" | 106 | EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}" |
107 | # 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed | 107 | # 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. | 108 | # in CC to ensure that configure can compile binaries for the right arch. |
109 | CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}" | 109 | CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" |
110 | EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}" | 110 | EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}" |
111 | EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}" | 111 | EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}" |
112 | 112 | ||
@@ -155,10 +155,10 @@ EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=$ | |||
155 | [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}" | 155 | [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}" |
156 | 156 | ||
157 | # Improve build reproducibility: compiler flags to remove filesystem differences. | 157 | # Improve build reproducibility: compiler flags to remove filesystem differences. |
158 | # Suppress __FILE__ via an alternative builtin. | 158 | CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches ' + \ |
159 | CC += "${@['', '-gno-record-gcc-switches -Wno-builtin-macro-redefined -D__FILE__=__VERSION__ ' + \ | 159 | '-ffile-prefix-map=${S}=${PN}-source ' + \ |
160 | '-fdebug-prefix-map=${WORKDIR}=${PN}'] \ | 160 | '-fdebug-prefix-map=${WORKDIR}=${PN}'] \ |
161 | [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}" | 161 | [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}" |
162 | 162 | ||
163 | # check for XSM in package config to allow XSM_ENABLE to be set | 163 | # check for XSM in package config to allow XSM_ENABLE to be set |
164 | python () { | 164 | python () { |