Source: masscan
Version: 2:1.0.3-104-g676635d~ds0-1
Severity: wishlist
Tags: patch upstream
User: [email protected]
Usertags: fileordering
X-Debbugs-Cc: [email protected]

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that masscan could not be built reproducibly.
It links objects in non-deterministic order.

The attached patch fixes this by sorting the list of source files.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/0002-reproducible-build.patch b/debian/patches/0002-reproducible-build.patch
new file mode 100644
index 0000000..cccfb20
--- /dev/null
+++ b/debian/patches/0002-reproducible-build.patch
@@ -0,0 +1,14 @@
+Author: Reiner Herrmann <[email protected]>
+Description: Sort source files for deterministic linking order
+
+--- a/Makefile
++++ b/Makefile
+@@ -87,7 +87,7 @@
+ 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
+ 
+ 
+-SRC = $(wildcard src/*.c)
++SRC = $(sort $(wildcard src/*.c))
+ OBJ = $(addprefix tmp/, $(notdir $(addsuffix .o, $(basename $(SRC))))) 
+ 
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b5c7eee..6ebcf90 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-buildsystem.patch
+0002-reproducible-build.patch

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Reproducible-builds mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to