[OpenAFS] Re: openafs fails to compile

Cheyenne Wills cwills@sinenomine.net
Mon, 31 Oct 2022 20:44:31 +0000


I was able to duplicate the problem (using the elrepo kernel and the devtoo=
lset 9), but I was unable to duplicate the error on a Fedora36 system (kern=
el 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 li=
nux kernel features.  The gcc compiler options are overly strict when confi=
gure is ran in this environment (for example -Wunused-variable is being fla=
gged as an error in several of the autoconf tests).   The problem is that t=
he kernel you are using has the kernel config CONFIG_WERROR=3DY which is kn=
own to cause cause build problems (see the kernel commit "kbuild: Only defa=
ult to -Werror if COMPILE_TEST"  b339ec9c229aaf399296a120d7be0e34fbc355ca -=
- specifically "The appropriate usecase for -Werror is therefore compile-te=
st focused builds (often done by developers or CI systems).")

Also, note that openafs-stable-1_8_9pre1 will not build against a 6.0 kerne=
l, 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 be=
half 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 r=
ecent versions of gcc (9.3.1), so that is what is also used when DKMS compi=
ling. 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/bu=
ild/src/libafs/MODLOAD-5.19.12-1.el7.elrepo.x86_64-SP'
env EXTRA_CFLAGS=3D"" /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 open=
afs.ko /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/config/Makefil=
e.config Makefile.afs Makefile.common
( env EXTRA_CFLAGS=3D"" \
        make -C /lib/modules/5.19.12-1.el7.elrepo.x86_64/build M=3D/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/MODL=
OAD-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:7=
8:21: error: field =91va_atime=92 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:7=
9:21: error: field =91va_mtime=92 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:8=
0:21: error: field =91va_ctime=92 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 Lin=
ux 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 =91osi_GetTime=92:
/var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/build/src/afs/LINUX/osi_machdep=
.h:114:20: error: storage size of =91now=92 isn=92t 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 =91do_gettimeofday=92; di=
d you mean =91do_settimeofday64=92? [-Werror=3Dimplicit-function-declaratio=
n]
  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 =91now=92 [-Werror=3Dunused-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 =91uid_eq=92
  242 | static inline unsigned char uid_eq(uid_t a, uid_t b) {return a =3D=
=3D 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 =91uid_eq=92 w=
as 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 =91gid_eq=92
  243 | static inline unsigned char gid_eq(gid_t a, gid_t b) {return a =3D=
=3D 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 =91gid_eq=92 w=
as 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 =91uid_lt=92
  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 =91uid_lt=92 w=
as 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 =91gid_lt=92
  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 =91gid_lt=92 w=
as 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 def=
inition
   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 def=
inition
   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-k=
ernel.o] Error 1
make[3]: *** [Makefile:1846: /var/lib/dkms/openafs/1.9.1-1.223.gd38b.el7/bu=
ild/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/bui=
ld/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/bui=
ld/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