Hi all,
I found another post that might be related.
I get the warning in the title when I run “make” to build a kernel module:
❯ make
warning: the compiler differs from the one used to build the kernel
The kernel was built by: clang version 21.1.6
You are using: gcc (GCC) 15.2.1 20251112
CC [M] it87.o
gcc: error: unrecognized command-line option ‘-mstack-alignment=8’
gcc: error: unrecognized command-line option ‘-mretpoline-external-thunk’
gcc: error: unrecognized command-line option ‘-fsplit-lto-unit’
make[3]: *** [/usr/lib/modules/6.18.2-2-cachyos/build/scripts/Makefile.build:287: it87.o] Error 1
make[2]: *** [/usr/lib/modules/6.18.2-2-cachyos/build/Makefile:2016: .] Error 2
make[1]: *** [Makefile:248: __sub-make] Error 2
make: *** [Makefile:81: modules] Error 2
I also tried specifying Clang as the compiler to use:
❯ make CC=clang
CC [M] it87.o
it87.c:3454:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
3454 | default:
| ^
it87.c:3454:3: note: insert 'break;' to avoid fall-through
3454 | default:
| ^
| break;
1 warning generated.
ld: unrecognised emulation mode: llvm
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386pep i386pe elf64bpf
make[3]: *** [/usr/lib/modules/6.18.2-2-cachyos/build/scripts/Makefile.build:287: it87.o] Error 1
make[3]: *** Deleting file 'it87.o'
make[2]: *** [/usr/lib/modules/6.18.2-2-cachyos/build/Makefile:2016: .] Error 2
make[1]: *** [Makefile:248: __sub-make] Error 2
make: *** [Makefile:81: modules] Error 2
Does anyone know why I can’t build the module using make alone?
Operating System: CachyOS Linux
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.18.2-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i5-13600K
Memory: 16 GiB of RAM (15.4 GiB usable)
Graphics Processor 1: AMD Radeon RX 7600
Graphics Processor 2: Intel® Graphics
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B760M GAMING X DDR4