Skip to content

Commit 2e3947b

Browse files
authored
Sort the object list passed to ar in the Makefile. (WebAssembly#399)
This makes builds reproducible.
1 parent 7069071 commit 2e3947b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,13 @@ $(SYSROOT_LIB)/libwasi-emulated-signal.a: $(LIBWASI_EMULATED_SIGNAL_OBJS) $(LIBW
488488
%.a:
489489
@mkdir -p "$(@D)"
490490
# On Windows, the commandline for the ar invocation got too long, so it needs to be split up.
491-
$(AR) crs $@ $(wordlist 1, 199, $^)
492-
$(AR) crs $@ $(wordlist 200, 399, $^)
493-
$(AR) crs $@ $(wordlist 400, 599, $^)
494-
$(AR) crs $@ $(wordlist 600, 799, $^)
491+
$(AR) crs $@ $(wordlist 1, 199, $(sort $^))
492+
$(AR) crs $@ $(wordlist 200, 399, $(sort $^))
493+
$(AR) crs $@ $(wordlist 400, 599, $(sort $^))
494+
$(AR) crs $@ $(wordlist 600, 799, $(sort $^))
495495
# This might eventually overflow again, but at least it'll do so in a loud way instead of
496496
# silently dropping the tail.
497-
$(AR) crs $@ $(wordlist 800, 100000, $^)
497+
$(AR) crs $@ $(wordlist 800, 100000, $(sort $^))
498498

499499
$(MUSL_PRINTSCAN_OBJS): CFLAGS += \
500500
-D__wasilibc_printscan_no_long_double \

0 commit comments

Comments
 (0)