0001-lockable.h-always-define-unknown_lock_type.patch 2.2 KB

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