lttng-tools ptest requires SYS_ppoll and SYS_pselect which are not
supported by qemuriscv32.

Back port a not merged patch from upstream to be able to disable the test
build and disable the ptest build for qemuriscv32. This way the main
package can still be used or at least built.

See the following link for more details.
https://github.com/lttng/lttng-tools/pull/162

Signed-off-by: He Zhe <[email protected]>
---
 meta/recipes-kernel/lttng/lttng-platforms.inc |  4 ++
 .../0001-configure.ac-add-disable-tests.patch | 38 +++++++++++++++++++
 .../lttng/lttng-tools_2.13.8.bb               |  6 ++-
 3 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 
meta/recipes-kernel/lttng/lttng-tools/0001-configure.ac-add-disable-tests.patch

diff --git a/meta/recipes-kernel/lttng/lttng-platforms.inc 
b/meta/recipes-kernel/lttng/lttng-platforms.inc
index 933c65d85d..2351df08b8 100644
--- a/meta/recipes-kernel/lttng/lttng-platforms.inc
+++ b/meta/recipes-kernel/lttng/lttng-platforms.inc
@@ -15,3 +15,7 @@ LTTNGUST:arc = ""
 
 COMPATIBLE_HOST:arc:pn-lttng-ust = "null"
 
+# Whether the platform supports lttng-tools-ptest
+# lttng-tools-ptest uses syscall SYS_ppoll and SYS_pselect6 which are not 
supported for some platforms.
+LTTNGTOOLSPTEST = "ptest"
+LTTNGTOOLSPTEST:qemuriscv32 = ""
diff --git 
a/meta/recipes-kernel/lttng/lttng-tools/0001-configure.ac-add-disable-tests.patch
 
b/meta/recipes-kernel/lttng/lttng-tools/0001-configure.ac-add-disable-tests.patch
new file mode 100644
index 0000000000..05e976ec49
--- /dev/null
+++ 
b/meta/recipes-kernel/lttng/lttng-tools/0001-configure.ac-add-disable-tests.patch
@@ -0,0 +1,38 @@
+From 787978985d6ddd86561f16ad88a12e1570d3e46b Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Wed, 21 Sep 2022 23:07:03 -0700
+Subject: [PATCH] configure.ac: add --disable-tests
+
+Allow the user to explicitly disable tests
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: He Zhe <[email protected]>
+---
+ configure.ac | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 5bfe791..a90e590 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -884,6 +884,8 @@ AC_ARG_ENABLE([bin-lttng-sessiond], 
AS_HELP_STRING([--disable-bin-lttng-sessiond
+             [Disable the build of lttng-sessiond binaries]))
+ AC_ARG_ENABLE([extras], AS_HELP_STRING([--disable-extras],
+             [Disable the build of the extra components]))
++AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests],
++            [Disable the build of the test components]))
+ 
+ 
+ build_lib_consumer=no
+@@ -1035,6 +1037,7 @@ AM_CONDITIONAL([BUILD_BIN_LTTNG_SESSIOND], [test 
x$enable_bin_lttng_sessiond !=
+ 
+ # Export the tests and extras build conditions.
+ AS_IF([\
++test "x$enable_tests" != "xno" && \
+ test "x$enable_bin_lttng" != "xno" && \
+ test "x$enable_bin_lttng_consumerd" != "xno" && \
+ test "x$enable_bin_lttng_crash" != "xno" && \
+-- 
+2.37.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb 
b/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb
index a814eb79f9..883c930cdb 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb
@@ -25,11 +25,12 @@ PYTHON_OPTION = 
"am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
                  am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
                  
PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
 "
-PACKAGECONFIG ??= "${LTTNGUST} kmod"
+PACKAGECONFIG ??= "${LTTNGUST} ${LTTNGTOOLSPTEST} kmod"
 PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 
swig-native"
 PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
 PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod"
 PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, 
asciidoc-native xmlto-native libxslt-native"
+PACKAGECONFIG[ptest] = ",--disable-tests"
 
 SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://0001-tests-do-not-strip-a-helper-library.patch \
@@ -37,11 +38,12 @@ SRC_URI = 
"https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://lttng-sessiond.service \
            file://determinism.patch \
            file://disable-tests.patch \
+           file://0001-configure.ac-add-disable-tests.patch \
            "
 
 SRC_URI[sha256sum] = 
"b1e959579b260790930b20f3c7aa7cefb8a40e0de80d4a777c2bf78c6b353dc1"
 
-inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
+inherit autotools ${@bb.utils.filter('LTTNGTOOLSPTEST', 'ptest', d)} pkgconfig 
useradd python3-dir manpages systemd
 
 CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep"
 
-- 
2.37.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170996): 
https://lists.openembedded.org/g/openembedded-core/message/170996
Mute This Topic: https://lists.openembedded.org/mt/93863613/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to