diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/reproducible.py | 1 | ||||
-rw-r--r-- | meta/recipes-extended/ltp/ltp/determinism.patch | 43 | ||||
-rw-r--r-- | meta/recipes-extended/ltp/ltp_20210121.bb | 13 |
3 files changed, 56 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py index 1d4e744250..3d6a88314b 100644 --- a/meta/lib/oeqa/selftest/cases/reproducible.py +++ b/meta/lib/oeqa/selftest/cases/reproducible.py | |||
@@ -34,7 +34,6 @@ exclude_packages = [ | |||
34 | 'go-runtime', | 34 | 'go-runtime', |
35 | 'go_', | 35 | 'go_', |
36 | 'go-', | 36 | 'go-', |
37 | 'ltp', | ||
38 | 'meson', | 37 | 'meson', |
39 | 'ovmf-shell-efi', | 38 | 'ovmf-shell-efi', |
40 | 'perf', | 39 | 'perf', |
diff --git a/meta/recipes-extended/ltp/ltp/determinism.patch b/meta/recipes-extended/ltp/ltp/determinism.patch new file mode 100644 index 0000000000..76d40721b8 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/determinism.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | open_posix_testsuite/generate-makefiles.sh: Fix determinism issue | ||
2 | |||
3 | Currently the list of tests is generated by the order of the files found | ||
4 | within the directories. This results in differences in the run.sh and | ||
5 | Makefiles. Within Yocto Project this results in differing target | ||
6 | test packages. The fix is simple, just sort the output from locate-test. | ||
7 | |||
8 | mk/lib.mk: Sort wildcard expansion for determinism | ||
9 | |||
10 | The order of the objects linked into libltp.a varies depending on the | ||
11 | order of the files found on disk. This results in most ltp binaries | ||
12 | differing depending on that order too. | ||
13 | |||
14 | Sort the wildcard expansion of *.c which leads to reproducible binaries. | ||
15 | |||
16 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
17 | Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2021-March/021272.html http://lists.linux.it/pipermail/ltp/2021-March/021273.html] | ||
18 | |||
19 | Index: git/testcases/open_posix_testsuite/scripts/generate-makefiles.sh | ||
20 | =================================================================== | ||
21 | --- git.orig/testcases/open_posix_testsuite/scripts/generate-makefiles.sh | ||
22 | +++ git/testcases/open_posix_testsuite/scripts/generate-makefiles.sh | ||
23 | @@ -24,7 +24,7 @@ generate_locate_test_makefile() { | ||
24 | |||
25 | echo "Generating $maketype Makefiles" | ||
26 | |||
27 | - locate-test --$maketype | sed -e 's,^./,,g' > make-gen.$maketype | ||
28 | + locate-test --$maketype | sed -e 's,^./,,g' | sort > make-gen.$maketype | ||
29 | |||
30 | generate_makefiles make-gen.$maketype $* | ||
31 | |||
32 | Index: git/include/mk/lib.mk | ||
33 | =================================================================== | ||
34 | --- git.orig/include/mk/lib.mk | ||
35 | +++ git/include/mk/lib.mk | ||
36 | @@ -50,6 +50,7 @@ endif | ||
37 | MAKE_TARGETS += $(LIB) | ||
38 | |||
39 | LIBSRCS ?= $(wildcard $(abs_srcdir)/*.c) | ||
40 | +LIBSRCS := $(sort $(LIBSRCS)) | ||
41 | LIBSRCS := $(abspath $(LIBSRCS)) | ||
42 | LIBSRCS := $(subst $(abs_srcdir)/,,$(wildcard $(LIBSRCS))) | ||
43 | LIBSRCS := $(filter-out $(FILTER_OUT_LIBSRCS),$(LIBSRCS)) | ||
diff --git a/meta/recipes-extended/ltp/ltp_20210121.bb b/meta/recipes-extended/ltp/ltp_20210121.bb index c541f9859f..593f07087c 100644 --- a/meta/recipes-extended/ltp/ltp_20210121.bb +++ b/meta/recipes-extended/ltp/ltp_20210121.bb | |||
@@ -29,11 +29,16 @@ CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" | |||
29 | CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" | 29 | CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" |
30 | SRCREV = "4d005621edd109d119627eb9210b224a63bf22cb" | 30 | SRCREV = "4d005621edd109d119627eb9210b224a63bf22cb" |
31 | 31 | ||
32 | # remove at next version upgrade or when output changes | ||
33 | PR = "r1" | ||
34 | HASHEQUIV_HASH_VERSION .= ".1" | ||
35 | |||
32 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ | 36 | SRC_URI = "git://github.com/linux-test-project/ltp.git \ |
33 | file://0001-build-Add-option-to-select-libc-implementation.patch \ | 37 | file://0001-build-Add-option-to-select-libc-implementation.patch \ |
34 | file://0007-Fix-test_proc_kill-hanging.patch \ | 38 | file://0007-Fix-test_proc_kill-hanging.patch \ |
35 | file://0001-Add-more-musl-exclusions.patch \ | 39 | file://0001-Add-more-musl-exclusions.patch \ |
36 | file://0001-Remove-OOM-tests-from-runtest-mm.patch \ | 40 | file://0001-Remove-OOM-tests-from-runtest-mm.patch \ |
41 | file://determinism.patch \ | ||
37 | " | 42 | " |
38 | 43 | ||
39 | S = "${WORKDIR}/git" | 44 | S = "${WORKDIR}/git" |
@@ -51,6 +56,14 @@ EXTRA_OECONF = " --with-realtime-testsuite --with-open-posix-testsuite " | |||
51 | # ltp network/rpc test cases ftbfs when libtirpc is found | 56 | # ltp network/rpc test cases ftbfs when libtirpc is found |
52 | EXTRA_OECONF += " --without-tirpc " | 57 | EXTRA_OECONF += " --without-tirpc " |
53 | 58 | ||
59 | do_compile_prepend() { | ||
60 | # Reported at http://lists.linux.it/pipermail/ltp/2021-March/021274.html | ||
61 | # Avoid a race over construction of libswapon.o which is built by swapon and swapoff | ||
62 | # but the object differs depending upon which one built it | ||
63 | # ("../swapon/libswapon.c" vs "libswapon.c" references) | ||
64 | make -C ${B}/testcases/kernel/syscalls/swapon/ | ||
65 | } | ||
66 | |||
54 | do_install(){ | 67 | do_install(){ |
55 | install -d ${D}${prefix}/ | 68 | install -d ${D}${prefix}/ |
56 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install | 69 | oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install |