]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
ltp: Adjust types to match create_fifo_thread return
authorKhem Raj <raj.khem@gmail.com>
Wed, 24 Aug 2022 06:34:43 +0000 (23:34 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Aug 2022 10:07:33 +0000 (11:07 +0100)
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>
meta/recipes-extended/ltp/ltp/0001-rt-migrate-Use-int-instead-of-pthread_t-for-thread-I.patch [new file with mode: 0644]
meta/recipes-extended/ltp/ltp_20220527.bb

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 (file)
index 0000000..e49f53a
--- /dev/null
@@ -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
+
index a547298828b108a2c558c2b2828c34d0f728c61c..09c72506082563ca045178546030a0832a54501f 100644 (file)
@@ -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"