[OpenAFS] Re: openafs fails to compile

Chad William Seys cwseys@physics.wisc.edu
Mon, 31 Oct 2022 16:22:59 -0500


Hi Cheyenne,
   Thanks so much for tracking down the problem!

I was about to request CONFIG_WERROR be turned off on elrepo kernels, 
but then I found this article stating that CONFIG_WERROR=y at least as 
of 5.18 was the default:

https://www.phoronix.com/news/Linux-5.18-x86-WERROR

Possibly I'll just recompile with =n to avoid pestering them for 
something they won't be interested in changing.

Thanks again!
C.


On 10/31/22 15:44, Cheyenne Wills wrote:
> I was able to duplicate the problem (using the elrepo kernel and the devtoolset 9), but I was unable to duplicate the error on a Fedora36 system (kernel 6.0.5-200.fc36.x86_64, gcc gcc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2)
> 
> In your environment, the openafs configure is failing to properly detect linux kernel features.  The gcc compiler options are overly strict when configure is ran in this environment (for example -Wunused-variable is being flagged as an error in several of the autoconf tests).   The problem is that the kernel you are using has the kernel config CONFIG_WERROR=Y which is known to cause cause build problems (see the kernel commit "kbuild: Only default to -Werror if COMPILE_TEST"  b339ec9c229aaf399296a120d7be0e34fbc355ca -- specifically "The appropriate usecase for -Werror is therefore compile-test focused builds (often done by developers or CI systems).")
> 
> Also, note that openafs-stable-1_8_9pre1 will not build against a 6.0 kernel, there is a pending patch in gerrit that I believe will be included in a 1.8.9pre2
> 
> Cheyenne Wills
> cwills@sinenomine.net
> ________________________________________
> From: openafs-info-admin@openafs.org <openafs-info-admin@openafs.org> on behalf of Chad W Seys <cwseys@physics.wisc.edu>
> Sent: Monday, October 31, 2022 8:18:59 AM
> To: openafs-info@openafs.org
> Subject: [OpenAFS] openafs fails to compile
> 
> Hi all,
>    I'm attempting to compile openafs from the git repo as described here:
> https://wiki.openafs.org/devel/HowToBuildOpenAfsRpmPackages/#index3h2
> 
> The userland tools compile and install fine, but the DKMS compilation fails.
> 
> This is on CentOS7, against ELRepo's kernel-ml version 5.19.12 and 6.0.5.  These kernels are compiled with Redhat's devtoolset 9 which contains more recent versions of gcc (9.3.1), so that is what is also used when DKMS compiling. I have tried the master tip (1.9.1-1.223.gd38b) and 1.8.9-pre1 tag.
> 
> The make.log error is:
> Building in directory: MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP
> make[2]: Entering directory '/var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP'
> env EXTRA_CFLAGS="" /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/make_kbuild_makefile.pl MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP openafs.ko /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/config/Makefile.config Makefile.afs Makefile.common
> ( env EXTRA_CFLAGS="" \
>          make -C /lib/modules/5.19.12-1.el7.elrepo.x86_64/build M=/var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP  modules 2>&1 \
>          || echo "FAILURE: make exit code $?" ) | tee .makelog
> make[3]: Entering directory '/usr/src/kernels/5.19.12-1.el7.elrepo.x86_64'
>    CC [M]  /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.o
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:27,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_vfs.h:78:21: error: field ‘va_atime’ has incomplete type
>     78 |     struct timespec va_atime;
>        |                     ^~~~~~~~
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_vfs.h:79:21: error: field ‘va_mtime’ has incomplete type
>     79 |     struct timespec va_mtime;
>        |                     ^~~~~~~~
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_vfs.h:80:21: error: field ‘va_ctime’ has incomplete type
>     80 |     struct timespec va_ctime;
>        |                     ^~~~~~~~
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:68:3: error: #error Not sure what to do about rlim (should be in the Linux task struct somewhere....)
>     68 | # error Not sure what to do about rlim (should be in the Linux task struct somewhere....)
>        |   ^~~~~
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h: In function ‘osi_GetTime’:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:114:20: error: storage size of ‘now’ isn’t known
>    114 |     struct timeval now;
>        |                    ^~~
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:115:5: error: implicit declaration of function ‘do_gettimeofday’; did you mean ‘do_settimeofday64’? [-Werror=implicit-function-declaration]
>    115 |     do_gettimeofday(&now);
>        |     ^~~~~~~~~~~~~~~
>        |     do_settimeofday64
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:114:20: error: unused variable ‘now’ [-Werror=unused-variable]
>    114 |     struct timeval now;
>        |                    ^~~
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h: At top level:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:242:29: error: conflicting types for ‘uid_eq’
>    242 | static inline unsigned char uid_eq(uid_t a, uid_t b) {return a == b;}
>        |                             ^~~~~~
> In file included from ./include/linux/stat.h:20,
>                   from ./include/linux/fcntl.h:5,
>                   from ./include/linux/net.h:20,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/sysincludes.h:121,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:30,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> ./include/linux/uidgid.h:61:20: note: previous definition of ‘uid_eq’ was here
>     61 | static inline bool uid_eq(kuid_t left, kuid_t right)
>        |                    ^~~~~~
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:243:29: error: conflicting types for ‘gid_eq’
>    243 | static inline unsigned char gid_eq(gid_t a, gid_t b) {return a == b;}
>        |                             ^~~~~~
> In file included from ./include/linux/stat.h:20,
>                   from ./include/linux/fcntl.h:5,
>                   from ./include/linux/net.h:20,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/sysincludes.h:121,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:30,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> ./include/linux/uidgid.h:66:20: note: previous definition of ‘gid_eq’ was here
>     66 | static inline bool gid_eq(kgid_t left, kgid_t right)
>        |                    ^~~~~~
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:244:29: error: conflicting types for ‘uid_lt’
>    244 | static inline unsigned char uid_lt(uid_t a, uid_t b) {return a < b;}
>        |                             ^~~~~~
> In file included from ./include/linux/stat.h:20,
>                   from ./include/linux/fcntl.h:5,
>                   from ./include/linux/net.h:20,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/sysincludes.h:121,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:30,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> ./include/linux/uidgid.h:91:20: note: previous definition of ‘uid_lt’ was here
>     91 | static inline bool uid_lt(kuid_t left, kuid_t right)
>        |                    ^~~~~~
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:245:29: error: conflicting types for ‘gid_lt’
>    245 | static inline unsigned char gid_lt(gid_t a, gid_t b) {return a < b;}
>        |                             ^~~~~~
> In file included from ./include/linux/stat.h:20,
>                   from ./include/linux/fcntl.h:5,
>                   from ./include/linux/net.h:20,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/sysincludes.h:121,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:30,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> ./include/linux/uidgid.h:96:20: note: previous definition of ‘gid_lt’ was here
>     96 | static inline bool gid_lt(kgid_t left, kgid_t right)
>        |                    ^~~~~~
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:246: error: "GLOBAL_ROOT_UID" redefined [-Werror]
>    246 | #define GLOBAL_ROOT_UID ((afs_kuid_t) 0)
>        |
> In file included from ./include/linux/stat.h:20,
>                   from ./include/linux/fcntl.h:5,
>                   from ./include/linux/net.h:20,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/sysincludes.h:121,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:30,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> ./include/linux/uidgid.h:55: note: this is the location of the previous definition
>     55 | #define GLOBAL_ROOT_UID KUIDT_INIT(0)
>        |
> In file included from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afs_osi.h:427,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx_clock.h:46,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/rx/rx.h:44,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/afsincludes.h:29,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:31,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep.h:247: error: "GLOBAL_ROOT_GID" redefined [-Werror]
>    247 | #define GLOBAL_ROOT_GID ((afs_kgid_t) 0)
>        |
> In file included from ./include/linux/stat.h:20,
>                   from ./include/linux/fcntl.h:5,
>                   from ./include/linux/net.h:20,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/sysincludes.h:121,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/crypto/hcrypto/kernel/config.h:30,
>                   from /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.c:34:
> ./include/linux/uidgid.h:56: note: this is the location of the previous definition
>     56 | #define GLOBAL_ROOT_GID KGIDT_INIT(0)
>        |
> cc1: all warnings being treated as errors
> make[4]: *** [scripts/Makefile.build:249: /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP/sha256-kernel.o] Error 1
> make[3]: *** [Makefile:1846: /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP] Error 2
> make[3]: Leaving directory '/usr/src/kernels/5.19.12-1.el7.elrepo.x86_64'
> FAILURE: make exit code 2
> make[2]: *** [Makefile.afs:282: openafs.ko] Error 1
> make[2]: Leaving directory '/var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP'
> make[1]: *** [Makefile:187: linux_compdirs] Error 2
> make[1]: Leaving directory '/var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/libafs'
> make: *** [Makefile:15: all] Error 2
> 
> 
> 
> Note that this kernel is not running when the DKMS compilation is attempted.
> 
> Thanks!
> Chad.
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info