diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-12-13 12:40:54 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-21 10:38:29 +0000 |
commit | 53af03827e0c01e5d7c1ef350cded9ab94e9141e (patch) | |
tree | 832056e7d5fffaedeb4acde3e22322fe4c54d25a /meta/recipes-devtools/qemu/qemu | |
parent | 5800c6a60fde019c4c5f5ae0e36cdeb0dc556940 (diff) | |
download | poky-53af03827e0c01e5d7c1ef350cded9ab94e9141e.tar.gz |
qemu: Fix build with latest musl
musl dropped basename() from string.h, adjust for that
(From OE-Core rev: 58f7eb2b5a2ae037294b631bf083729e78910c24)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch b/meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch new file mode 100644 index 0000000000..5b8b638736 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From e31c67ef65a4217f35f6cd40926251054094dff9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 11 Dec 2023 16:44:16 -0800 | ||
4 | Subject: [PATCH v2] vfio: Include libgen.h for basename API | ||
5 | |||
6 | Glibc has two implementation one based on POSIX which is used when | ||
7 | libgen.h is included and second implementation is GNU implementation | ||
8 | which is used when string.h is included. The functions are no identical | ||
9 | in behavior. Musl C library does not implement the GNU version, but it | ||
10 | has provided a declaration in string.h but this has been corrected in | ||
11 | latest musl [1] which exposes places where it was being used from | ||
12 | string.h to error out especially when -Wimplicit-function-declaration is | ||
13 | treated as error. | ||
14 | |||
15 | | ../qemu-8.1.2/hw/vfio/pci.c:3030:18: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] | ||
16 | | 3030 | group_name = basename(group_path); | ||
17 | |||
18 | clang-17 treats this warning as error by default | ||
19 | |||
20 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 | ||
21 | |||
22 | Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2023-12/msg01438.html] | ||
23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
24 | --- | ||
25 | v2: Add missing link for [1] | ||
26 | |||
27 | hw/vfio/pci.c | 1 + | ||
28 | hw/vfio/platform.c | 1 + | ||
29 | 2 files changed, 2 insertions(+) | ||
30 | |||
31 | diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c | ||
32 | index c62c02f7b6..f043c93b9e 100644 | ||
33 | --- a/hw/vfio/pci.c | ||
34 | +++ b/hw/vfio/pci.c | ||
35 | @@ -19,6 +19,7 @@ | ||
36 | */ | ||
37 | |||
38 | #include "qemu/osdep.h" | ||
39 | +#include <libgen.h> | ||
40 | #include <linux/vfio.h> | ||
41 | #include <sys/ioctl.h> | ||
42 | |||
43 | diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c | ||
44 | index 8e3d4ac458..a835ab03be 100644 | ||
45 | --- a/hw/vfio/platform.c | ||
46 | +++ b/hw/vfio/platform.c | ||
47 | @@ -16,6 +16,7 @@ | ||
48 | |||
49 | #include "qemu/osdep.h" | ||
50 | #include "qapi/error.h" | ||
51 | +#include <libgen.h> | ||
52 | #include <sys/ioctl.h> | ||
53 | #include <linux/vfio.h> | ||
54 | |||
55 | -- | ||
56 | 2.43.0 | ||
57 | |||