From 2e3947b6701978ae443f4c8d927dc0e00b3c67da Mon Sep 17 00:00:00 2001 From: Pier Angelo Vendrame Date: Fri, 3 Mar 2023 18:29:24 +0100 Subject: [PATCH] Sort the object list passed to ar in the Makefile. (#399) This makes builds reproducible. --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c31e3d7..f350ecb 100644 --- a/Makefile +++ b/Makefile @@ -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 \