diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-01 14:23:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-02 14:15:34 +0000 |
commit | 4215e728a747e09c2441eea230cce9218bc043e8 (patch) | |
tree | dd85d5c8f6f9a48ea41b9b6ee60972c9e3981c41 /meta/recipes-kernel | |
parent | 0dee49810490c6c3528de93658887099264bca9b (diff) | |
download | poky-4215e728a747e09c2441eea230cce9218bc043e8.tar.gz |
lttng: Fix reproducibility issues
Add a hack to hardcode in specific rpaths which we then remove,
allowing the build to be reproducible.
Strip build patches out of one of the test scripts too.
(From OE-Core rev: 18299a114c66280ba2d00becc3fae235d3a6cbd7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-tools/determinism.patch | 64 | ||||
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb | 7 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/determinism.patch b/meta/recipes-kernel/lttng/lttng-tools/determinism.patch new file mode 100644 index 0000000000..b2ab880bd6 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/determinism.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | This is a bit ugly. Specifing abs_builddir as an RPATH is plain wrong when | ||
2 | cross compiling. Sadly, removing the rpath makes libtool/automake do | ||
3 | weird things and breaks the build as shared libs are no longer generated. | ||
4 | |||
5 | We already try and delete the RPATH at do_install with chrpath however | ||
6 | that does leave the path in the string table so it doesn't help us | ||
7 | with reproducibility. | ||
8 | |||
9 | Instead, hack in a bogus but harmless path, then delete it later in | ||
10 | our do_install. Ultimately we may want to pass a specific path to use | ||
11 | to configure if we really do need to set an RPATH at all. It is unclear | ||
12 | to me whether the tests need that or not. | ||
13 | |||
14 | Fixes reproducibility issues for lttng-tools. | ||
15 | |||
16 | Upstream-Status: Pending [needs discussion with upstream about the correct solution] | ||
17 | RP 2021/3/1 | ||
18 | |||
19 | Index: lttng-tools-2.12.2/tests/regression/ust/ust-dl/Makefile.am | ||
20 | =================================================================== | ||
21 | --- lttng-tools-2.12.2.orig/tests/regression/ust/ust-dl/Makefile.am | ||
22 | +++ lttng-tools-2.12.2/tests/regression/ust/ust-dl/Makefile.am | ||
23 | @@ -27,16 +27,16 @@ noinst_LTLIBRARIES = libzzz.la libbar.la | ||
24 | |||
25 | libzzz_la_SOURCES = libzzz.c libzzz.h | ||
26 | libzzz_la_LDFLAGS = -module -shared -avoid-version \ | ||
27 | - -rpath $(abs_builddir) | ||
28 | + -rpath /usr/lib | ||
29 | |||
30 | libbar_la_SOURCES = libbar.c libbar.h | ||
31 | libbar_la_LDFLAGS = -module -shared -avoid-version \ | ||
32 | - -rpath $(abs_builddir) | ||
33 | + -rpath /usr/lib | ||
34 | libbar_la_LIBADD = libzzz.la | ||
35 | |||
36 | libfoo_la_SOURCES = libfoo.c libfoo.h | ||
37 | libfoo_la_LDFLAGS = -module -shared -avoid-version \ | ||
38 | - -rpath $(abs_builddir) | ||
39 | + -rpath /usr/lib | ||
40 | libfoo_la_LIBADD = libbar.la | ||
41 | |||
42 | CLEANFILES = libfoo.so libfoo.so.debug libbar.so libbar.so.debug \ | ||
43 | @@ -44,7 +44,7 @@ CLEANFILES = libfoo.so libfoo.so.debug l | ||
44 | |||
45 | libtp_la_SOURCES = libbar-tp.h libbar-tp.c libfoo-tp.h libfoo-tp.c \ | ||
46 | libzzz-tp.h libzzz-tp.c | ||
47 | -libtp_la_LDFLAGS = -module -shared -rpath $(abs_builddir) | ||
48 | +libtp_la_LDFLAGS = -module -shared -rpath /usr/lib | ||
49 | |||
50 | # Extract debug symbols | ||
51 | libfoo.so.debug: libfoo.la | ||
52 | Index: lttng-tools-2.12.2/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | ||
53 | =================================================================== | ||
54 | --- lttng-tools-2.12.2.orig/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | ||
55 | +++ lttng-tools-2.12.2/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | ||
56 | @@ -5,7 +5,7 @@ AM_CFLAGS += -O0 | ||
57 | noinst_LTLIBRARIES = libfoo.la | ||
58 | |||
59 | libfoo_la_SOURCES = foo.c foo.h | ||
60 | -libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath $(abs_builddir)/.libs/ | ||
61 | +libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath /usr/lib | ||
62 | |||
63 | noinst_PROGRAMS = userspace-probe-elf-binary | ||
64 | userspace_probe_elf_binary_SOURCES = userspace-probe-elf-binary.c | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb b/meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb index 0787e04d19..1f509caeb4 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb | |||
@@ -35,6 +35,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ | |||
35 | file://run-ptest \ | 35 | file://run-ptest \ |
36 | file://lttng-sessiond.service \ | 36 | file://lttng-sessiond.service \ |
37 | file://0001-tests-regression-disable-the-tools-live-tests.patch \ | 37 | file://0001-tests-regression-disable-the-tools-live-tests.patch \ |
38 | file://determinism.patch \ | ||
38 | " | 39 | " |
39 | 40 | ||
40 | SRC_URI[sha256sum] = "9ed9161795ff023b076f9f95afaa4f1f822ec42495c0fa04c586ab8fa74e84f1" | 41 | SRC_URI[sha256sum] = "9ed9161795ff023b076f9f95afaa4f1f822ec42495c0fa04c586ab8fa74e84f1" |
@@ -113,6 +114,8 @@ do_install_ptest () { | |||
113 | done | 114 | done |
114 | 115 | ||
115 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary | 116 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary |
117 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so | ||
118 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so | ||
116 | 119 | ||
117 | # | 120 | # |
118 | # Use the versioned libs of liblttng-ust-dl. | 121 | # Use the versioned libs of liblttng-ust-dl. |
@@ -150,6 +153,10 @@ do_install_ptest () { | |||
150 | -e 's#\(^test.*LDADD.=\)#disable\1#g' \ | 153 | -e 's#\(^test.*LDADD.=\)#disable\1#g' \ |
151 | -i ${D}${PTEST_PATH}/tests/unit/Makefile | 154 | -i ${D}${PTEST_PATH}/tests/unit/Makefile |
152 | 155 | ||
156 | # Fix hardcoded build path | ||
157 | sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH=${PTEST_PATH}/tests/regression/#' \ | ||
158 | -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging | ||
159 | |||
153 | # Substitute links to installed binaries. | 160 | # Substitute links to installed binaries. |
154 | for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do | 161 | for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do |
155 | exedir="${D}${PTEST_PATH}/src/bin/${prog}" | 162 | exedir="${D}${PTEST_PATH}/src/bin/${prog}" |