Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on RHEL9 #14

Closed
cyqsimon opened this issue Aug 17, 2023 · 3 comments · Fixed by #16
Closed

Build failure on RHEL9 #14

cyqsimon opened this issue Aug 17, 2023 · 3 comments · Fixed by #16

Comments

@cyqsimon
Copy link

cyqsimon commented Aug 17, 2023

DKMS make.log for gasket-0.0.git.250.9fef422e for kernel 5.14.0-284.25.1.el9_2.x86_64 (x86_64)
Thu Aug 17 09:37:16 PM CST 2023
make -C "/lib/modules/5.14.0-284.25.1.el9_2.x86_64/build" M="/var/lib/dkms/gasket/0.0.git.250.9fef422e/build" modules
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/usr/src/kernels/5.14.0-284.25.1.el9_2.x86_64'
  CC [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/gasket_core.o
  CC [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/gasket_ioctl.o
  CC [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/gasket_interrupt.o
  CC [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/gasket_page_table.o
  CC [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/gasket_sysfs.o
  LD [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/gasket.o
  CC [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/apex_driver.o
  LD [M]  /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/apex.o
  MODPOST /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/Module.symvers
ERROR: modpost: module gasket uses symbol dma_buf_detach from namespace DMA_BUF, but does not import it.
ERROR: modpost: module gasket uses symbol dma_buf_put from namespace DMA_BUF, but does not import it.
ERROR: modpost: module gasket uses symbol dma_buf_get from namespace DMA_BUF, but does not import it.
ERROR: modpost: module gasket uses symbol dma_buf_unmap_attachment from namespace DMA_BUF, but does not import it.
ERROR: modpost: module gasket uses symbol dma_buf_map_attachment from namespace DMA_BUF, but does not import it.
ERROR: modpost: module gasket uses symbol dma_buf_attach from namespace DMA_BUF, but does not import it.
make[2]: *** [scripts/Makefile.modpost:134: /var/lib/dkms/gasket/0.0.git.250.9fef422e/build/Module.symvers] Error 1
make[2]: *** Deleting file '/var/lib/dkms/gasket/0.0.git.250.9fef422e/build/Module.symvers'
make[1]: *** [Makefile:1838: modules] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.14.0-284.25.1.el9_2.x86_64'
make: *** [Makefile:15: all] Error 2

It seems like it's the same issue as #3. I can see that it's already patched in #6, but that patch only imports DMA_BUF on kernel version 5.16.0 or higher. I manually deleted the conditional checks and it compiled successfully.

I guess what's happening here is that a Redhat backport causes its "5.14.0" kernels to behave similarly to 5.16.0+ kernels. So my question is, is there a better way to check whether importing DMA_BUF namespace is necessary than a hard-coded version comparison? Sorry for not being of much help; I'm not a C developer.

@robertzaage
Copy link
Contributor

robertzaage commented Aug 17, 2023

Hmm, kernel backports are a real bummer...

How about this (untested)?

#if __has_include(<linux/dma-buf.h>)
    MODULE_IMPORT_NS(DMA_BUF);
#endif

@cyqsimon
Copy link
Author

Yep that does it! Verified to build on RHEL9 with your patch.

@robertzaage
Copy link
Contributor

Okay, thank you for verifying!
I'll create a PR for this, hoping that this method doesn't have any drawbacks. 😄

robertzaage added a commit to robertzaage/gasket-driver that referenced this issue Aug 18, 2023
…r DMA_BUF necessity. Solves incompatibility with backports in 5.1x.x (RedHat/Debian) kernels.
mbrooksx pushed a commit that referenced this issue Sep 5, 2023
…cessity. Solves incompatibility with backports in 5.1x.x (RedHat/Debian) kernels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants