Details
-
Bug
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
3
-
9223372036854775807
Description
gcc9 introduced new checks:
- address-of-packed-member
- missing-attributes
it's easier to disable those for a while..
Attachments
Activity
Building the same codes with gcc 9.4.0 on Ubuntu 20.04.5 with kernel 5.4.0-135-generic passed.
Building master branch with gcc 9.2.1 on RHEL 8.6 failed as follows:
# gcc --version | head -1 gcc (GCC) 9.2.1 20191120 (Red Hat 9.2.1-2) # git clone git://git.whamcloud.com/fs/lustre-release.git # cd lustre-release/ # sh autogen.sh # ./configure --disable-server --with-linux=/usr/src/kernels/4.18.0-372.32.1.el8_6.x86_64 # make -j $(nproc)
/root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c: In function ‘kiblnd_unpack_rd’: /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:147:13: error: taking address of packed member of ‘struct kib_rdma_desc’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 147 | __swab32s(&rd->rd_key); | ^~~~~~~~~~~ <~snip~> /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c: In function ‘kiblnd_unpack_msg’: /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:264:13: error: taking address of packed member of ‘struct kib_msg’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 264 | __swab64s(&msg->ibm_srcnid); | ^~~~~~~~~~~~~~~~ <~snip~> /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c: At top level: /usr/src/kernels/4.18.0-372.32.1.el8_6.x86_64/include/linux/module.h:129:6: error: ‘init_module’ specifies less restrictive attribute than its target ‘ko2iblnd_init’: ‘cold’ [-Werror=missing-attributes] 129 | int init_module(void) __attribute__((alias(#initfn))); | ^~~~~~~~~~~ /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:3908:1: note: in expansion of macro ‘module_init’ 3908 | module_init(ko2iblnd_init); | ^~~~~~~~~~~ /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:3888:19: note: ‘init_module’ target declared here 3888 | static int __init ko2iblnd_init(void) | ^~~~~~~~~~~~~ <~snip~> from /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:38: /usr/src/kernels/4.18.0-372.32.1.el8_6.x86_64/include/linux/module.h:135:7: error: ‘cleanup_module’ specifies less restrictive attribute than its target ‘ko2iblnd_exit’: ‘cold’ [-Werror=missing-attributes] 135 | void cleanup_module(void) __attribute__((alias(#exitfn))); | ^~~~~~~~~~~~~~ /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:3909:1: note: in expansion of macro ‘module_exit’ 3909 | module_exit(ko2iblnd_exit); | ^~~~~~~~~~~ /root/lustre-release/lnet/klnds/o2iblnd/o2iblnd.c:3883:20: note: ‘cleanup_module’ target declared here 3883 | static void __exit ko2iblnd_exit(void) | ^~~~~~~~~~~~~ <~snip~>
CC [M] /root/lustre-release/libcfs/libcfs/module.o CC [M] /root/lustre-release/libcfs/libcfs/tracefile.o In file included from /root/lustre-release/libcfs/libcfs/module.c:32: include/linux/module.h:129:6: error: ‘init_module’ specifies less restrictive attribute than its target ‘libcfs_init’: ‘cold’ [-Werror=missing-attributes] 129 | int init_module(void) __attribute__((alias(#initfn))); | ^~~~~~~~~~~ /root/lustre-release/libcfs/libcfs/module.c:962:1: note: in expansion of macro ‘module_init’ 962 | module_init(libcfs_init); | ^~~~~~~~~~~ /root/lustre-release/libcfs/libcfs/module.c:847:19: note: ‘init_module’ target declared here 847 | static int __init libcfs_init(void) | ^~~~~~~~~~~ In file included from /root/lustre-release/libcfs/libcfs/module.c:32: include/linux/module.h:135:7: error: ‘cleanup_module’ specifies less restrictive attribute than its target ‘libcfs_exit’: ‘cold’ [-Werror=missing-attributes] 135 | void cleanup_module(void) __attribute__((alias(#exitfn))); | ^~~~~~~~~~~~~~ /root/lustre-release/libcfs/libcfs/module.c:963:1: note: in expansion of macro ‘module_exit’ 963 | module_exit(libcfs_exit); | ^~~~~~~~~~~ /root/lustre-release/libcfs/libcfs/module.c:918:20: note: ‘cleanup_module’ target declared here 918 | static void __exit libcfs_exit(void) | ^~~~~~~~~~~ cc1: all warnings being treated as errors make[6]: *** [scripts/Makefile.build:317: /root/lustre-release/libcfs/libcfs/module.o] Error 1
We just ran into this issue with the lustre test module kinode.c. It appears to be related to https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0b999ae3614d09d97a1575936bcee884f912b10e
Also MOFED doesn't seem to build with gcc 9 as well
Is it only ldiskfs? Also what ldiskfs series is being use on Fedora?
here is example:
In file included from /home/alexey/head1/ldiskfs/super.c:20: include/linux/module.h:132:6: error: ‘init_module’ specifies less restrictive attribute than its target ‘ldiskfs_init_fs’: ‘cold’ [-Werror=missing-attributes] 132 | int init_module(void) __attribute__((alias(#initfn))); | ^~~~~~~~~~~ /home/alexey/head1/ldiskfs/super.c:6003:1: note: in expansion of macro ‘module_init’ 6003 | module_init(ldiskfs_init_fs) | ^~~~~~~~~~~ /home/alexey/head1/ldiskfs/super.c:5930:19: note: ‘init_module’ target declared here 5930 | static int __init ldiskfs_init_fs(void) | ^~~~~~~~~~~~~~~ In file included from /home/alexey/head1/ldiskfs/super.c:20:
I wonder what the default flags are for fedora. I'm using
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
What are the build failures you are still seeing?
OK, I've just tried w/o the original (silly) patch dropped, here is a small snippet:
In file included from /home/alexey/head2/ldiskfs/super.c:20: include/linux/module.h:132:6: error: ‘init_module’ specifies less restrictive attribute than its target ‘ldiskfs_init_fs’: ‘cold’ [-Werror=missing-attributes] 132 | int init_module(void) __attribute__((alias(#initfn))); | ^~~~~~~~~~~ /home/alexey/head2/ldiskfs/super.c:6003:1: note: in expansion of macro ‘module_init’ 6003 | module_init(ldiskfs_init_fs) | ^~~~~~~~~~~ /home/alexey/head2/ldiskfs/super.c:5930:19: note: ‘init_module’ target declared here 5930 | static int __init ldiskfs_init_fs(void) | ^~~~~~~~~~~~~~~
I'm trying to build and install gcc 9.4.0 on RHEL 8.6 to see how the Lustre client build goes.