Source: tomsfastmath
Version: 0.13-2
Severity: wishlist
Tags: patch upstream
User: reproducible-bui...@lists.alioth.debian.org
Usertags: fileordering
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that tomsfastmath could not be built reproducibly.
A 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/reproducible-build.patch b/debian/patches/reproducible-build.patch
new file mode 100644
index 0000000..9537d06
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,14 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Sort object files for deterministic linking order
+
+--- a/makefile.shared
++++ b/makefile.shared
+@@ -88,7 +88,7 @@
+ 	$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
+ 
+ $(LIBNAME): $(OBJECTS)
+-	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) `find . -type f | grep "[.]lo" | xargs` -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) -export-symbols libtfm.symbols
++	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) `find . -type f | LC_ALL=C sort | grep "[.]lo" | xargs` -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) -export-symbols libtfm.symbols
+ 
+ install: $(LIBNAME)
+ 	install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
diff --git a/debian/patches/series b/debian/patches/series
index bd25769..60e9c1d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 tfm-make-a-few-functions-static.patch
 tfm-remove--siltent-argument.patch
+reproducible-build.patch

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Pkg-clamav-devel mailing list
Pkg-clamav-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-clamav-devel

Reply via email to