From e49e86bd3199f51ada8a4a1d51aa8d627645279e Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Sat, 27 Feb 2021 23:42:03 +0000
Subject: [PATCH] Fix reproducibility issues

In order to build deterministic binaries, we need to sort the wildcard expansion
so the libraries are linked in the same order each time. This fixes reproducibility
issues within syslinux builds.

Upstream-Status: Inactive-Upstream
RP 2021/3/1

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 mk/lib.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mk/lib.mk b/mk/lib.mk
index f3fb07c..815698c 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -130,8 +130,8 @@ LIBENTRY_OBJS = \
 	exit.o
 
 LIBGCC_OBJS = \
-	  $(patsubst $(com32)/lib/%.c,%.o,$(wildcard $(com32)/lib/$(ARCH)/libgcc/*.c)) \
-	  $(patsubst $(com32)/lib/%.S,%.o,$(wildcard $(com32)/lib/$(ARCH)/libgcc/*.S))
+	  $(sort $(patsubst $(com32)/lib/%.c,%.o,$(wildcard $(com32)/lib/$(ARCH)/libgcc/*.c))) \
+	  $(sort $(patsubst $(com32)/lib/%.S,%.o,$(wildcard $(com32)/lib/$(ARCH)/libgcc/*.S)))
 
 LIBCONSOLE_OBJS = \
 	\
