linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: module: fix modsign build error
@ 2018-07-06 12:48 Arnd Bergmann
  2018-07-06 13:00 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-07-06 12:48 UTC (permalink / raw)
  To: Jessica Yu, Russell King; +Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

The asm/module.h header file can not be included standalone, which
breaks the module signing code after a recent change:

In file included from kernel/module-internal.h:13,
                 from kernel/module_signing.c:17:
arch/arm/include/asm/module.h:37:27: error: 'struct module' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
 u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);

This adds a forward declaration of struct module to make it all work.

Fixes: f314dfea16a0 ("modsign: log module name in the event of an error")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I guess it would be useful if Jessica can pick this change up
in her tree that introduced the warning.
---
 arch/arm/include/asm/module.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 89ad0596033a..9e81b7c498d8 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -34,6 +34,7 @@ struct mod_arch_specific {
 #endif
 };
 
+struct module;
 u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
 
 /*
-- 
2.9.0


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

* Re: [PATCH] ARM: module: fix modsign build error
  2018-07-06 12:48 [PATCH] ARM: module: fix modsign build error Arnd Bergmann
@ 2018-07-06 13:00 ` Russell King - ARM Linux
  2018-07-09 18:34   ` Jessica Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2018-07-06 13:00 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Jessica Yu, linux-arm-kernel, linux-kernel

On Fri, Jul 06, 2018 at 02:48:47PM +0200, Arnd Bergmann wrote:
> The asm/module.h header file can not be included standalone, which
> breaks the module signing code after a recent change:
> 
> In file included from kernel/module-internal.h:13,
>                  from kernel/module_signing.c:17:
> arch/arm/include/asm/module.h:37:27: error: 'struct module' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>  u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
> 
> This adds a forward declaration of struct module to make it all work.
> 
> Fixes: f314dfea16a0 ("modsign: log module name in the event of an error")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

We used to have a general rule that where an asm/foo.h header and
linux/foo.h header exists, and the linux/foo.h includes the asm/foo.h,
then the linux/foo.h header will be used for including in .c files
rather than the asm/ version of the same.  Is there a reason why
that can't be done here?

That said, adding this is no bad thing.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>

Thanks.

> ---
> I guess it would be useful if Jessica can pick this change up
> in her tree that introduced the warning.
> ---
>  arch/arm/include/asm/module.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
> index 89ad0596033a..9e81b7c498d8 100644
> --- a/arch/arm/include/asm/module.h
> +++ b/arch/arm/include/asm/module.h
> @@ -34,6 +34,7 @@ struct mod_arch_specific {
>  #endif
>  };
>  
> +struct module;
>  u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
>  
>  /*
> -- 
> 2.9.0
> 

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 13.8Mbps down 630kbps up
According to speedtest.net: 13Mbps down 490kbps up

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

* Re: [PATCH] ARM: module: fix modsign build error
  2018-07-06 13:00 ` Russell King - ARM Linux
@ 2018-07-09 18:34   ` Jessica Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Jessica Yu @ 2018-07-09 18:34 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

+++ Russell King - ARM Linux [06/07/18 14:00 +0100]:
>On Fri, Jul 06, 2018 at 02:48:47PM +0200, Arnd Bergmann wrote:
>> The asm/module.h header file can not be included standalone, which
>> breaks the module signing code after a recent change:
>>
>> In file included from kernel/module-internal.h:13,
>>                  from kernel/module_signing.c:17:
>> arch/arm/include/asm/module.h:37:27: error: 'struct module' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>>  u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
>>
>> This adds a forward declaration of struct module to make it all work.
>>
>> Fixes: f314dfea16a0 ("modsign: log module name in the event of an error")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
>We used to have a general rule that where an asm/foo.h header and
>linux/foo.h header exists, and the linux/foo.h includes the asm/foo.h,
>then the linux/foo.h header will be used for including in .c files
>rather than the asm/ version of the same.  Is there a reason why
>that can't be done here?

Generally yes, it's just that in this case module_signing.c neither
needs nor includes linux/module.h. The needed load_info struct
definition just requires definitions for Elf_[SPE]hdr, Elf_Addr,
Elf_Sym, etc. and those are all defined in asm/module.h.

>That said, adding this is no bad thing.
>
>Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
>
>Thanks.

Thanks! Queued in modules-next.

Jessica

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

end of thread, other threads:[~2018-07-09 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 12:48 [PATCH] ARM: module: fix modsign build error Arnd Bergmann
2018-07-06 13:00 ` Russell King - ARM Linux
2018-07-09 18:34   ` Jessica Yu

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