From: Reiner Herrmann Date: Tue, 10 Oct 2017 18:06:13 +0000 (-0300) Subject: lib/mkmf.rb: sort list of object files in generated Makefile X-Git-Tag: archive/raspbian/2.5.0-6+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ca7ae72c59e8d4365b22a7ae9ef5e521be8e3174;p=ruby2.5.git lib/mkmf.rb: sort list of object files in generated Makefile 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 Signed-off-by: Reiner Herrmann Gbp-Pq: Name 0002-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch --- diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 7f53bb4..7219ab9 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2283,7 +2283,7 @@ LOCAL_LIBS = #{$LOCAL_LIBS} 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}