Add new patches to make build fully reproducible 55/7355/1
authorLuca Boccassi <luca.boccassi@gmail.com>
Sat, 24 Jun 2017 14:13:55 +0000 (15:13 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 29 Jun 2017 15:42:42 +0000 (16:42 +0100)
Change-Id: Ic9012604e9bf5e9da22f9eb7a96b6ecb3bfb2ff1
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
debian/patches/mk-always-rebuild-in-the-same-order.patch [new file with mode: 0644]
debian/patches/mk-fix-excluding-.doctrees-when-installing-docs.patch
debian/patches/mk-sort-headers-before-wildcard-inclusion.patch [new file with mode: 0644]
debian/patches/mk-sort-list-of-shared-objects-in-linker-script.patch
debian/patches/mk-sort-object-files-when-building-deps-lists.patch [new file with mode: 0644]
debian/patches/mk-sort-source-files-before-passing-them-to-the-comp.patch [new file with mode: 0644]
debian/patches/mk-use-make-silent-flag-to-print-HTML-doc-version.patch
debian/patches/series

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 (file)
index 0000000..6863ec1
--- /dev/null
@@ -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 <luca.boccassi@gmail.com>
+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
+
index b658d26..dee7477 100644 (file)
@@ -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 <luca.boccassi@gmail.com>
-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 (file)
index 0000000..6768686
--- /dev/null
@@ -0,0 +1,49 @@
+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 <luca.boccassi@gmail.com>
+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(-)
+
+--- a/examples/ip_pipeline/Makefile
++++ b/examples/ip_pipeline/Makefile
+@@ -45,7 +45,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
+--- 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
+--- a/lib/librte_eal/common/Makefile
++++ b/lib/librte_eal/common/Makefile
+@@ -50,7 +50,7 @@ GENERIC_INC := rte_atomic.h rte_byteorde
+ GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h rte_rwlock.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 += \
index 52e6b5a..06bf1b0 100644 (file)
@@ -6,16 +6,14 @@ 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 <luca.boccassi@gmail.com>
-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/mk/rte.combinedlib.mk b/mk/rte.combinedlib.mk
-index 449358b33..2ab7ee8a1 100644
 --- a/mk/rte.combinedlib.mk
 +++ b/mk/rte.combinedlib.mk
 @@ -42,7 +42,7 @@ endif
@@ -27,6 +25,3 @@ index 449358b33..2ab7ee8a1 100644
  
  all: FORCE
        $(Q)echo "GROUP ( $(LIBS) )" > $(RTE_OUTPUT)/lib/$(COMBINEDLIB)
--- 
-2.11.0
-
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 (file)
index 0000000..d727954
--- /dev/null
@@ -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 <luca.boccassi@gmail.com>
+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 (file)
index 0000000..967001a
--- /dev/null
@@ -0,0 +1,97 @@
+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 <luca.boccassi@gmail.com>
+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(-)
+
+--- 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
+--- a/drivers/net/e1000/Makefile
++++ b/drivers/net/e1000/Makefile
+@@ -65,7 +65,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
+--- a/drivers/net/fm10k/Makefile
++++ b/drivers/net/fm10k/Makefile
+@@ -77,7 +77,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
+--- 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
+--- a/drivers/net/ixgbe/Makefile
++++ b/drivers/net/ixgbe/Makefile
+@@ -84,7 +84,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
+--- a/drivers/net/qede/Makefile
++++ b/drivers/net/qede/Makefile
+@@ -75,7 +75,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+=$(CFLAGS_BASE_DRIVER)))
+ #
+--- a/drivers/net/thunderx/Makefile
++++ b/drivers/net/thunderx/Makefile
+@@ -45,7 +45,7 @@ EXPORT_MAP := rte_pmd_thunderx_nicvf_ver
+ 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
index c7bdfb4..77a248b 100644 (file)
@@ -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 <luca.boccassi@gmail.com>
-Last-Update: 2017-06-22
+Last-Update: 2017-06-24
 ---
  mk/rte.sdkdoc.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
index ad293f6..b9f49f8 100644 (file)
@@ -13,3 +13,7 @@ igb_uio-switch-to-new-irq-function-for-MSI-X.patch
 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-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