-Werror=missing-attributes when compiling kernel modules L4T 32.4.4

I like to compile the kernel modules of L4T 32.4.4 (kernel 4.9.140). When I call make modules I get the error

In file included from crypto/md4.c:26:
./include/linux/module.h:133:6: error: ‘init_module’ specifies less restrictive attribute than its target ‘md4_mod_init’: ‘cold’ [-Werror=missing-attributes]
  133 |  int init_module(void) __attribute__((alias(#initfn)));
      |      ^~~~~~~~~~~
crypto/md4.c:253:1: note: in expansion of macro ‘module_init’
  253 | module_init(md4_mod_init);
      | ^~~~~~~~~~~
crypto/md4.c:243:19: note: ‘init_module’ target declared here
  243 | static int __init md4_mod_init(void)
      |                   ^~~~~~~~~~~~
In file included from crypto/md4.c:26:
./include/linux/module.h:139:7: error: ‘cleanup_module’ specifies less restrictive attribute than its target ‘md4_mod_fini’: ‘cold’ [-Werror=missing-attributes]
  139 |  void cleanup_module(void) __attribute__((alias(#exitfn)));
      |       ^~~~~~~~~~~~~~
crypto/md4.c:254:1: note: in expansion of macro ‘module_exit’
  254 | module_exit(md4_mod_fini);
      | ^~~~~~~~~~~
crypto/md4.c:248:20: note: ‘cleanup_module’ target declared here
  248 | static void __exit md4_mod_fini(void)
      |                    ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:342: crypto/md4.o] Fehler 1
make: *** [Makefile:1104: crypto] Fehler 2

Any suggestions?

hello diewet,

it’s GCC9 compile failure, please check whether you had this attribute, __copy(symbol) .
here’s related code change for your reference, commit 0b999ae3614d09d97a1575936bcee884f912b10e.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.