Subject: [Bug 203725] New: Build error: 'init_module' specifies less restrictive attribute than its target 'rtas_flash_init': 'cold'

From: [email-masked]
Date: Mon, 27 May 2019 14:42:30 +0000

https://bugzilla.kernel.org/show_bug.cgi?id=203725

            Bug ID: 203725
           Summary: Build error: 'init_module' specifies less restrictive
                    attribute than its target 'rtas_flash_init': 'cold'
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: 4.19.46
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: PPC-64
          Assignee: [email-masked]
          Reporter: [email-masked]
        Regression: No

Created attachment 282969
  --> https://bugzilla.kernel.org/attachment.cgi?id=282969&action=edit
Build log

I recently upgraded to GCC 9.1. This error appears while building 4.19.46. I'm
building with ppc64el. GCC 8.3 doesn't doesn't generate an error so that's my
workaround for now.

  powerpc64le-linux-gcc -Wp,-MD,arch/powerpc/kernel/.rtas_flash.o.d  -nostdinc
-isystem /home/jason/toolchain/bin/../lib/gcc/powerpc64le-linux/9.1.0/include
-I./arch/powerpc/include -I./arch/powerpc/include/generated  -I./include
-I./arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi
-I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h
-include ./include/linux/compiler_types.h -D__KERNEL__ -Iarch/powerpc
-DHAVE_AS_ATHIGH=1 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -fshort-wchar
-Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE
-DCC_HAVE_ASM_GOTO -mlittle-endian -m64 -msoft-float -pipe -Iarch/powerpc
-mtraceback=no -mabi=elfv2 -mcmodel=medium -mno-pointers-to-nested-functions
-mcpu=power8 -mtune=power9 -mno-altivec -mno-vsx -funit-at-a-time
-fno-dwarf2-cfi-asm -mno-string -Wa,-maltivec -Wa,-mpower4 -Wa,-many
-mno-strict-align -mlittle-endian -fno-delete-null-pointer-checks
-Wno-frame-address -Wno-format-truncation -Wno-format-overflow
-Wno-int-in-bool-context -O2 --param=allow-store-data-races=0
-Wframe-larger-than=2048 -fno-stack-protector -Wno-unused-but-set-variable
-Wno-unused-const-variable -fno-var-tracking-assignments -pg -mprofile-kernel
-Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation
-fno-strict-overflow -fno-merge-all-constants -fmerge-constants
-fno-stack-check -fconserve-stack -Werror=implicit-int
-Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types
-Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -Werror 
-DMODULE -mno-save-toc-indirect -mcmodel=large 
-DKBUILD_BASENAME='"rtas_flash"' -DKBUILD_MODNAME='"rtas_flash"' -c -o
arch/powerpc/kernel/rtas_flash.o arch/powerpc/kernel/rtas_flash.c
In file included from arch/powerpc/kernel/rtas_flash.c:16:
./include/linux/module.h:133:6: error: 'init_module' specifies less restrictive
attribute than its target 'rtas_flash_init': 'cold'
[-Werror=missing-attributes]
  133 |  int init_module(void) __attribute__((alias(#initfn)));
      |      ^~~~~~~~~~~
arch/powerpc/kernel/rtas_flash.c:779:1: note: in expansion of macro
'module_init'
  779 | module_init(rtas_flash_init);
      | ^~~~~~~~~~~
arch/powerpc/kernel/rtas_flash.c:703:19: note: 'init_module' target declared
here
  703 | static int __init rtas_flash_init(void)
      |                   ^~~~~~~~~~~~~~~
In file included from arch/powerpc/kernel/rtas_flash.c:16:
./include/linux/module.h:139:7: error: 'cleanup_module' specifies less
restrictive attribute than its target 'rtas_flash_cleanup': 'cold'
[-Werror=missing-attributes]
  139 |  void cleanup_module(void) __attribute__((alias(#exitfn)));
      |       ^~~~~~~~~~~~~~
arch/powerpc/kernel/rtas_flash.c:780:1: note: in expansion of macro
'module_exit'
  780 | module_exit(rtas_flash_cleanup);
      | ^~~~~~~~~~~
arch/powerpc/kernel/rtas_flash.c:759:20: note: 'cleanup_module' target declared
here
  759 | static void __exit rtas_flash_cleanup(void)
      |                    ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
scripts/Makefile.build:309: recipe for target
'arch/powerpc/kernel/rtas_flash.o' failed
make[1]: *** [arch/powerpc/kernel/rtas_flash.o] Error 1
Makefile:1051: recipe for target 'arch/powerpc/kernel' failed
make: *** [arch/powerpc/kernel] Error 2

-- 
You are receiving this mail because:
You are watching the assignee of the bug.