Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 9.0: ‘init_module’ specifies less restrictive attribute than its target #8329

Closed
tonyhutter opened this issue Jan 23, 2019 · 1 comment
Assignees
Labels
Status: Blocked Depends on another pending change Type: Building Indicates an issue related to building binaries
Projects

Comments

@tonyhutter
Copy link
Contributor

System information

Type Version/Name
Distribution Name Fedora
Distribution Version 30 (rawhide)
Linux Kernel 5.0.0-0.rc3.git0.1.fc30.x86_64
Architecture x86-64
ZFS Version master
SPL Version master

Describe the problem you're observing

The upcoming GCC 9 release adds the -Wmissing-attributes warnings
(enabled by -Wall), which trigger for all the init/cleanup_module
aliases in the kernel (defined by the module_init/exit macros),
ending up being very noisy.

These aliases point to the __init/__exit functions of a module,
which are defined as __cold (among other attributes). However,
the aliases themselves do not have the __cold attribute.

Since the compiler behaves differently when compiling a __cold
function as well as when compiling paths leading to calls
to __cold functions, the warning is trying to point out
the possibly-forgotten attribute in the alias.

https://lore.kernel.org/lkml/20190123173707.GA16603@gmail.com/

This looks like a kernel problem that is being fixed.

Describe how to reproduce the problem

build master in latest updated rawhide

Include any warning/errors/backtraces from the system logs

  CC [M]  /home/hutter/50-kernel/module/spl/spl-generic.o
In file included from /home/hutter/50-kernel/include/spl/sys/sysmacros.h:28,
                 from /home/hutter/50-kernel/module/spl/spl-generic.c:27:
./include/linux/module.h:132:6: warning: ‘init_module’ specifies less restrictive attribute than its target ‘spl_init’: ‘cold’ [-Wmissing-attributes]
  132 |  int init_module(void) __attribute__((alias(#initfn)));
      |      ^~~~~~~~~~~
/home/hutter/50-kernel/module/spl/spl-generic.c:762:1: note: in expansion of macro ‘module_init’
  762 | module_init(spl_init);
      | ^~~~~~~~~~~
/home/hutter/50-kernel/module/spl/spl-generic.c:686:1: note: ‘init_module’ target declared here
  686 | spl_init(void)
      | ^~~~~~~~
@tonyhutter tonyhutter added Type: Building Indicates an issue related to building binaries Status: Blocked Depends on another pending change labels Jan 23, 2019
@tonyhutter tonyhutter self-assigned this Jan 23, 2019
@tonyhutter tonyhutter mentioned this issue Feb 4, 2019
12 tasks
@tonyhutter
Copy link
Contributor Author

I havn't tested it, but I believe this may have been fixed by:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0b999ae3614d09d97a1575936bcee884f912b10e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Depends on another pending change Type: Building Indicates an issue related to building binaries
Projects
No open projects
0.7.13
  
Awaiting triage
Development

No branches or pull requests

1 participant