linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor
@ 2023-03-10 14:01 Arnd Bergmann
  2023-03-10 14:15 ` Jason Baron
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2023-03-10 14:01 UTC (permalink / raw)
  To: Vincenzo Palazzo, Luis Chamberlain, Jason Baron
  Cc: Arnd Bergmann, Russell King, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

After a change to linux/module.h, dyndbg.h is now included
indirectly from the decompressor for lz4 support, which in turn
causes a build failure on 32-bit Arm:

In file included from include/linux/module.h:30,
                 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:59:
include/linux/dynamic_debug.h: In function 'ddebug_dyndbg_module_param_cb':
include/linux/dynamic_debug.h:307:14: error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
  307 |         if (!strcmp(param, "dyndbg")) {
      |              ^~~~~~
include/linux/dynamic_debug.h:1:1: note: 'strcmp' is defined in header '<string.h>'; did you forget to '#include <string.h>'?
  +++ |+#include <string.h>

The decompressor has its own replacement for the linux/string.h contents,
so the normal declaration is not visible here. Since the function is
not actually called, it is sufficient to add a declaration, and this
is in fact the correct one as it matches the definition in
arch/arm/boot/compressed/string.c.

Fixes: 7deabd674988 ("dyndbg: use the module notifier callbacks")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
The patch that caused the problem is in linux-next, maybe fold
the fix into that patch if possible
---
 arch/arm/boot/compressed/decompress.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 74255e819831..0669851394f0 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -31,6 +31,7 @@
 /* Not needed, but used in some headers pulled in by decompressors */
 extern char * strstr(const char * s1, const char *s2);
 extern size_t strlen(const char *s);
+extern int strcmp(const char *cs, const char *ct);
 extern int memcmp(const void *cs, const void *ct, size_t count);
 extern char * strchrnul(const char *, int);
 
-- 
2.39.2


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

* Re: [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor
  2023-03-10 14:01 [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor Arnd Bergmann
@ 2023-03-10 14:15 ` Jason Baron
  2023-03-10 14:23 ` Vincenzo Palazzo
  2023-03-10 18:29 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Baron @ 2023-03-10 14:15 UTC (permalink / raw)
  To: Arnd Bergmann, Vincenzo Palazzo, Luis Chamberlain
  Cc: Arnd Bergmann, Russell King, linux-arm-kernel, linux-kernel

On 3/10/23 9:01 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> After a change to linux/module.h, dyndbg.h is now included
> indirectly from the decompressor for lz4 support, which in turn
> causes a build failure on 32-bit Arm:
> 
> In file included from include/linux/module.h:30,
>                   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:59:
> include/linux/dynamic_debug.h: In function 'ddebug_dyndbg_module_param_cb':
> include/linux/dynamic_debug.h:307:14: error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
>    307 |         if (!strcmp(param, "dyndbg")) {
>        |              ^~~~~~
> include/linux/dynamic_debug.h:1:1: note: 'strcmp' is defined in header '<string.h>'; did you forget to '#include <string.h>'?
>    +++ |+#include <string.h>
> 
> The decompressor has its own replacement for the linux/string.h contents,
> so the normal declaration is not visible here. Since the function is
> not actually called, it is sufficient to add a declaration, and this
> is in fact the correct one as it matches the definition in
> arch/arm/boot/compressed/string.c.
> 
> Fixes: 7deabd674988 ("dyndbg: use the module notifier callbacks")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> The patch that caused the problem is in linux-next, maybe fold
> the fix into that patch if possible
> ---
>   arch/arm/boot/compressed/decompress.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
> index 74255e819831..0669851394f0 100644
> --- a/arch/arm/boot/compressed/decompress.c
> +++ b/arch/arm/boot/compressed/decompress.c
> @@ -31,6 +31,7 @@
>   /* Not needed, but used in some headers pulled in by decompressors */
>   extern char * strstr(const char * s1, const char *s2);
>   extern size_t strlen(const char *s);
> +extern int strcmp(const char *cs, const char *ct);
>   extern int memcmp(const void *cs, const void *ct, size_t count);
>   extern char * strchrnul(const char *, int);
>   


Hi Arnd,

Thank you for the fix up, I was about to look into this...

Acked-by: Jason Baron <jbaron@akamai.com>

Thanks,

-Jason

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

* Re: [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor
  2023-03-10 14:01 [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor Arnd Bergmann
  2023-03-10 14:15 ` Jason Baron
