diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-01-28 15:14:27 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-29 16:16:52 +0000 |
commit | 20bd7eece8a3ac117870ecf4045a902d8c579272 (patch) | |
tree | a5788433d488a2e79a1a20789501f55e3ffd0b11 | |
parent | e25c5db4d08f0916ce4e411ea3903e57eb47e079 (diff) | |
download | poky-20bd7eece8a3ac117870ecf4045a902d8c579272.tar.gz |
rt-tests: Fix build with glibc 2.41+
(From OE-Core rev: e22a231d94f83fd6fec8380e4449e8b5bf149e98)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-rt/rt-tests/files/0001-sched_attr-Do-not-define-for-glibc-2.41.patch | 44 | ||||
-rw-r--r-- | meta/recipes-rt/rt-tests/rt-tests_git.bb | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-rt/rt-tests/files/0001-sched_attr-Do-not-define-for-glibc-2.41.patch b/meta/recipes-rt/rt-tests/files/0001-sched_attr-Do-not-define-for-glibc-2.41.patch new file mode 100644 index 0000000000..915f8baa61 --- /dev/null +++ b/meta/recipes-rt/rt-tests/files/0001-sched_attr-Do-not-define-for-glibc-2.41.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From e1f5f9379a68471c9f5fb0859e87dd84001b0b6f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 28 Jan 2025 15:03:59 -0800 | ||
4 | Subject: [PATCH] sched_attr: Do not define for glibc >= 2.41 | ||
5 | |||
6 | glibc 2.41+ has added [1] definitions for sched_setattr and sched_getattr functions | ||
7 | and struct sched_attr. Therefore, it needs to be checked for here as well before | ||
8 | defining sched_attr | ||
9 | |||
10 | Define sched_attr conditionally on SCHED_ATTR_SIZE_VER0 | ||
11 | |||
12 | Fixes builds with glibc/trunk | ||
13 | |||
14 | [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=21571ca0d70302909cf72707b2a7736cf12190a0;hp=298bc488fdc047da37482f4003023cb9adef78f8 | ||
15 | |||
16 | Upstream-Status: Submitted [https://lore.kernel.org/linux-rt-users/20250128230838.2311298-1-raj.khem@gmail.com/T/#u] | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | Cc: Clark Williams <williams@redhat.com> | ||
19 | Cc: John Kacur <jkacur@redhat.com> | ||
20 | Cc: rt-users <linux-rt-users@vger.kernel.org> | ||
21 | --- | ||
22 | src/include/rt-sched.h | 4 ++++ | ||
23 | 1 file changed, 4 insertions(+) | ||
24 | |||
25 | diff --git a/src/include/rt-sched.h b/src/include/rt-sched.h | ||
26 | index 80171c7..9cf0e3a 100644 | ||
27 | --- a/src/include/rt-sched.h | ||
28 | +++ b/src/include/rt-sched.h | ||
29 | @@ -42,6 +42,8 @@ | ||
30 | #define __NR_sched_getattr 275 | ||
31 | #endif | ||
32 | |||
33 | +/* sched_attr is not defined in glibc < 2.41 */ | ||
34 | +#ifndef SCHED_ATTR_SIZE_VER0 | ||
35 | struct sched_attr { | ||
36 | uint32_t size; | ||
37 | uint32_t sched_policy; | ||
38 | @@ -68,4 +70,6 @@ int sched_getattr(pid_t pid, | ||
39 | unsigned int size, | ||
40 | unsigned int flags); | ||
41 | |||
42 | +#endif /* SCHED_ATTR_SIZE_VER0 */ | ||
43 | + | ||
44 | #endif /* __RT_SCHED_H__ */ | ||
diff --git a/meta/recipes-rt/rt-tests/rt-tests_git.bb b/meta/recipes-rt/rt-tests/rt-tests_git.bb index 1f48e143d4..5fa980dbdf 100644 --- a/meta/recipes-rt/rt-tests/rt-tests_git.bb +++ b/meta/recipes-rt/rt-tests/rt-tests_git.bb | |||
@@ -13,6 +13,7 @@ SRC_URI += " \ | |||
13 | file://run-ptest \ | 13 | file://run-ptest \ |
14 | file://rt_bmark.py \ | 14 | file://rt_bmark.py \ |
15 | file://0001-Makefile-Allow-for-CC-and-AR-to-be-overridden.patch \ | 15 | file://0001-Makefile-Allow-for-CC-and-AR-to-be-overridden.patch \ |
16 | file://0001-sched_attr-Do-not-define-for-glibc-2.41.patch \ | ||
16 | " | 17 | " |
17 | 18 | ||
18 | # rt-tests needs PI mutex support in libc | 19 | # rt-tests needs PI mutex support in libc |