anbox-modules icon indicating copy to clipboard operation
anbox-modules copied to clipboard

Compile error with CentOS 7 kernel

Open fwittekind4 opened this issue 7 years ago • 5 comments

DKMS make.log for anbox-ashmem-1 for kernel 3.10.0-957.el7.x86_64 (x86_64) Sun Dec 2 14:14:33 EST 2018 make -C /lib/modules/3.10.0-957.el7.x86_64/build V=0 M=$PWD make[1]: Entering directory /usr/src/kernels/3.10.0-957.el7.x86_64' LD /var/lib/dkms/anbox-ashmem/1/build/built-in.o CC [M] /var/lib/dkms/anbox-ashmem/1/build/deps.o CC [M] /var/lib/dkms/anbox-ashmem/1/build/ashmem.o /var/lib/dkms/anbox-ashmem/1/build/deps.c: In function ‘shmem_zero_setup’: /var/lib/dkms/anbox-ashmem/1/build/deps.c:9:24: warning: assignment makes pointer from integer without a cast [enabled by default] shmem_zero_setup_ptr = kallsyms_lookup_name("shmem_zero_setup"); ^ /var/lib/dkms/anbox-ashmem/1/build/deps.c: At top level: cc1: warning: unrecognized command line option "-Wno-int-conversion" [enabled by default] /var/lib/dkms/anbox-ashmem/1/build/ashmem.c: In function ‘ashmem_read’: /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:321:3: warning: passing argument 2 of ‘kernel_read’ makes integer from pointer without a cast [enabled by default] ret = kernel_read(asma->file, buf, len, pos); ^ In file included from /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:25:0: include/linux/fs.h:2855:12: note: expected ‘loff_t’ but argument is of type ‘char *’ extern int kernel_read(struct file *, loff_t, char *, unsigned long); ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:321:3: warning: passing argument 3 of ‘kernel_read’ makes pointer from integer without a cast [enabled by default] ret = kernel_read(asma->file, buf, len, pos); ^ In file included from /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:25:0: include/linux/fs.h:2855:12: note: expected ‘char *’ but argument is of type ‘size_t’ extern int kernel_read(struct file *, loff_t, char *, unsigned long); ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:321:3: warning: passing argument 4 of ‘kernel_read’ makes integer from pointer without a cast [enabled by default] ret = kernel_read(asma->file, buf, len, pos); ^ In file included from /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:25:0: include/linux/fs.h:2855:12: note: expected ‘long unsigned int’ but argument is of type ‘loff_t *’ extern int kernel_read(struct file *, loff_t, char *, unsigned long); ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c: In function ‘ashmem_mmap’: /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:387:2: error: too few arguments to function ‘calc_vm_prot_bits’ if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) & ^ In file included from /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:30:0: include/linux/mman.h:110:1: note: declared here calc_vm_prot_bits(unsigned long prot, unsigned long pkey) ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:387:2: error: too few arguments to function ‘calc_vm_prot_bits’ if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) & ^ In file included from /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:30:0: include/linux/mman.h:110:1: note: declared here calc_vm_prot_bits(unsigned long prot, unsigned long pkey) ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c: In function ‘ashmem_shrink_scan’: /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:461:10: error: ‘SHRINK_STOP’ undeclared (first use in this function) return SHRINK_STOP; ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:461:10: note: each undeclared identifier is reported only once for each function it appears in /var/lib/dkms/anbox-ashmem/1/build/ashmem.c: At top level: /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:494:2: error: unknown field ‘count_objects’ specified in initializer .count_objects = ashmem_shrink_count, ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:494:2: warning: initialization from incompatible pointer type [enabled by default] /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:494:2: warning: (near initialization for ‘ashmem_shrinker.shrink’) [enabled by default] /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:495:2: error: unknown field ‘scan_objects’ specified in initializer .scan_objects = ashmem_shrink_scan, ^ /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:495:2: warning: initialization makes integer from pointer without a cast [enabled by default] /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:495:2: warning: (near initialization for ‘ashmem_shrinker.seeks’) [enabled by default] /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:495:2: error: initializer element is not computable at load time /var/lib/dkms/anbox-ashmem/1/build/ashmem.c:495:2: error: (near initialization for ‘ashmem_shrinker.seeks’) cc1: warning: unrecognized command line option "-Wno-int-conversion" [enabled by default] make[2]: *** [/var/lib/dkms/anbox-ashmem/1/build/ashmem.o] Error 1 make[1]: *** [_module_/var/lib/dkms/anbox-ashmem/1/build] Error 2 make[1]: Leaving directory /usr/src/kernels/3.10.0-957.el7.x86_64' make: *** [all] Error 2

fwittekind4 avatar Dec 02 '18 19:12 fwittekind4

SHRINK_STOP is defined in drm_backport.h, but including this causes more errors.

fwittekind4 avatar Dec 02 '18 19:12 fwittekind4

My kernel's version is 4.20 and I installed kernel-devel 4.20 rpm from pkgs.org. It works.

DinicChen avatar Feb 23 '19 02:02 DinicChen

how resolve this problem?

OmidAhmadyani avatar Feb 24 '19 06:02 OmidAhmadyani

edit /usr/src/anbox-ashmem-1/ashmem.c: line 383 currently reads #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(VZKERNEL) change that line to instead read #if 1 then insert these two lines in the includes at the top (around line 25) #include <drm/drm_backport.h> #include <linux/kern_levels.h>

Pascal666 avatar Nov 11 '19 07:11 Pascal666

@Pascal666 saved me on centos 7.6 with core 3.10, thx

AmBeta avatar Apr 21 '20 04:04 AmBeta