From a73c8ce91f7525233ab5729204bb6e7a5ea771b2 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 10 Feb 2025 07:05:13 +0000 Subject: [PATCH] app-emulation/qemu: Sync with Gentoo It's from Gentoo commit c0af474b816bf9625ea462426907f13ebc8b2047. --- .../qemu/files/qemu-9.2.0-glibc-2.41.patch | 46 +++++++++++++++++++ .../app-emulation/qemu/qemu-9.1.2.ebuild | 2 +- .../app-emulation/qemu/qemu-9.2.0.ebuild | 4 +- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/qemu/files/qemu-9.2.0-glibc-2.41.patch diff --git a/sdk_container/src/third_party/portage-stable/app-emulation/qemu/files/qemu-9.2.0-glibc-2.41.patch b/sdk_container/src/third_party/portage-stable/app-emulation/qemu/files/qemu-9.2.0-glibc-2.41.patch new file mode 100644 index 0000000000..00ffd0a1bb --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-emulation/qemu/files/qemu-9.2.0-glibc-2.41.patch @@ -0,0 +1,46 @@ +https://bugs.gentoo.org/949098 +https://gitlab.com/qemu-project/qemu/-/issues/2799 +https://lists.nongnu.org/archive/html/qemu-devel/2024-10/msg02221.html + +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 + +Define sched_attr conditionally on SCHED_ATTR_SIZE_VER0 + +Fixes builds with glibc/trunk + +[1] +https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=21571ca0d70302909cf72707b2a7736cf12190a0;hp=298bc488fdc047da37482f4003023cb9adef78f8 + +Signed-off-by: Khem Raj +Cc: Laurent Vivier +Cc: Paolo Bonzini +--- +v2: Use SCHED_ATTR_SIZE_VER0 instead of glibc version check + + linux-user/syscall.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 1ce4c79..a407d4a 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -358,7 +358,8 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len, + #define __NR_sys_sched_setaffinity __NR_sched_setaffinity + _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len, + unsigned long *, user_mask_ptr); +-/* sched_attr is not defined in glibc */ ++/* sched_attr is not defined in glibc < 2.41 */ ++#ifndef SCHED_ATTR_SIZE_VER0 + struct sched_attr { + uint32_t size; + uint32_t sched_policy; +@@ -371,6 +372,7 @@ struct sched_attr { + uint32_t sched_util_min; + uint32_t sched_util_max; + }; ++#endif + #define __NR_sys_sched_getattr __NR_sched_getattr + _syscall4(int, sys_sched_getattr, pid_t, pid, struct sched_attr *, attr, + unsigned int, size, unsigned int, flags); diff --git a/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.1.2.ebuild b/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.1.2.ebuild index df4b36f615..55b0215c9f 100644 --- a/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.1.2.ebuild +++ b/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.1.2.ebuild @@ -47,7 +47,7 @@ else fi S="${WORKDIR}/${MY_P}" - [[ "${PV}" != *_rc* ]] && KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ppc64 ~riscv x86" + [[ "${PV}" != *_rc* ]] && KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv x86" fi DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" diff --git a/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.2.0.ebuild b/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.2.0.ebuild index a689524062..e62552d849 100644 --- a/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.2.0.ebuild +++ b/sdk_container/src/third_party/portage-stable/app-emulation/qemu/qemu-9.2.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -319,7 +319,7 @@ PATCHES=( "${FILESDIR}"/${PN}-9.2.0-capstone-include-path.patch "${FILESDIR}"/${PN}-8.1.0-skip-tests.patch "${FILESDIR}"/${PN}-8.1.0-find-sphinx.patch - + "${FILESDIR}"/${PN}-9.2.0-glibc-2.41.patch ) QA_PREBUILT="