* [PATCH] buildid: reduce header file dependencies for module
@ 2023-10-17 14:33 Arnd Bergmann
2023-10-17 15:29 ` Yury Norov
2023-10-17 16:13 ` Jiri Olsa
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2023-10-17 14:33 UTC (permalink / raw)
To: Yury Norov, Jiri Olsa, Song Liu, Alexei Starovoitov
Cc: Arnd Bergmann, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The vmlinux decompressor code intentionally has only a limited set of
included header files, but this started running into a build failure
because of the bitmap logic needing linux/errno.h:
In file included from include/linux/cpumask.h:12,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39,
from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10,
from arch/arm/boot/compressed/decompress.c:60:
include/linux/bitmap.h: In function 'bitmap_allocate_region':
include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function)
527 | return -EBUSY;
| ^~~~~
include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in
include/linux/bitmap.h: In function 'bitmap_find_free_region':
include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function)
554 | return -ENOMEM;
| ^~~~~~
This is easily avoided by changing linux/buildid.h to no longer depend on
linux/mm_types.h, a header that pulls in a huge number of indirect dependencies.
Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h")
Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/buildid.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/buildid.h b/include/linux/buildid.h
index 3b7a0ff4642fd..8a582d242f067 100644
--- a/include/linux/buildid.h
+++ b/include/linux/buildid.h
@@ -2,10 +2,11 @@
#ifndef _LINUX_BUILDID_H
#define _LINUX_BUILDID_H
-#include <linux/mm_types.h>
+#include <linux/types.h>
#define BUILD_ID_SIZE_MAX 20
+struct vm_area_struct;
int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id,
__u32 *size);
int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size);
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] buildid: reduce header file dependencies for module
2023-10-17 14:33 [PATCH] buildid: reduce header file dependencies for module Arnd Bergmann
@ 2023-10-17 15:29 ` Yury Norov
2023-10-17 15:44 ` Arnd Bergmann
2023-10-17 16:13 ` Jiri Olsa
1 sibling, 1 reply; 4+ messages in thread
From: Yury Norov @ 2023-10-17 15:29 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jiri Olsa, Song Liu, Alexei Starovoitov, Arnd Bergmann,
linux-kernel
On Tue, Oct 17, 2023 at 04:33:58PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The vmlinux decompressor code intentionally has only a limited set of
> included header files, but this started running into a build failure
> because of the bitmap logic needing linux/errno.h:
>
> In file included from include/linux/cpumask.h:12,
> from include/linux/mm_types_task.h:14,
> from include/linux/mm_types.h:5,
> from include/linux/buildid.h:5,
> from include/linux/module.h:14,
> from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39,
> from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10,
> from arch/arm/boot/compressed/decompress.c:60:
> include/linux/bitmap.h: In function 'bitmap_allocate_region':
> include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function)
> 527 | return -EBUSY;
> | ^~~~~
> include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in
> include/linux/bitmap.h: In function 'bitmap_find_free_region':
> include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function)
> 554 | return -ENOMEM;
> | ^~~~~~
>
> This is easily avoided by changing linux/buildid.h to no longer depend on
> linux/mm_types.h, a header that pulls in a huge number of indirect dependencies.
>
> Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h")
> Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Yury Norov <yury.norov@gmail.com>
Would you like me to add this into bitmap-for-next?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] buildid: reduce header file dependencies for module
2023-10-17 15:29 ` Yury Norov
@ 2023-10-17 15:44 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2023-10-17 15:44 UTC (permalink / raw)
To: Yury Norov, Arnd Bergmann
Cc: Jiri Olsa, Song Liu, Alexei Starovoitov, linux-kernel
On Tue, Oct 17, 2023, at 17:29, Yury Norov wrote:
> On Tue, Oct 17, 2023 at 04:33:58PM +0200, Arnd Bergmann wrote:
>>
>> This is easily avoided by changing linux/buildid.h to no longer depend on
>> linux/mm_types.h, a header that pulls in a huge number of indirect dependencies.
>>
>> Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h")
>> Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Yury Norov <yury.norov@gmail.com>
>
> Would you like me to add this into bitmap-for-next?
Yes, I think that would be best to avoid the regression.
Thanks,
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] buildid: reduce header file dependencies for module
2023-10-17 14:33 [PATCH] buildid: reduce header file dependencies for module Arnd Bergmann
2023-10-17 15:29 ` Yury Norov
@ 2023-10-17 16:13 ` Jiri Olsa
1 sibling, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2023-10-17 16:13 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Yury Norov, Song Liu, Alexei Starovoitov, Arnd Bergmann,
linux-kernel
On Tue, Oct 17, 2023 at 04:33:58PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The vmlinux decompressor code intentionally has only a limited set of
> included header files, but this started running into a build failure
> because of the bitmap logic needing linux/errno.h:
>
> In file included from include/linux/cpumask.h:12,
> from include/linux/mm_types_task.h:14,
> from include/linux/mm_types.h:5,
> from include/linux/buildid.h:5,
> from include/linux/module.h:14,
> from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39,
> from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10,
> from arch/arm/boot/compressed/decompress.c:60:
> include/linux/bitmap.h: In function 'bitmap_allocate_region':
> include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function)
> 527 | return -EBUSY;
> | ^~~~~
> include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in
> include/linux/bitmap.h: In function 'bitmap_find_free_region':
> include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function)
> 554 | return -ENOMEM;
> | ^~~~~~
>
> This is easily avoided by changing linux/buildid.h to no longer depend on
> linux/mm_types.h, a header that pulls in a huge number of indirect dependencies.
>
> Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h")
> Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> include/linux/buildid.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/buildid.h b/include/linux/buildid.h
> index 3b7a0ff4642fd..8a582d242f067 100644
> --- a/include/linux/buildid.h
> +++ b/include/linux/buildid.h
> @@ -2,10 +2,11 @@
> #ifndef _LINUX_BUILDID_H
> #define _LINUX_BUILDID_H
>
> -#include <linux/mm_types.h>
> +#include <linux/types.h>
looks good, but I think we should now include <linux/mm_types.h> in lib/buildid.c ?
thanks,
jirka
>
> #define BUILD_ID_SIZE_MAX 20
>
> +struct vm_area_struct;
> int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id,
> __u32 *size);
> int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size);
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-17 16:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 14:33 [PATCH] buildid: reduce header file dependencies for module Arnd Bergmann
2023-10-17 15:29 ` Yury Norov
2023-10-17 15:44 ` Arnd Bergmann
2023-10-17 16:13 ` Jiri Olsa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.