All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH] xen, xen-tools: reproducible build compiler flags
@ 2020-03-09  4:56 Christopher Clark
  2020-03-14  1:54 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Clark @ 2020-03-09  4:56 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

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>
---
 recipes-extended/xen/xen.inc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index d863c8f..2a02805 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -101,12 +101,12 @@ export LDFLAGS=""
 #   It must not be compiled with SSE compiler options enabled and the Xen build
 #   explicitly clears CFLAGS to ensure that, so such options must not be passed
 #   in via the tool variable. hvmloader is required to run HVM-mode guest VMs.
-CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"
+CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}"
 EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}"
 EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}"
 # 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed
 # in CC to ensure that configure can compile binaries for the right arch.
-CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
+CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}"
 EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}"
 EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}"
 
@@ -155,10 +155,10 @@ EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=$
                     [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}"
 
 # Improve build reproducibility: compiler flags to remove filesystem differences.
-# Suppress __FILE__ via an alternative builtin.
-CC += "${@['', '-gno-record-gcc-switches -Wno-builtin-macro-redefined -D__FILE__=__VERSION__ ' + \
-               '-fdebug-prefix-map=${WORKDIR}=${PN}'] \
-          [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}"
+CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches ' + \
+                                   '-ffile-prefix-map=${S}=${PN}-source ' + \
+                                   '-fdebug-prefix-map=${WORKDIR}=${PN}'] \
+                             [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}"
 
 # check for XSM in package config to allow XSM_ENABLE to be set
 python () {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-virtualization][PATCH] xen, xen-tools: reproducible build compiler flags
  2020-03-09  4:56 [meta-virtualization][PATCH] xen, xen-tools: reproducible build compiler flags Christopher Clark
@ 2020-03-14  1:54 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2020-03-14  1:54 UTC (permalink / raw)
  To: christopher.w.clark; +Cc: meta-virtualization, cardoe

merged.

Bruce

In message: [meta-virtualization][PATCH] xen, xen-tools: reproducible build compiler flags
on 08/03/2020 christopher.w.clark@gmail.com wrote:

> From: Christopher Clark <christopher.w.clark@gmail.com>
> 
> 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>
> ---
>  recipes-extended/xen/xen.inc | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
> index d863c8f..2a02805 100644
> --- a/recipes-extended/xen/xen.inc
> +++ b/recipes-extended/xen/xen.inc
> @@ -101,12 +101,12 @@ export LDFLAGS=""
>  #   It must not be compiled with SSE compiler options enabled and the Xen build
>  #   explicitly clears CFLAGS to ensure that, so such options must not be passed
>  #   in via the tool variable. hvmloader is required to run HVM-mode guest VMs.
> -CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"
> +CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}"
>  EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}"
>  EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}"
>  # 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed
>  # in CC to ensure that configure can compile binaries for the right arch.
> -CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
> +CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}"
>  EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}"
>  EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}"
>  
> @@ -155,10 +155,10 @@ EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=$
>                      [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}"
>  
>  # Improve build reproducibility: compiler flags to remove filesystem differences.
> -# Suppress __FILE__ via an alternative builtin.
> -CC += "${@['', '-gno-record-gcc-switches -Wno-builtin-macro-redefined -D__FILE__=__VERSION__ ' + \
> -               '-fdebug-prefix-map=${WORKDIR}=${PN}'] \
> -          [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}"
> +CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches ' + \
> +                                   '-ffile-prefix-map=${S}=${PN}-source ' + \
> +                                   '-fdebug-prefix-map=${WORKDIR}=${PN}'] \
> +                             [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}"
>  
>  # check for XSM in package config to allow XSM_ENABLE to be set
>  python () {
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-14  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09  4:56 [meta-virtualization][PATCH] xen, xen-tools: reproducible build compiler flags Christopher Clark
2020-03-14  1:54 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.