Skip to contentSkip to conversation

strace: Define sched_attr conditionally

PATCH In review Khem Raj 2 participants 3 messages Sep 30, 2024 – Oct 1, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 strace: Define sched_attr conditionally

So that it does not conflict with glibc 2.41+ newly added definitions

---
 ...e-conditionally-on-SCHED_ATTR_SIZE_V.patch | 49 +++++++++++++++++++
 meta/recipes-devtools/strace/strace_6.11.bb   |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 meta/recipes-devtools/strace/strace/0001-sched_attr-Define-conditionally-on-SCHED_ATTR_SIZE_V.patch
meta/recipes-devtools/strace/strace/0001-sched_attr-Define-conditionally-on-SCHED_ATTR_SIZE_V.patch new file +49 -0
new file mode 100644
index 00000000000..b8d57797dfe
@@ -0,0 +1,49 @@
+From d162a1d6b18348955f9989f150c86a68af096362 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 30 Sep 2024 15:17:16 -0700
+Subject: [PATCH] sched_attr: Define conditionally on SCHED_ATTR_SIZE_VER0
+
+glibc 2.41+ has added [1] definitions for sched_setattr and sched_getattr functions
+and struct sched_attr. Therefore, it needs to be checked for here as well before
+defining sched_attr
+
+Fixes builds with glibc/trunk
+
+In file included from ../../strace-6.11/src/sched.c:14:
+../../strace-6.11/src/sched_attr.h:16:8: error: redefinition of 'sched_attr'
+   16 | struct sched_attr {
+      |        ^
+/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/strace/6.11/recipe-sysroot/usr/include/linux/sched/types.h:98:8: note: previous definition is here
+   98 | struct sched_attr {
+      |        ^
+
+[1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=21571ca0d70302909cf72707b2a7736cf12190a0;hp=298bc488fdc047da37482f4003023cb9adef78f8
+
+Upstream-Status: Submitted [https://github.com/strace/strace/pull/318]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/sched_attr.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/sched_attr.h b/src/sched_attr.h
+index 26c53172f..a5b5d94ce 100644
+--- a/src/sched_attr.h
++++ b/src/sched_attr.h
+@@ -11,6 +11,8 @@
+ 
+ # include <stdint.h>
+ 
++# ifndef SCHED_ATTR_SIZE_VER0
++
+ struct sched_attr {
+ 	uint32_t size;
+ 	uint32_t sched_policy;
+@@ -25,6 +27,8 @@ struct sched_attr {
+ 	uint32_t sched_util_max;
+ };
+ 
++# endif /* SCHED_ATTR_SIZE_VER0 */
++
+ # define SCHED_ATTR_MIN_SIZE	48
+ # ifndef SCHED_ATTR_SIZE_VER1
+ #  define SCHED_ATTR_SIZE_VER1  56
meta/recipes-devtools/strace/strace_6.11.bb +1 -0
index d98b5fdec9a..45e1c26627f 100644
@@ -14,6 +14,7 @@ SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
            file://skip-load.patch \
            file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \
            file://0002-tests-Replace-off64_t-with-off_t.patch \
+           file://0001-sched_attr-Define-conditionally-on-SCHED_ATTR_SIZE_V.patch \
            "
 SRC_URI[sha256sum] = "83262583a3529f02c3501aa8b8ac772b4cbc03dc934e98bab6e4883626e283a5"
 
author
#1 lore raw

PATCH 2/2 linux-yocto: Enable l2tp drivers when ptest featuee is on

openl2tp ptests from networking layer depend upon these

Cc Bruce Ashfield <[email protected]>
---
 meta/recipes-kernel/linux/linux-yocto_6.10.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-kernel/linux/linux-yocto_6.10.bb +2 -0
index 87f7794bbef..cee06c22ea3 100644
@@ -66,6 +66,8 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " fe
 KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
 # libteam ptests from meta-oe needs it
 KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/net/team/team.scc", "", d)}"
+# openl2tp tests from meta-networking needs it
+KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " cgl/cfg/net/l2tp.scc", "", d)}"
 KERNEL_FEATURES:append:powerpc =" arch/powerpc/powerpc-debug.scc"
 KERNEL_FEATURES:append:powerpc64 =" arch/powerpc/powerpc-debug.scc"
 KERNEL_FEATURES:append:powerpc64le =" arch/powerpc/powerpc-debug.scc"
#2 lore raw

Re: [PATCH 2/2] linux-yocto: Enable l2tp drivers when ptest featuee is on

Quoted 5 lines · Khem Raj

openl2tp ptests from networking layer depend upon these

Cc Bruce Ashfield <[email protected]>

Fine with me!

Bruce

Quoted 17 lines
---
 meta/recipes-kernel/linux/linux-yocto_6.10.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-kernel/linux/linux-yocto_6.10.bb +2 -0
index 87f7794bbef..cee06c22ea3 100644
@@ -66,6 +66,8 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " fe
 KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
 # libteam ptests from meta-oe needs it
 KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " features/net/team/team.scc", "", d)}"
+# openl2tp tests from meta-networking needs it
+KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", " cgl/cfg/net/l2tp.scc", "", d)}"
 KERNEL_FEATURES:append:powerpc =" arch/powerpc/powerpc-debug.scc"
 KERNEL_FEATURES:append:powerpc64 =" arch/powerpc/powerpc-debug.scc"
 KERNEL_FEATURES:append:powerpc64le =" arch/powerpc/powerpc-debug.scc"
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II