0001-btrfs-progs-include-linux-const-h-to-fix-build-with-5-12-headers.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From b28f7bd9bba6f65258da48955154794f466b4104 Mon Sep 17 00:00:00 2001
  2. From: Bruce Ashfield <bruce.ashfield@gmail.com>
  3. Date: Thu, 30 Dec 2021 15:23:59 +0200
  4. Subject: [PATCH] btrfs-progs: include linux/const.h to fix build with 5.12+
  5. headers
  6. btrfs-tools compile fails with mips, musl and 5.12+ headers.
  7. The definition of __ALIGN_KERNEL has moved in 5.12+ kernels, so we
  8. add an explicit include of const.h to pickup the macro:
  9. | make: *** [Makefile:595: mkfs.btrfs] Error 1
  10. | make: *** Waiting for unfinished jobs....
  11. | libbtrfs.a(volumes.o): in function `dev_extent_search_start':
  12. | /usr/src/debug/btrfs-tools/5.12.1-r0/git/kernel-shared/volumes.c:464: undefined reference to `__ALIGN_KERNEL'
  13. | collect2: error: ld returned 1 exit status
  14. This is safe for older kernel's as well, since the header still
  15. exists, and is valid to include.
  16. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
  17. [remove invalid OE Upstream-status]
  18. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
  19. Signed-off-by: David Sterba <dsterba@suse.com>
  20. [Retrieved from:
  21. https://github.com/kdave/btrfs-progs/commit/b28f7bd9bba6f65258da48955154794f466b4104]
  22. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  23. ---
  24. kerncompat.h | 1 +
  25. 1 file changed, 1 insertion(+)
  26. diff --git a/kerncompat.h b/kerncompat.h
  27. index df167fe6c..2503d1afa 100644
  28. --- a/kerncompat.h
  29. +++ b/kerncompat.h
  30. @@ -29,6 +29,7 @@
  31. #include <stddef.h>
  32. #include <linux/types.h>
  33. #include <linux/kernel.h>
  34. +#include <linux/const.h>
  35. #include <stdint.h>
  36. #include <features.h>