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

Cannot compile on kernel 6.3.1 #15

Open
olm52 opened this issue May 4, 2023 · 6 comments
Open

Cannot compile on kernel 6.3.1 #15

olm52 opened this issue May 4, 2023 · 6 comments

Comments

@olm52
Copy link

olm52 commented May 4, 2023

Cannot compile on kernel 6.3.1. This is the output:

[audiolinux@audiolinux snd-hdspe]$ make gcc -MM sound/pci/hdsp/hdspe/hdspe*.c > deps make W=1 -C /lib/modules/6.3.1-1-cachyos-rt/build M=/home/audiolinux/Downloads/Temp/snd-hdspe modules warning: the compiler differs from the one used to build the kernel The kernel was built by: clang version 15.0.7 You are using: gcc (GCC) 13.1.1 20230429 CC [M] /home/audiolinux/Downloads/Temp/snd-hdspe/sound/pci/hdsp/hdspe/hdspe_core.o gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’ make[4]: *** [scripts/Makefile.build:252: /home/audiolinux/Downloads/Temp/snd-hdspe/sound/pci/hdsp/hdspe/hdspe_core.o] Error 1 make[3]: *** [scripts/Makefile.build:494: /home/audiolinux/Downloads/Temp/snd-hdspe/sound/pci/hdsp/hdspe] Error 2 make[2]: *** [scripts/Makefile.build:494: /home/audiolinux/Downloads/Temp/snd-hdspe/sound/pci/hdsp] Error 2 make[1]: *** [Makefile:2023: /home/audiolinux/Downloads/Temp/snd-hdspe] Error 2 make: *** [Makefile:17: default] Error 2

@Schroedingers-Cat
Copy link

You can try to use the fork from this MR: #12

I've tested it with Kernel v6.3 and it works fine.

@jimfrench
Copy link

Confirm still working on 6.3.1 , looks like a workflow issue here during compilation, kernel module should be loadable by DKMS as in original installation instructions, but using the fork instead , trying to compile with a GCC command line like that will throw errors, try cleaning then going back to original install method followed by #12
Updating the kernel should , on DKMS enabled systems, carry forward the new driver without needing to re-compiling the driver

@olm52
Copy link
Author

olm52 commented May 6, 2023

You can try to use the fork from this MR: #12

I've tested it with Kernel v6.3 and it works fine.

Not here with kernel 6.3.1 and gcc 13.1.
Same error gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’

@jimfrench
Copy link

Not here with kernel 6.3.1 and gcc 13.1.
Same error gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’

snd-hdspe is an out of tree driver, therefore it needs to be compiled with the same compiler as was used to compile the kernel, in your case the kernel was compiled with clang, and you're trying to compile the driver with gcc. This is not a compatible workflow. Unsure of best solution, you could try compiling the driver with clang, but it will get messy and need work. Might be easier to swap to a kernel compiled with GCC

@olm52
Copy link
Author

olm52 commented May 6, 2023

Tried with clang:

[audiolinux@audiolinux snd-hdspe.ORIG]$ BUILD_FLAGS=( CC=clang LD=ld.lld LLVM=1 LLVM_IAS=1 ) make ${BUILD_FLAGS[*]} -C /lib/modules/uname -r/build M=$PWD CC [M] /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.o In file included from /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.c:38: /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.h:15:9: warning: 'CONFIG_SND_DEBUG' macro redefined [-Wmacro-redefined] #define CONFIG_SND_DEBUG ^ ./include/generated/autoconf.h:6547:9: note: previous definition is here #define CONFIG_SND_DEBUG 1 ^ In file included from /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.c:38: /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.h:132:9: warning: unknown pragma ignored [-Wunknown-pragmas] #pragma scalar_storage_order little-endian ^ /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.h:729:9: warning: unknown pragma ignored [-Wunknown-pragmas] #pragma scalar_storage_order default ^ /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.c:425:8: error: call to undeclared function 'pci_set_dma_mask'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] err = pci_set_dma_mask(pci, DMA_BIT_MASK(32)); ^ /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.c:427:9: error: call to undeclared function 'pci_set_consistent_dma_mask'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] err = pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)); ^ 3 warnings and 2 errors generated. make[3]: *** [scripts/Makefile.build:252: /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe/hdspe_core.o] Error 1 make[2]: *** [scripts/Makefile.build:494: /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp/hdspe] Error 2 make[1]: *** [scripts/Makefile.build:494: /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG/sound/pci/hdsp] Error 2 make: *** [Makefile:2023: /home/audiolinux/Downloads/Temp/snd-hdspe.ORIG] Error 2

@jimfrench
Copy link

Tried with clang:

You can't really expect a driver to compile with a different compiler without it first needing a lot of work unless it was originally written to be cross-compatible, which hdspe-snd is not. The code would need work to be compatible.

The easiest and tidiest solution is swapping to a GCC kernel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants