blob: e0aca0dcfc1059b6ec0d22aa970a534a12872690 [file] [log] [blame]
Patrick Williams93c203f2021-10-06 16:15:23 -05001From: Reiner Herrmann <reiner@reiner-h.de>
2Date: Tue, 10 Oct 2017 15:06:13 -0300
3Subject: lib/mkmf.rb: sort list of object files in generated Makefile
4
5Without sorting the list explicitly, its order is indeterministic,
6because readdir() is also not deterministic.
7When the list of object files varies between builds, they are linked
8in a different order, which results in an unreproducible build.
9
10Upstream-Status: Backport [debian]
11
12Signed-off-by: Antonio Terceiro <terceiro@debian.org>
13Signed-off-by: Reiner Herrmann <reiner@reiner-h.de>
14---
15 lib/mkmf.rb | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18--- a/lib/mkmf.rb
19+++ b/lib/mkmf.rb
20@@ -2315,7 +2315,7 @@
21 LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
22 ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
23 SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
24-OBJS = #{$objs.join(" ")}
25+OBJS = #{$objs.sort.join(" ")}
26 HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
27 LOCAL_HDRS = #{$headers.join(' ')}
28 TARGET = #{target}