svn commit: r305160 - in head/sys/boot/efi: boot1 loader

Ed Maste emaste at FreeBSD.org
Wed Aug 31 21:35:39 UTC 2016


Author: emaste
Date: Wed Aug 31 21:35:38 2016
New Revision: 305160
URL: https://svnweb.freebsd.org/changeset/base/305160

Log:
  Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds
  
  Reviewed by:	rpokala
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D7633

Modified:
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/loader/Makefile

Modified: head/sys/boot/efi/boot1/Makefile
==============================================================================
--- head/sys/boot/efi/boot1/Makefile	Wed Aug 31 21:35:12 2016	(r305159)
+++ head/sys/boot/efi/boot1/Makefile	Wed Aug 31 21:35:38 2016	(r305160)
@@ -89,11 +89,15 @@ EFI_TARGET=	efi-app-ia32
 EFI_TARGET=	binary
 .endif
 
+# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00
+# for build reproducibility.
+SOURCE_DATE_EPOCH?=1451606400
 boot1.efi: ${PROG}
 	if ${NM} ${.ALLSRC} | grep ' U '; then \
 		echo "Undefined symbols in ${.ALLSRC}"; \
 		exit 1; \
 	fi
+	SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
 	${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
 		-j .dynamic -j .dynsym -j .rel.dyn \
 		-j .rela.dyn -j .reloc -j .eh_frame \

Modified: head/sys/boot/efi/loader/Makefile
==============================================================================
--- head/sys/boot/efi/loader/Makefile	Wed Aug 31 21:35:12 2016	(r305159)
+++ head/sys/boot/efi/loader/Makefile	Wed Aug 31 21:35:38 2016	(r305160)
@@ -131,11 +131,15 @@ EFI_TARGET=	efi-app-ia32
 EFI_TARGET=	binary
 .endif
 
+# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00
+# for build reproducibility.
+SOURCE_DATE_EPOCH?=1451606400
 loader.efi: ${PROG}
 	if ${NM} ${.ALLSRC} | grep ' U '; then \
 		echo "Undefined symbols in ${.ALLSRC}"; \
 		exit 1; \
 	fi
+	SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
 	${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
 		-j .dynamic -j .dynsym -j .rel.dyn \
 		-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \


More information about the svn-src-all mailing list