summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/determinism.patch
blob: 76d40721b87dc826b7e934902d2f0ea5e1259234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
open_posix_testsuite/generate-makefiles.sh: Fix determinism issue

Currently the list of tests is generated by the order of the files found
within the directories. This results in differences in the run.sh and 
Makefiles. Within Yocto Project this results in differing target
test packages. The fix is simple, just sort the output from locate-test.

mk/lib.mk: Sort wildcard expansion for determinism

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>
Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2021-March/021272.html http://lists.linux.it/pipermail/ltp/2021-March/021273.html]

Index: git/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
===================================================================
--- git.orig/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
+++ git/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
@@ -24,7 +24,7 @@ generate_locate_test_makefile() {
 
 	echo "Generating $maketype Makefiles"
 
-	locate-test --$maketype | sed -e 's,^./,,g' > make-gen.$maketype
+	locate-test --$maketype | sed -e 's,^./,,g' | sort > make-gen.$maketype
 
 	generate_makefiles make-gen.$maketype $*
 
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))