Sort the object list passed to ar in the Makefile. (#399)

This makes builds reproducible.
This commit is contained in:
Pier Angelo Vendrame 2023-03-03 18:29:24 +01:00 committed by GitHub
parent 7069071858
commit 2e3947b670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -488,13 +488,13 @@ $(SYSROOT_LIB)/libwasi-emulated-signal.a: $(LIBWASI_EMULATED_SIGNAL_OBJS) $(LIBW
%.a:
@mkdir -p "$(@D)"
# On Windows, the commandline for the ar invocation got too long, so it needs to be split up.
$(AR) crs $@ $(wordlist 1, 199, $^)
$(AR) crs $@ $(wordlist 200, 399, $^)
$(AR) crs $@ $(wordlist 400, 599, $^)
$(AR) crs $@ $(wordlist 600, 799, $^)
$(AR) crs $@ $(wordlist 1, 199, $(sort $^))
$(AR) crs $@ $(wordlist 200, 399, $(sort $^))
$(AR) crs $@ $(wordlist 400, 599, $(sort $^))
$(AR) crs $@ $(wordlist 600, 799, $(sort $^))
# This might eventually overflow again, but at least it'll do so in a loud way instead of
# silently dropping the tail.
$(AR) crs $@ $(wordlist 800, 100000, $^)
$(AR) crs $@ $(wordlist 800, 100000, $(sort $^))
$(MUSL_PRINTSCAN_OBJS): CFLAGS += \
-D__wasilibc_printscan_no_long_double \