orangepi-xunlong / linux-orangepi

Other
200 stars 174 forks source link

Kernel build 5.10.110 for OPi5B - dma-buf drivers fail #56

Open vrbadev opened 12 months ago

vrbadev commented 12 months ago

Hello, I wanted to build the kernel on the OPi5B (Ubuntu focal server distro image) which has Linux kernel 5.10.110, so I cloned the branch orange-pi-5.10-rk3588.

However, when building the kernel with the make command, it fails for dma-buf drivers:

drivers/dma-buf/dma-buf.c: In function 'dma_buf_export_sync_file':
drivers/dma-buf/dma-buf.c:464:34: error: storage size of 'arg' isn't known
  464 |  struct dma_buf_export_sync_file arg;
      |                                  ^~~
  CC      security/apparmor/mount.o
drivers/dma-buf/dma-buf.c:484:8: error: implicit declaration of function 'dma_resv_get_singleton'; did you mean 'dma_resv_get_list'? [-Werror=implicit-function-declaration]
  484 |  ret = dma_resv_get_singleton(dmabuf->resv, write, &fence);
      |        ^~~~~~~~~~~~~~~~~~~~~~
      |        dma_resv_get_list
drivers/dma-buf/dma-buf.c:464:34: warning: unused variable 'arg' [-Wunused-variable]
error, forbidden warning:dma-buf.c:464
  464 |  struct dma_buf_export_sync_file arg;
      |                                  ^~~
drivers/dma-buf/dma-buf.c: In function 'dma_buf_import_sync_file':
drivers/dma-buf/dma-buf.c:520:34: error: storage size of 'arg' isn't known
  520 |  struct dma_buf_import_sync_file arg;
      |                                  ^~~
drivers/dma-buf/dma-buf.c:520:34: warning: unused variable 'arg' [-Wunused-variable]
error, forbidden warning:dma-buf.c:520
drivers/dma-buf/dma-buf.c: In function 'dma_buf_ioctl':
drivers/dma-buf/dma-buf.c:641:7: error: 'DMA_BUF_IOCTL_EXPORT_SYNC_FILE' undeclared (first use in this function)
  641 |  case DMA_BUF_IOCTL_EXPORT_SYNC_FILE:
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma-buf/dma-buf.c:641:7: note: each undeclared identifier is reported only once for each function it appears in
drivers/dma-buf/dma-buf.c:643:7: error: 'DMA_BUF_IOCTL_IMPORT_SYNC_FILE' undeclared (first use in this function)
  643 |  case DMA_BUF_IOCTL_IMPORT_SYNC_FILE:
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:273: drivers/dma-buf/dma-buf.o] Error 1
make[1]: *** [scripts/Makefile.build:516: drivers/dma-buf] Error 2
make: *** [Makefile:1920: drivers] Error 2
make: *** Waiting for unfinished jobs....

How to solve this?