diff mbox series

mk/lib.mk: Sort wildcard expansion for determinism

Message ID 1fa1c796f925bae086f1a6d6ab94c21432419628.camel@linuxfoundation.org
State Accepted
Headers show
Series mk/lib.mk: Sort wildcard expansion for determinism | expand

Commit Message

Richard Purdie March 2, 2021, 1:44 p.m. UTC
The order of the objects linked into libltp.a varies depending on the
order of the files found on disk. This results in most ltp binaries
differing depending on that order too.

Sort the wildcard expansion of *.c which leads to reproducible binaries.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Comments

Cyril Hrubis March 2, 2021, 2:21 p.m. UTC | #1
Hi!
Pushed, thanks.
diff mbox series

Patch

Index: git/include/mk/lib.mk
===================================================================
--- git.orig/include/mk/lib.mk
+++ git/include/mk/lib.mk
@@ -50,6 +50,7 @@  endif
 MAKE_TARGETS	+= $(LIB)
 
 LIBSRCS		?= $(wildcard $(abs_srcdir)/*.c)
+LIBSRCS		:= $(sort $(LIBSRCS))
 LIBSRCS		:= $(abspath $(LIBSRCS))
 LIBSRCS		:= $(subst $(abs_srcdir)/,,$(wildcard $(LIBSRCS)))
 LIBSRCS		:= $(filter-out $(FILTER_OUT_LIBSRCS),$(LIBSRCS))