@ 2023-03-10 14:23 ` Vincenzo Palazzo
  2023-03-10 18:29 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Vincenzo Palazzo @ 2023-03-10 14:23 UTC (permalink / raw)
  To: Arnd Bergmann, Luis Chamberlain, Jason Baron
  Cc: Arnd Bergmann, Russell King, linux-arm-kernel, linux-kernel

> From: Arnd Bergmann <arnd@arndb.de>
>
> After a change to linux/module.h, dyndbg.h is now included
> indirectly from the decompressor for lz4 support, which in turn
> causes a build failure on 32-bit Arm:
>
> In file included from include/linux/module.h:30,
>                  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:59:
> include/linux/dynamic_debug.h: In function 'ddebug_dyndbg_module_param_cb':
> include/linux/dynamic_debug.h:307:14: error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
>   307 |         if (!strcmp(param, "dyndbg")) {
>       |              ^~~~~~
> include/linux/dynamic_debug.h:1:1: note: 'strcmp' is defined in header '<string.h>'; did you forget to '#include <string.h>'?
>   +++ |+#include <string.h>
>
> The decompressor has its own replacement for the linux/string.h contents,
> so the normal declaration is not visible here. Since the function is
> not actually called, it is sufficient to add a declaration, and this
> is in fact the correct one as it matches the definition in
> arch/arm/boot/compressed/string.c.
>
> Fixes: 7deabd674988 ("dyndbg: use the module notifier callbacks")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>

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

* Re: [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor
  2023-03-10 14:01 [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor Arnd Bergmann
  2023-03-10 14:15 ` Jason Baron
  2023-03-10 14:23 ` Vincenzo Palazzo
@ 2023-03-10 18:29 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2023-03-10 18:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Vincenzo Palazzo, Jason Baron, Arnd Bergmann, Russell King,
	linux-arm-kernel, linux-kernel

On Fri, Mar 10, 2023 at 03:01:26PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> After a change to linux/module.h, dyndbg.h is now included
> indirectly from the decompressor for lz4 support, which in turn
> causes a build failure on 32-bit Arm:
> 
> In file included from include/linux/module.h:30,
>                  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:59:
> include/linux/dynamic_debug.h: In function 'ddebug_dyndbg_module_param_cb':
> include/linux/dynamic_debug.h:307:14: error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
>   307 |         if (!strcmp(param, "dyndbg")) {
>       |              ^~~~~~
> include/linux/dynamic_debug.h:1:1: note: 'strcmp' is defined in header '<string.h>'; did you forget to '#include <string.h>'?
>   +++ |+#include <string.h>
> 
> The decompressor has its own replacement for the linux/string.h contents,
> so the normal declaration is not visible here. Since the function is
> not actually called, it is sufficient to add a declaration, and this
> is in fact the correct one as it matches the definition in
> arch/arm/boot/compressed/string.c.
> 
> Fixes: 7deabd674988 ("dyndbg: use the module notifier callbacks")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> The patch that caused the problem is in linux-next, maybe fold
> the fix into that patch if possible
> ---

Thanks for figuring this out, Arnd! Pushed to modules-next!

  Luis

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

end of thread, other threads:[~2023-03-10 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 14:01 [PATCH] ARM: dyndbg: allow including dyndbg.h in decompressor Arnd Bergmann
2023-03-10 14:15 ` Jason Baron
2023-03-10 14:23 ` Vincenzo Palazzo
2023-03-10 18:29 ` Luis Chamberlain

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).