From 1bd28ce912b9399b12e48e42f7158dcad27aa379 Mon Sep 17 00:00:00 2001 From: Maximilian Engelhardt Date: Fri, 11 Dec 2020 19:14:24 +0100 Subject: [PATCH] debian/rules: don't include build path in binaries This is part of making the package build reproducibly. Signed-off-by: Maximilian Engelhardt Acked-by: Hans van Kranenburg --- debian/rules | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 57dde6b0c8..38386568d6 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,7 @@ SHELL := bash -e # Inexplicably, if you tell make `export V=value' and `$(shell ...)' # it does not pass V to the shell. WTF. So we set a variable # dbmo which we include in the relevant $(shell ...) invocations. -dbmo= DEB_BUILD_MAINT_OPTIONS=hardening=+all +dbmo= DEB_BUILD_MAINT_OPTIONS="hardening=+all reproducible=+fixfilepath" # Architecture handling. # @@ -140,8 +140,14 @@ make_args_common := \ XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH)) \ V=1 +# Passing -ffile-prefix-map is needed for reproducible builds. +# Additionally passing -fdebug-prefix-map in necessary to work around a gcc bug +# where -ffile-prefix-map is ignored with assembly files. See +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93371 make_args_xen := $(make_args_common) \ - XEN_TARGET_ARCH=$(xen_arch_$(flavour)) + XEN_TARGET_ARCH=$(xen_arch_$(flavour)) \ + EXTRA_CFLAGS_XEN_CORE='-ffile-prefix-map=$(shell pwd)=. -fdebug-prefix-map=$(shell pwd)=.' + # (Xen upstream does not offer a separate CPPFLAGS, # so we pass those in CFLAGS.) -- 2.30.2