Kernel module cross-compile: unrecognized command-line option ‘-mrecord-mcount’
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-12-cross (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I'm trying to build the external kernel module via cross-compilation for ARM64 on Ubuntu 23.04 and I'm getting following output w/error:
make -C /lib/modules/
make[1]: Wejście do katalogu '/usr/src/
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-
You are using: aarch64-
CC [M] /home/user/
aarch64-
make[2]: *** [scripts/
make[1]: *** [Makefile:2026: /home/user/
make[1]: Opuszczenie katalogu '/usr/src/
make: *** [Makefile:9: modules] Błąd 2
The key one being `unrecognized command-line option ‘-mrecord-mcount’`, what - according to Google - was a problem with some old <5 gcc. Why am I facing this today?
My invocation for the build process:
ARCH=arm64 CROSS_COMPILE=
The `Makefile` I'm using:
obj-m := my-module.o
KERNELDIR ?= /lib/modules/
all default: modules
install: modules_install
modules modules_install help clean:
$(MAKE) -C $(KERNELDIR) M=$(shell pwd) $@