summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-08-23 23:34:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-25 11:07:33 +0100
commit57cac75d09ba05ccd3f14302986b3e2f14d65780 (patch)
treed58826c2c852e29b99a91cbff5b2a6811a08724c /meta/recipes-extended
parent0d117e5d17c491e1d26aefb4b919410b07fd5347 (diff)
downloadopenembedded-core-contrib-57cac75d09ba05ccd3f14302986b3e2f14d65780.tar.gz
ltp: Adjust types to match create_fifo_thread return
Fixes build on musl Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-rt-migrate-Use-int-instead-of-pthread_t-for-thread-I.patch36
-rw-r--r--meta/recipes-extended/ltp/ltp_20220527.bb1
2 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-rt-migrate-Use-int-instead-of-pthread_t-for-thread-I.patch b/meta/recipes-extended/ltp/ltp/0001-rt-migrate-Use-int-instead-of-pthread_t-for-thread-I.patch
new file mode 100644
index 0000000000..e49f53a9e2
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-rt-migrate-Use-int-instead-of-pthread_t-for-thread-I.patch
@@ -0,0 +1,36 @@
+From 11e503344c36c1c7df3e455d81736dc4a5b43775 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 23 Aug 2022 23:20:53 -0700
+Subject: [PATCH] rt-migrate: Use int instead of pthread_t for thread IDs
+
+pthread_t is opaque, but create_fifo_thread() returns integer therefore
+on musl where thread_t is not integer, this fails to compile e.g.
+
+| rt-migrate.c:450:14: error: incompatible integer to pointer conversion assigning to 'pthread_t' (aka 'struct __pthread *') from 'int' [-Wint-conversion]
+| threads[i] = create_fifo_thread(start_task, (void *)i,
+| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Align the types used to fix the problems.
+
+Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2022-August/030239.html]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/realtime/func/rt-migrate/rt-migrate.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/realtime/func/rt-migrate/rt-migrate.c b/testcases/realtime/func/rt-migrate/rt-migrate.c
+index 3e6c82a2fb..97ab604c7f 100644
+--- a/testcases/realtime/func/rt-migrate/rt-migrate.c
++++ b/testcases/realtime/func/rt-migrate/rt-migrate.c
+@@ -394,7 +394,7 @@ static void stop_log(int sig)
+
+ int main(int argc, char **argv)
+ {
+- pthread_t *threads;
++ int *threads;
+ long i;
+ int ret;
+ struct timespec intv;
+--
+2.37.2
+
diff --git a/meta/recipes-extended/ltp/ltp_20220527.bb b/meta/recipes-extended/ltp/ltp_20220527.bb
index a547298828..09c7250608 100644
--- a/meta/recipes-extended/ltp/ltp_20220527.bb
+++ b/meta/recipes-extended/ltp/ltp_20220527.bb
@@ -39,6 +39,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=ht
file://0001-memcg-functional-Fix-usage-of-PAGESIZE-from-memcg_li.patch \
file://0001-lapi-pidfd-adding-pidfd-header-file.patch \
file://0001-lapi-fsmount-resolve-conflict-in-different-header-fi.patch \
+ file://0001-rt-migrate-Use-int-instead-of-pthread_t-for-thread-I.patch \
"
S = "${WORKDIR}/git"