Source: hoichess
Version: 0.10.3-6.1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: fileordering
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that hoichess could not be built reproducibly.
The list of object files is unsorted, which causes a non-deterministic
linking order.

The attached patch fixes this.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/06-reproducible-build b/debian/patches/06-reproducible-build
new file mode 100644
index 0000000..d6e6e80
--- /dev/null
+++ b/debian/patches/06-reproducible-build
@@ -0,0 +1,13 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -35,8 +35,8 @@
+ OBJS_CHESS   = $(patsubst %.cc,%.o,$(SOURCES_CHESS))
+ OBJS_XIANGQI = $(patsubst %.cc,%.o,$(SOURCES_XIANGQI))
+ 
+-BUILDDIR_OBJS_CHESS   = $(foreach f,$(OBJS_COMMON) $(OBJS_CHESS),$(BUILDDIR_CHESS)/$(f))
+-BUILDDIR_OBJS_XIANGQI = $(foreach f,$(OBJS_COMMON) $(OBJS_XIANGQI),$(BUILDDIR_XIANGQI)/$(f))
++BUILDDIR_OBJS_CHESS   = $(sort $(foreach f,$(OBJS_COMMON) $(OBJS_CHESS),$(BUILDDIR_CHESS)/$(f)))
++BUILDDIR_OBJS_XIANGQI = $(sort $(foreach f,$(OBJS_COMMON) $(OBJS_XIANGQI),$(BUILDDIR_XIANGQI)/$(f)))
+ 
+ 
+ INCLUDE = -I.
diff --git a/debian/patches/series b/debian/patches/series
index bc6946b..4ba8907 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 03-config.h
 04-debug_printconfig.h
 05-ftbfs-gcc-4.7
+06-reproducible-build

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to