Revert "qemu: always define unknown_lock_type"

This reverts commit e442924d9a.

This was rejected upstream and its been pointed out qemu doesn't work
without optimization.

Instead we should just error if the user attempts to build it without
optimization.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2020-09-15 11:54:17 +01:00
parent 3c1f1b9913
commit 698127e1ab
3 changed files with 6 additions and 50 deletions

View File

@@ -31,8 +31,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://0001-qemu-Do-not-include-file-if-not-exists.patch \
file://find_datadir.patch \
file://usb-fix-setup_len-init.patch \
file://0001-lockable.h-always-define-unknown_lock_type.patch \
"
"
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
SRC_URI[sha256sum] = "c9174eb5933d9eb5e61f541cd6d1184cd3118dfe4c5c4955bc1bdc4d390fa4e5"

View File

@@ -1,48 +0,0 @@
From 8c234bb39eb293a44ca58e15303a359bb782931f Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 9 Sep 2020 08:41:27 +0000
Subject: [PATCH] lockable.h: always define unknown_lock_type
There comes below build failure when use gcc 10.1.0 and
"-Og" passed to compiler.
| /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'
| /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':
| /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'
| /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
| collect2: error: ld returned 1 exit status
So always define unknown_lock_type to fix the above error.
Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
include/qemu/lockable.h | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h
index b620023141..e792ed9a69 100644
--- a/include/qemu/lockable.h
+++ b/include/qemu/lockable.h
@@ -25,17 +25,12 @@ struct QemuLockable {
};
/* This function gives an error if an invalid, non-NULL pointer type is passed
- * to QEMU_MAKE_LOCKABLE. For optimized builds, we can rely on dead-code elimination
- * from the compiler, and give the errors already at link time.
+ * to QEMU_MAKE_LOCKABLE.
*/
-#if defined(__OPTIMIZE__) && !defined(__SANITIZE_ADDRESS__)
-void unknown_lock_type(void *);
-#else
static inline void unknown_lock_type(void *unused)
{
abort();
}
-#endif
static inline __attribute__((__always_inline__)) QemuLockable *
qemu_make_lockable(void *x, QemuLockable *lockable)
--
2.26.2

View File

@@ -10,6 +10,11 @@ DEPENDS = "glib-2.0 zlib pixman bison-native"
RDEPENDS_${PN}_class-target += "bash"
# Does not compile for -Og because that level does not clean up dead-code.
# See lockable.h.
#
DEBUG_BUILD = "0"
EXTRA_OECONF_append_class-target = " --target-list=${@get_qemu_target_list(d)}"
EXTRA_OECONF_append_class-target_mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
EXTRA_OECONF_append_class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"