Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame^] | 1 | From: Reiner Herrmann <reiner@reiner-h.de> |
| 2 | Date: Tue, 10 Oct 2017 15:06:13 -0300 |
| 3 | Subject: lib/mkmf.rb: sort list of object files in generated Makefile |
| 4 | |
| 5 | Without sorting the list explicitly, its order is indeterministic, |
| 6 | because readdir() is also not deterministic. |
| 7 | When the list of object files varies between builds, they are linked |
| 8 | in a different order, which results in an unreproducible build. |
| 9 | |
| 10 | Upstream-Status: Backport [debian] |
| 11 | |
| 12 | Signed-off-by: Antonio Terceiro <terceiro@debian.org> |
| 13 | Signed-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} |