Package: xpdf
Version: 3.04-1
Severity: wishlist
Tags: patch
Usertags: fileordering


While working on the "reproducible builds" effort [1], we have noticed
that xpdf could not be built reproducibly.
The linking step in the 'override_dh_auto_build' rules target uses a
file ordering based on wildcards alone, which results in different
binaries for different file orderings.

The attached patch fixes this by making sure objects are linked in sorted
order. Once applied, xpdf can be built reproducibly in our current
experimental framework.

Best regards,

diff -Nru xpdf-3.04/debian/rules xpdf-3.04/debian/rules
--- xpdf-3.04/debian/rules	2016-02-07 17:59:57.000000000 +0000
+++ xpdf-3.04/debian/rules	2016-03-27 11:21:10.000000000 +0000
@@ -14,8 +14,8 @@
 files+=xpdf/XPDFApp xpdf/XPDFCore xpdf/XPDFTree xpdf/XPDFViewer xpdf/xpdf
 headers=xpdf/config.h xpdf/XPDFTreeP.h xpdf/about-text.h xpdf/*.xbm xpdf/xpdfIcon.xpm
-sources=$(shell for file in $(files); do echo $$file.*; done)
-objects=$(shell for file in $(files); do echo build/$$(basename $$file).o; done)
+sources=$(sort $(shell for file in $(files); do echo $$file.*; done))
+objects=$(sort $(shell for file in $(files); do echo build/$$(basename $$file).o; done))
@@ -30,7 +30,7 @@
 	mv build/parseargs.c build/
 override_dh_auto_build: $(objects)
-	$(CXX) $(LDFLAGS) -o build/xpdf.real build/*.o $(LIBS)
+	$(CXX) $(LDFLAGS) -o build/xpdf.real $^ $(LIBS)
 	dh ${@}
Reproducible-builds mailing list

Reply via email to