From: Jiaying Song Date: Wed, 23 Jul 2025 10:04:07 +0000 (+0800) Subject: ltp: Skip semctl08 when __USE_TIME64_REDIRECTS is defined X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07410b54660f75465df8d428844893cbd0c295ea;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git ltp: Skip semctl08 when __USE_TIME64_REDIRECTS is defined When __USE_TIME64_REDIRECTS is defined, glibc redirects struct semid_ds to a 64-bit time-safe version that omits the sem_otime_high and sem_ctime_high fields. As a result, the case becomes invalid, leading to incorrect behavior. This patch adds a check to skip the test when __USE_TIME64_REDIRECTS is defined, ensuring the test only runs when the semid_ds structurally matches semid64_ds and the *_high fields are accessible. Signed-off-by: Jiaying Song Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-semctl08-Skip-semctl08-when-__USE_TIME64_RE.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-semctl08-Skip-semctl08-when-__USE_TIME64_RE.patch new file mode 100644 index 0000000000..b4859a6f0a --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-syscalls-semctl08-Skip-semctl08-when-__USE_TIME64_RE.patch @@ -0,0 +1,48 @@ +From 55b48d66857a43c2609fc351293b5601e2eb955d Mon Sep 17 00:00:00 2001 +From: Jiaying Song +Date: Fri, 23 May 2025 15:17:49 +0800 +Subject: [PATCH] syscalls/semctl08: Skip semctl08 when __USE_TIME64_REDIRECTS + is defined + +When __USE_TIME64_REDIRECTS is defined, glibc redirects struct semid_ds to a +64-bit time-safe version that omits the sem_otime_high and sem_ctime_high +fields. As a result, the case becomes invalid and leads to incorrect behavior. + +This patch adds a check to skip the test when __USE_TIME64_REDIRECTS is +defined, ensuring the test only runs when semid_ds structurally matches +semid64_ds and the *_high fields are accessible. + +Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2025-May/043647.html] + +Signed-off-by: Jiaying Song +--- + testcases/kernel/syscalls/ipc/semctl/semctl08.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl08.c b/testcases/kernel/syscalls/ipc/semctl/semctl08.c +index 1878bd4..3b799fa 100644 +--- a/testcases/kernel/syscalls/ipc/semctl/semctl08.c ++++ b/testcases/kernel/syscalls/ipc/semctl/semctl08.c +@@ -10,7 +10,11 @@ + #include "tst_test.h" + #include "libnewipc.h" + +-#ifdef HAVE_SEMID64_DS_TIME_HIGH ++#if !defined(HAVE_SEMID64_DS_TIME_HIGH) ++TST_TEST_TCONF("test requires struct semid64_ds to have the time_high fields"); ++#elif defined(__USE_TIME64_REDIRECTS) ++TST_TEST_TCONF("test requires __USE_TIME64_REDIRECTS to be undefined"); ++#else + + static void run(void) + { +@@ -47,6 +51,4 @@ static struct tst_test test = { + .test_all = run, + .needs_tmpdir = 1, + }; +-#else +-TST_TEST_TCONF("test requires struct semid64_ds to have the time_high fields"); + #endif +-- +2.34.1 + diff --git a/meta/recipes-extended/ltp/ltp_20250130.bb b/meta/recipes-extended/ltp/ltp_20250130.bb index fc643c2ab9..8de13c6000 100644 --- a/meta/recipes-extended/ltp/ltp_20250130.bb +++ b/meta/recipes-extended/ltp/ltp_20250130.bb @@ -31,7 +31,8 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=ht file://0001-Add-__clear_cache-declaration-for-clang.patch \ file://0001-kernel-kvm-don-t-hardcode-objcopy.patch \ file://0001-cve-2015-3290-Disable-AVX-for-x86_64.patch \ - " + file://0001-syscalls-semctl08-Skip-semctl08-when-__USE_TIME64_RE.patch \ + " inherit autotools-brokensep pkgconfig