Without sorting the list explicitely, its order is indeterministic,
because readdir() is also not deterministic.
When the list of object files varies between builds, they are linked
in a different order, which results in an unreproducible build.
Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Signed-off-by: Reiner Herrmann <reiner@reiner-h.de>
Gbp-Pq: Name 0002-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
-OBJS = #{$objs.join(" ")}
+OBJS = #{$objs.sort.join(" ")}
HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
LOCAL_HDRS = #{$headers.join(' ')}
TARGET = #{target}