From: Luca Boccassi Date: Sat, 24 Jun 2017 14:13:55 +0000 (+0100) Subject: Add new patches to make build fully reproducible X-Git-Url: https://gerrit.fd.io/r/gitweb?p=deb_dpdk.git;a=commitdiff_plain;h=146be0ebc2d0e889d7123bdd7ef277216b9ded8e Add new patches to make build fully reproducible Change-Id: Ic9012604e9bf5e9da22f9eb7a96b6ecb3bfb2ff1 Signed-off-by: Luca Boccassi --- diff --git a/debian/patches/mk-always-rebuild-in-the-same-order.patch b/debian/patches/mk-always-rebuild-in-the-same-order.patch new file mode 100644 index 00000000..6863ec1f --- /dev/null +++ b/debian/patches/mk-always-rebuild-in-the-same-order.patch @@ -0,0 +1,54 @@ +Description: mk: always rebuild in the same order + +In order to achieve reproducible builds, always check dependencies in +the same order. + +Origin: http://dpdk.org/dev/patchwork/patch/25679/ +Forwarded: yes +Author: Luca Boccassi +Last-Update: 2017-06-24 +--- + mk/internal/rte.compile-pre.mk | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk +index da8dda498..5d519100c 100644 +--- a/mk/internal/rte.compile-pre.mk ++++ b/mk/internal/rte.compile-pre.mk +@@ -108,13 +108,13 @@ C_TO_O_DO = @set -e; \ + compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1))) + + # return a non-empty string if the dst file does not exist +-file_missing = $(call compare,$(wildcard $@),$@) ++file_missing = $(call compare,$(sort $(wildcard $@)),$@) + + # return a non-empty string if cmdline changed + cmdline_changed = $(call compare,$(strip $(cmd_$@)),$(strip $(1))) + + # return a non-empty string if a dependency file does not exist +-depfile_missing = $(call compare,$(wildcard $(dep_$@)),$(dep_$@)) ++depfile_missing = $(call compare,$(sort $(wildcard $(dep_$@))),$(dep_$@)) + + # return an empty string if no prereq is newer than target + # - $^ -> names of all the prerequisites +@@ -123,7 +123,7 @@ depfile_missing = $(call compare,$(wildcard $(dep_$@)),$(dep_$@)) + # exist (filter-out removes existing ones from the list) + # - $? -> names of all the prerequisites newer than target + depfile_newer = $(strip $(filter-out FORCE,$? \ +- $(filter-out $(wildcard $^),$^))) ++ $(filter-out $(sort $(wildcard $^)),$^))) + + # return 1 if parameter is a non-empty string, else 0 + boolean = $(if $1,1,0) +@@ -134,7 +134,7 @@ boolean = $(if $1,1,0) + # user (by default it is empty) + # + .SECONDEXPANSION: +-%.o: %.c $$(wildcard $$(dep_$$@)) $$(DEP_$$(@)) FORCE ++%.o: %.c $$(sort $$(wildcard $$(dep_$$@))) $$(DEP_$$(@)) FORCE + @[ -d $(dir $@) ] || mkdir -p $(dir $@) + $(if $(D),\ + @echo -n "$< -> $@ " ; \ +-- +2.11.0 + diff --git a/debian/patches/mk-fix-excluding-.doctrees-when-installing-docs.patch b/debian/patches/mk-fix-excluding-.doctrees-when-installing-docs.patch index b658d263..dee74770 100644 --- a/debian/patches/mk-fix-excluding-.doctrees-when-installing-docs.patch +++ b/debian/patches/mk-fix-excluding-.doctrees-when-installing-docs.patch @@ -4,10 +4,10 @@ The --exclude parameter must be passed before the input directory to tar, otherwise it's silently ignored and the .doctrees directory is installed by make install-doc. -Origin: http://dpdk.org/dev/patchwork/patch/25632/ +Origin: http://dpdk.org/dev/patchwork/patch/25674/ Forwarded: yes Author: Luca Boccassi -Last-Update: 2017-06-22 +Last-Update: 2017-06-24 --- mk/rte.sdkinstall.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/mk-sort-headers-before-wildcard-inclusion.patch b/debian/patches/mk-sort-headers-before-wildcard-inclusion.patch new file mode 100644 index 00000000..de6624de --- /dev/null +++ b/debian/patches/mk-sort-headers-before-wildcard-inclusion.patch @@ -0,0 +1,72 @@ +Description: mk: sort headers before wildcard inclusion + +In order to achieve fully reproducible builds, always use the same +inclusion order for headers in the Makefiles. + +Origin: http://dpdk.org/dev/patchwork/patch/25677/ +Forwarded: yes +Author: Luca Boccassi +Last-Update: 2017-06-24 +--- + examples/ip_pipeline/Makefile | 2 +- + examples/multi_process/client_server_mp/mp_server/Makefile | 2 +- + examples/server_node_efd/server/Makefile | 2 +- + lib/librte_eal/common/Makefile | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile +index dc7e0ddd7..12ce0a1d5 100644 +--- a/examples/ip_pipeline/Makefile ++++ b/examples/ip_pipeline/Makefile +@@ -43,7 +43,7 @@ APP = ip_pipeline + + VPATH += $(SRCDIR)/pipeline + +-INC += $(wildcard *.h) $(wildcard pipeline/*.h) ++INC += $(sort $(wildcard *.h)) $(sort $(wildcard pipeline/*.h)) + + # all source are stored in SRCS-y + SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := main.c +diff --git a/examples/multi_process/client_server_mp/mp_server/Makefile b/examples/multi_process/client_server_mp/mp_server/Makefile +index 5552999b5..160c17b68 100644 +--- a/examples/multi_process/client_server_mp/mp_server/Makefile ++++ b/examples/multi_process/client_server_mp/mp_server/Makefile +@@ -49,7 +49,7 @@ APP = mp_server + # all source are stored in SRCS-y + SRCS-y := main.c init.c args.c + +-INC := $(wildcard *.h) ++INC := $(sort $(wildcard *.h)) + + CFLAGS += $(WERROR_FLAGS) -O3 + CFLAGS += -I$(SRCDIR)/../shared +diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile +index a2f2f361b..9f1fe2894 100644 +--- a/examples/server_node_efd/server/Makefile ++++ b/examples/server_node_efd/server/Makefile +@@ -49,7 +49,7 @@ APP = server + # all source are stored in SRCS-y + SRCS-y := main.c init.c args.c + +-INC := $(wildcard *.h) ++INC := $(sort $(wildcard *.h)) + + CFLAGS += $(WERROR_FLAGS) -O3 + CFLAGS += -I$(SRCDIR)/../shared +diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile +index a5bd1089a..4b712600a 100644 +--- a/lib/librte_eal/common/Makefile ++++ b/lib/librte_eal/common/Makefile +@@ -48,7 +48,7 @@ GENERIC_INC += rte_vect.h rte_io.h + + # defined in mk/arch/$(RTE_ARCH)/rte.vars.mk + ARCH_DIR ?= $(RTE_ARCH) +-ARCH_INC := $(notdir $(wildcard $(RTE_SDK)/lib/librte_eal/common/include/arch/$(ARCH_DIR)/*.h)) ++ARCH_INC := $(sort $(notdir $(wildcard $(RTE_SDK)/lib/librte_eal/common/include/arch/$(ARCH_DIR)/*.h))) + + SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC)) + SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include += \ +-- +2.11.0 + + diff --git a/debian/patches/mk-sort-list-of-files-in-examples.dox.patch b/debian/patches/mk-sort-list-of-files-in-examples.dox.patch index afe1b199..c8f809b8 100644 --- a/debian/patches/mk-sort-list-of-files-in-examples.dox.patch +++ b/debian/patches/mk-sort-list-of-files-in-examples.dox.patch @@ -5,10 +5,10 @@ conditions. Pipe it through LC_ALL=C sort to ensure reproducible results when generating examples.dox. -Origin: http://dpdk.org/dev/patchwork/patch/25634/ +Origin: http://dpdk.org/dev/patchwork/patch/25676/ Forwarded: yes Author: Luca Boccassi -Last-Update: 2017-06-22 +Last-Update: 2017-06-24 --- mk/rte.sdkdoc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/mk-sort-list-of-shared-objects-in-linker-script.patch b/debian/patches/mk-sort-list-of-shared-objects-in-linker-script.patch index 52e6b5a5..12a0779f 100644 --- a/debian/patches/mk-sort-list-of-shared-objects-in-linker-script.patch +++ b/debian/patches/mk-sort-list-of-shared-objects-in-linker-script.patch @@ -6,10 +6,10 @@ This means the content libdpdk.so linker script might change between builds from the same sources. Run the list through sort to ensure reproducibility. -Origin: http://dpdk.org/dev/patchwork/patch/25633/ +Origin: http://dpdk.org/dev/patchwork/patch/25675/ Forwarded: yes Author: Luca Boccassi -Last-Update: 2017-06-22 +Last-Update: 2017-06-24 --- mk/rte.combinedlib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/mk-sort-object-files-when-building-deps-lists.patch b/debian/patches/mk-sort-object-files-when-building-deps-lists.patch new file mode 100644 index 00000000..d727954d --- /dev/null +++ b/debian/patches/mk-sort-object-files-when-building-deps-lists.patch @@ -0,0 +1,64 @@ +Description: mk: sort object files when building deps lists + +In order to achieve reproducible builds, always use the same +order when listing object files to build dependencies lists. + +Origin: http://dpdk.org/dev/patchwork/patch/25680/ +Forwarded: yes +Author: Luca Boccassi +Last-Update: 2017-06-24 +--- + mk/rte.app.mk | 4 ++-- + mk/rte.hostapp.mk | 4 ++-- + mk/rte.shared.mk | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/mk/rte.app.mk b/mk/rte.app.mk +index bcaf1b382..54134dea4 100644 +--- a/mk/rte.app.mk ++++ b/mk/rte.app.mk +@@ -263,8 +263,8 @@ LDLIBS_NAMES += $(patsubst -Wl$(comma)-l%,lib%.a,$(filter -Wl$(comma)-l%,$(LDLIB + + # list of found libraries files (useful for deps). If not found, the + # library is silently ignored and dep won't be checked +-LDLIBS_FILES := $(wildcard $(foreach dir,$(LDLIBS_PATH),\ +- $(addprefix $(dir)/,$(LDLIBS_NAMES)))) ++LDLIBS_FILES := $(sort $(wildcard $(foreach dir,$(LDLIBS_PATH),\ ++ $(addprefix $(dir)/,$(LDLIBS_NAMES))))) + + # + # Compile executable file if needed +diff --git a/mk/rte.hostapp.mk b/mk/rte.hostapp.mk +index 5cb4909cb..f58173c31 100644 +--- a/mk/rte.hostapp.mk ++++ b/mk/rte.hostapp.mk +@@ -69,9 +69,9 @@ O_TO_EXE_DO = @set -e; \ + -include .$(HOSTAPP).cmd + + # list of .a files that are linked to this application +-LDLIBS_FILES := $(wildcard \ ++LDLIBS_FILES := $(sort $(wildcard \ + $(addprefix $(RTE_OUTPUT)/lib/, \ +- $(patsubst -l%,lib%.a,$(filter -l%,$(LDLIBS))))) ++ $(patsubst -l%,lib%.a,$(filter -l%,$(LDLIBS)))))) + + # + # Compile executable file if needed +diff --git a/mk/rte.shared.mk b/mk/rte.shared.mk +index 87ccf0ba4..4e680bc03 100644 +--- a/mk/rte.shared.mk ++++ b/mk/rte.shared.mk +@@ -85,8 +85,8 @@ LDLIBS_NAMES += $(patsubst -Wl$(comma)-l%,lib%.a,$(filter -Wl$(comma)-l%,$(LDLIB + + # list of found libraries files (useful for deps). If not found, the + # library is silently ignored and dep won't be checked +-LDLIBS_FILES := $(wildcard $(foreach dir,$(LDLIBS_PATH),\ +- $(addprefix $(dir)/,$(LDLIBS_NAMES)))) ++LDLIBS_FILES := $(sort $(wildcard $(foreach dir,$(LDLIBS_PATH),\ ++ $(addprefix $(dir)/,$(LDLIBS_NAMES))))) + + # + # Archive objects in .so file if needed +-- +2.11.0 + diff --git a/debian/patches/mk-sort-source-files-before-passing-them-to-the-comp.patch b/debian/patches/mk-sort-source-files-before-passing-them-to-the-comp.patch new file mode 100644 index 00000000..0fb0bad8 --- /dev/null +++ b/debian/patches/mk-sort-source-files-before-passing-them-to-the-comp.patch @@ -0,0 +1,127 @@ +Description: mk: sort source files before passing them to the compiler + +In order to achieve reproducible builds, always use the same +order when listing files for compilation. + +Origin: http://dpdk.org/dev/patchwork/patch/25678/ +Forwarded: yes +Author: Luca Boccassi +Last-Update: 2017-06-24 +--- + drivers/net/cxgbe/Makefile | 2 +- + drivers/net/e1000/Makefile | 2 +- + drivers/net/fm10k/Makefile | 2 +- + drivers/net/i40e/Makefile | 2 +- + drivers/net/ixgbe/Makefile | 2 +- + drivers/net/qede/Makefile | 2 +- + drivers/net/sfc/Makefile | 2 +- + drivers/net/thunderx/Makefile | 2 +- + 8 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/cxgbe/Makefile b/drivers/net/cxgbe/Makefile +index 7cef6279c..b4666b5af 100644 +--- a/drivers/net/cxgbe/Makefile ++++ b/drivers/net/cxgbe/Makefile +@@ -67,7 +67,7 @@ endif + # Add extra flags for base driver files (also known as shared code) + # to disable warnings in them + # +-BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile +index ffdf36d37..59d96bca1 100644 +--- a/drivers/net/e1000/Makefile ++++ b/drivers/net/e1000/Makefile +@@ -68,7 +68,7 @@ endif + # Add extra flags for base driver files (also known as shared code) + # to disable warnings in them + # +-BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile +index e0024f052..0bc124eb1 100644 +--- a/drivers/net/fm10k/Makefile ++++ b/drivers/net/fm10k/Makefile +@@ -80,7 +80,7 @@ endif + # + # Add extra flags for base driver source files to disable warnings in them + # +-BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile +index 56f210d6d..06eedc592 100644 +--- a/drivers/net/i40e/Makefile ++++ b/drivers/net/i40e/Makefile +@@ -78,7 +78,7 @@ endif + + CFLAGS_i40e_lan_hmc.o += -Wno-error + endif +-OBJS_BASE_DRIVER=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++OBJS_BASE_DRIVER=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(OBJS_BASE_DRIVER), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile +index 6a651b923..f5c370ce5 100644 +--- a/drivers/net/ixgbe/Makefile ++++ b/drivers/net/ixgbe/Makefile +@@ -87,7 +87,7 @@ endif + # Add extra flags for base driver files (also known as shared code) + # to disable warnings in them + # +-BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile +index f03441d9a..83ff95474 100644 +--- a/drivers/net/qede/Makefile ++++ b/drivers/net/qede/Makefile +@@ -78,7 +78,7 @@ endif + # to disable warnings in them + # + # +-BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +diff --git a/drivers/net/sfc/Makefile b/drivers/net/sfc/Makefile +index 57aa963ba..8cfd14d45 100644 +--- a/drivers/net/sfc/Makefile ++++ b/drivers/net/sfc/Makefile +@@ -71,7 +71,7 @@ endif + # List of base driver object files for which + # special CFLAGS above should be applied + # +-BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(BASE_DRIVER_OBJS), \ + $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + +diff --git a/drivers/net/thunderx/Makefile b/drivers/net/thunderx/Makefile +index 706250b8b..ac384a624 100644 +--- a/drivers/net/thunderx/Makefile ++++ b/drivers/net/thunderx/Makefile +@@ -45,7 +45,7 @@ EXPORT_MAP := rte_pmd_thunderx_nicvf_version.map + + LIBABIVER := 1 + +-OBJS_BASE_DRIVER=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) ++OBJS_BASE_DRIVER=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))) + $(foreach obj, $(OBJS_BASE_DRIVER), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + + VPATH += $(SRCDIR)/base +-- +2.11.0 + diff --git a/debian/patches/mk-use-make-silent-flag-to-print-HTML-doc-version.patch b/debian/patches/mk-use-make-silent-flag-to-print-HTML-doc-version.patch index 14a86886..35d0bac5 100644 --- a/debian/patches/mk-use-make-silent-flag-to-print-HTML-doc-version.patch +++ b/debian/patches/mk-use-make-silent-flag-to-print-HTML-doc-version.patch @@ -10,10 +10,10 @@ piped to doxygen. This causes the following to be written: Use -s (--silent) to prevent echoing. -Origin: http://dpdk.org/dev/patchwork/patch/25631/ +Origin: http://dpdk.org/dev/patchwork/patch/25673/ Forwarded: yes Author: Luca Boccassi -Last-Update: 2017-06-22 +Last-Update: 2017-06-24 --- mk/rte.sdkdoc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/patches/series b/debian/patches/series index 78e2ae16..533860f7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,7 @@ mk-use-make-silent-flag-to-print-HTML-doc-version.patch mk-fix-excluding-.doctrees-when-installing-docs.patch mk-sort-list-of-shared-objects-in-linker-script.patch mk-sort-list-of-files-in-examples.dox.patch +mk-sort-headers-before-wildcard-inclusion.patch +mk-sort-source-files-before-passing-them-to-the-comp.patch +mk-sort-object-files-when-building-deps-lists.patch +mk-always-rebuild-in-the-same-order.patch