diff options
| author | Jaeyoon Jung <jaeyoon.jung@lge.com> | 2025-11-26 17:50:30 +0900 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-12-01 23:59:22 -0500 |
| commit | 030f74b12e30d64276590a0afed07507ace8f5f2 (patch) | |
| tree | a81d37818ec559d06691604b827c1f4859da725c | |
| parent | 247ea9c3880a257003ce2cc566fcdbb307ea4374 (diff) | |
| download | meta-virtualization-030f74b12e30d64276590a0afed07507ace8f5f2.tar.gz | |
kvmtool: Backport patch for musl compatibilitystyhead
backporting a patch to fix musl builds/compatibility
Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch | 51 | ||||
| -rw-r--r-- | recipes-extended/kvmtool/kvmtool_git.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch b/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch new file mode 100644 index 00000000..1fdbca72 --- /dev/null +++ b/recipes-extended/kvmtool/files/0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From 0592f8f829c843ff5cb2d108c309e32f4f6f5379 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andre Przywara <andre.przywara@arm.com> | ||
| 3 | Date: Thu, 1 Aug 2024 12:10:54 +0100 | ||
| 4 | Subject: [PATCH] remove wordsize.h inclusion (for musl compatibility) | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | The wordsize.h header file and the __WORDSIZE definition do not seem | ||
| 10 | to be universal, the musl libc for instance has the definition in a | ||
| 11 | different header file. This breaks compilation of kvmtool against musl. | ||
| 12 | |||
| 13 | The two leading underscores suggest a compiler-internal symbol anyway, so | ||
| 14 | let's just remove that particular macro usage entirely, and replace it | ||
| 15 | with the number we really want: the size of a "long" type. | ||
| 16 | |||
| 17 | Reported-by: J. Neuschäfer <j.neuschaefer@gmx.net> | ||
| 18 | Signed-off-by: Andre Przywara <andre.przywara@arm.com> | ||
| 19 | Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> | ||
| 20 | Link: https://lore.kernel.org/r/20240801111054.818765-1-andre.przywara@arm.com | ||
| 21 | Signed-off-by: Will Deacon <will@kernel.org> | ||
| 22 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/commit/?id=0592f8f829c843ff5cb2d108c309e32f4f6f5379] | ||
| 23 | --- | ||
| 24 | include/linux/bitops.h | 6 ++---- | ||
| 25 | 1 file changed, 2 insertions(+), 4 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/include/linux/bitops.h b/include/linux/bitops.h | ||
| 28 | index ae33922..ee8fd56 100644 | ||
| 29 | --- a/include/linux/bitops.h | ||
| 30 | +++ b/include/linux/bitops.h | ||
| 31 | @@ -1,15 +1,13 @@ | ||
| 32 | #ifndef _KVM_LINUX_BITOPS_H_ | ||
| 33 | #define _KVM_LINUX_BITOPS_H_ | ||
| 34 | |||
| 35 | -#include <bits/wordsize.h> | ||
| 36 | - | ||
| 37 | #include <linux/kernel.h> | ||
| 38 | #include <linux/compiler.h> | ||
| 39 | #include <asm/hweight.h> | ||
| 40 | |||
| 41 | -#define BITS_PER_LONG __WORDSIZE | ||
| 42 | #define BITS_PER_BYTE 8 | ||
| 43 | -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) | ||
| 44 | +#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) | ||
| 45 | +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG) | ||
| 46 | |||
| 47 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) | ||
| 48 | |||
| 49 | -- | ||
| 50 | 2.47.2 | ||
| 51 | |||
diff --git a/recipes-extended/kvmtool/kvmtool_git.bb b/recipes-extended/kvmtool/kvmtool_git.bb index 141fb02d..a171129f 100644 --- a/recipes-extended/kvmtool/kvmtool_git.bb +++ b/recipes-extended/kvmtool/kvmtool_git.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git;branch | |||
| 14 | file://0001-kvmtool-9p-fixed-compilation-error.patch \ | 14 | file://0001-kvmtool-9p-fixed-compilation-error.patch \ |
| 15 | file://0002-kvmtool-add-EXTRA_CFLAGS-variable.patch \ | 15 | file://0002-kvmtool-add-EXTRA_CFLAGS-variable.patch \ |
| 16 | file://0003-kvmtool-Werror-disabled.patch \ | 16 | file://0003-kvmtool-Werror-disabled.patch \ |
| 17 | file://0004-remove-wordsize.h-inclusion-for-musl-compatibility.patch \ | ||
| 17 | " | 18 | " |
| 18 | 19 | ||
| 19 | SRCREV = "4d2c017f41533b0e51e00f689050c26190a15318" | 20 | SRCREV = "4d2c017f41533b0e51e00f689050c26190a15318" |
