summaryrefslogtreecommitdiffstats
path: root/debian/patches/07-reproducible-build.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/07-reproducible-build.patch')
-rw-r--r--debian/patches/07-reproducible-build.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/07-reproducible-build.patch b/debian/patches/07-reproducible-build.patch
new file mode 100644
index 0000000..c00d349
--- /dev/null
+++ b/debian/patches/07-reproducible-build.patch
@@ -0,0 +1,37 @@
+Author: Reiner Herrmann <reiner@reiner-h.de>
+Description: Sort lists of libraries/source/object files
+ for deterministic linking order
+
+--- a/Make.rules
++++ b/Make.rules
+@@ -136,8 +136,8 @@
+ _libs = $(strip $(foreach _lib,$(LIBDIRS),\
+ $(if $(filter lib%,$(_lib)),\
+ $(patsubst lib%,-l%,$(_lib)),\
+- $(wildcard $(srcdir)/$(_lib)/$(_lib).so \
+- $(srcdir)/$(_lib)/$(_lib).a))))
++ $(sort $(wildcard $(srcdir)/$(_lib)/$(_lib).so \
++ $(srcdir)/$(_lib)/$(_lib).a)))))
+
+ override LIBS := $(_libs) -lm $(LIBS)
+
+@@ -166,7 +166,7 @@
+ endif
+ endif
+
+-sources = $(wildcard *.c)
++sources = $(sort $(wildcard *.c))
+ OBJS = $(sources:.c=.$(obj))
+
+
+--- a/default.rules
++++ b/default.rules
+@@ -143,7 +143,7 @@
+ ifeq ($(filter $(TARGET),$(EXEDIRS)),$(TARGET))
+
+ ifeq ($(filter $(TARGET),$(MODUSERS)),$(TARGET))
+-MOD_OBJS = $(wildcard $(foreach dir,$(MODDIRS),$(srcdir)/$(dir)/*.o))
++MOD_OBJS = $(sort $(wildcard $(foreach dir,$(MODDIRS),$(srcdir)/$(dir)/*.o)))
+ ifeq ($(shared),yes)
+ override LDFLAGS := -rdynamic $(LDFLAGS)
+ endif