Skip to content

Commit 85b489c

Browse files
reinerhsorah
authored andcommitted
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 <terceiro@debian.org> Signed-off-by: Reiner Herrmann <reiner@reiner-h.de> Gbp-Pq: Name lib-mkmf.rb-sort-list-of-object-files-in-generated-Makefi.patch
1 parent 814426c commit 85b489c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mkmf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,7 @@ def create_makefile(target, srcprefix = nil)
24802480
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
24812481
ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
24822482
SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
2483-
OBJS = #{$objs.join(" ")}
2483+
OBJS = #{$objs.sort.join(" ")}
24842484
HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
24852485
LOCAL_HDRS = #{$headers.join(' ')}
24862486
TARGET = #{target}

0 commit comments

Comments
 (0)