summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch b/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch
new file mode 100644
index 0000000000..2f51799bc9
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0001-lockable.h-always-define-unknown_lock_type.patch
@@ -0,0 +1,48 @@
1From 8c234bb39eb293a44ca58e15303a359bb782931f Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Wed, 9 Sep 2020 08:41:27 +0000
4Subject: [PATCH] lockable.h: always define unknown_lock_type
5
6There comes below build failure when use gcc 10.1.0 and
7"-Og" passed to compiler.
8 | /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: /mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:25: undefined reference to `unknown_lock_type'
9 | /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: ../fsdev/qemu-fsdev-throttle.o: in function `fsdev_co_throttle_request':
10 | /mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103: undefined reference to `unknown_lock_type'
11 | /usr/lib/gcc/x86_64-wrs-linux/10.1.0/../../../../x86_64-wrs-linux/bin/ld.bfd: ../fsdev/qemu-fsdev-throttle.o:/mnt/build/tmp/work/x86_64-linux/qemu-system-native/5.1.0-r0/qemu-5.1.0/fsdev/qemu-fsdev-throttle.c:103: more undefined references to `unknown_lock_type' follow
12 | collect2: error: ld returned 1 exit status
13
14So always define unknown_lock_type to fix the above error.
15
16Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html]
17
18Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
19---
20 include/qemu/lockable.h | 7 +------
21 1 file changed, 1 insertion(+), 6 deletions(-)
22
23diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h
24index b620023141..e792ed9a69 100644
25--- a/include/qemu/lockable.h
26+++ b/include/qemu/lockable.h
27@@ -25,17 +25,12 @@ struct QemuLockable {
28 };
29
30 /* This function gives an error if an invalid, non-NULL pointer type is passed
31- * to QEMU_MAKE_LOCKABLE. For optimized builds, we can rely on dead-code elimination
32- * from the compiler, and give the errors already at link time.
33+ * to QEMU_MAKE_LOCKABLE.
34 */
35-#if defined(__OPTIMIZE__) && !defined(__SANITIZE_ADDRESS__)
36-void unknown_lock_type(void *);
37-#else
38 static inline void unknown_lock_type(void *unused)
39 {
40 abort();
41 }
42-#endif
43
44 static inline __attribute__((__always_inline__)) QemuLockable *
45 qemu_make_lockable(void *x, QemuLockable *lockable)
46--
472.26.2
48