diff options
-rw-r--r-- | recipes-extended/xen/xen.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index 4894c770..38cecd1d 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc | |||
@@ -870,6 +870,24 @@ EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.r | |||
870 | EXTRA_OEMAKE += "WGET=/bin/false" | 870 | EXTRA_OEMAKE += "WGET=/bin/false" |
871 | EXTRA_OEMAKE += "GIT=/bin/false" | 871 | EXTRA_OEMAKE += "GIT=/bin/false" |
872 | 872 | ||
873 | # Improve build reproducibility: provide values for build variables. | ||
874 | def get_build_time_vars(d): | ||
875 | source_date_epoch = d.getVar('SOURCE_DATE_EPOCH') | ||
876 | if source_date_epoch is not None: | ||
877 | import datetime | ||
878 | utc_datetime = datetime.datetime.utcfromtimestamp(float(source_date_epoch)) | ||
879 | return " XEN_BUILD_DATE=" + utc_datetime.strftime("%Y-%m-%d") + \ | ||
880 | " XEN_BUILD_TIME=" + utc_datetime.strftime("%H:%M:%S") | ||
881 | return "" | ||
882 | EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=${PN}-buildhost'] \ | ||
883 | [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}" | ||
884 | |||
885 | # Improve build reproducibility: compiler flags to remove filesystem differences. | ||
886 | # Suppress __FILE__ via an alternative builtin. | ||
887 | CC += "${@['', '-gno-record-gcc-switches -Wno-builtin-macro-redefined -D__FILE__=__VERSION__ ' + \ | ||
888 | '-fdebug-prefix-map=${WORKDIR}=${PN}'] \ | ||
889 | [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}" | ||
890 | |||
873 | # check for XSM in package config to allow XSM_ENABLE to be set | 891 | # check for XSM in package config to allow XSM_ENABLE to be set |
874 | python () { | 892 | python () { |
875 | pkgconfig = d.getVar('PACKAGECONFIG') | 893 | pkgconfig = d.getVar('PACKAGECONFIG') |
@@ -889,6 +907,15 @@ do_post_patch() { | |||
889 | 907 | ||
890 | # libsystemd-daemon -> libsystemd for newer systemd versions | 908 | # libsystemd-daemon -> libsystemd for newer systemd versions |
891 | sed -i 's#libsystemd-daemon#libsystemd#' ${S}/tools/configure | 909 | sed -i 's#libsystemd-daemon#libsystemd#' ${S}/tools/configure |
910 | |||
911 | # Improve build reproducibility: disable insertion of the build timestamp | ||
912 | # into the x86 EFI hypervisor binary. | ||
913 | # binutils should allow a user-supplied timestamp or use SOURCE_DATE_EPOCH | ||
914 | # for PE but currently does not. | ||
915 | if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ] ; then | ||
916 | sed '/^EFI_LDFLAGS = /{a EFI_LDFLAGS += --no-insert-timestamp | ||
917 | }' -i "${S}/xen/arch/x86/Makefile" | ||
918 | fi | ||
892 | } | 919 | } |
893 | 920 | ||
894 | addtask post_patch after do_patch before do_configure | 921 | addtask post_patch after do_patch before do_configure |