linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: include linux/const.h to fix build with 5.12+ headers
@ 2021-12-30 13:23 Stijn Tintel
  2022-01-04 16:00 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Stijn Tintel @ 2021-12-30 13:23 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Bruce Ashfield

From: Bruce Ashfield <bruce.ashfield@gmail.com>

btrfs-tools compile fails with mips, musl and 5.12+ headers.

The definition of __ALIGN_KERNEL has moved in 5.12+ kernels, so we
add an explicit include of const.h to pickup the macro:

  | make: *** [Makefile:595: mkfs.btrfs] Error 1
  | make: *** Waiting for unfinished jobs....
  | libbtrfs.a(volumes.o): in function `dev_extent_search_start':
  | /usr/src/debug/btrfs-tools/5.12.1-r0/git/kernel-shared/volumes.c:464: undefined reference to `__ALIGN_KERNEL'
  | collect2: error: ld returned 1 exit status

This is safe for older kernel's as well, since the header still
exists, and is valid to include.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
[remove invalid OE Upstream-status]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
 kerncompat.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kerncompat.h b/kerncompat.h
index df167fe6..254235bd 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -30,6 +30,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <stdint.h>
+#include <linux/const.h>
 
 #include <features.h>
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: include linux/const.h to fix build with 5.12+ headers
  2021-12-30 13:23 [PATCH] btrfs-progs: include linux/const.h to fix build with 5.12+ headers Stijn Tintel
@ 2022-01-04 16:00 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2022-01-04 16:00 UTC (permalink / raw)
  To: Stijn Tintel; +Cc: linux-btrfs, Bruce Ashfield

On Thu, Dec 30, 2021 at 03:23:59PM +0200, Stijn Tintel wrote:
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
> 
> btrfs-tools compile fails with mips, musl and 5.12+ headers.
> 
> The definition of __ALIGN_KERNEL has moved in 5.12+ kernels, so we
> add an explicit include of const.h to pickup the macro:
> 
>   | make: *** [Makefile:595: mkfs.btrfs] Error 1
>   | make: *** Waiting for unfinished jobs....
>   | libbtrfs.a(volumes.o): in function `dev_extent_search_start':
>   | /usr/src/debug/btrfs-tools/5.12.1-r0/git/kernel-shared/volumes.c:464: undefined reference to `__ALIGN_KERNEL'
>   | collect2: error: ld returned 1 exit status
> 
> This is safe for older kernel's as well, since the header still
> exists, and is valid to include.
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> [remove invalid OE Upstream-status]
> Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

Thanks, added to devel.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-04 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30 13:23 [PATCH] btrfs-progs: include linux/const.h to fix build with 5.12+ headers Stijn Tintel
2022-01-04 16:00 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).