0

I'm trying to cross-compile (arm64) a custom module on my linux box. So what I did so far is:

  • install the target Kernel sources
  • install the cross-compiler
  • enable module and build the Kernels with the cross-compiler. So far, so good, at the end I have an "Image" file correctly built

Now, I'm trying to build my module. I move in the folder where I have the sources. This is the Makefile:

bj-m := my_module.o
PWD := $(shell pwd)
DEBUG := 1
my_module-objs += my_module_core.o my_module_utils.o
ccflags-y += -O2 -Wall -DDEBUG

all:
        make ARCH=arm64 CROSS_COMPILE=$(CROSS) -C $(KERNEL) M=$(PWD) modules

Then I try to run the build with

make KERNEL=/tmp/linux-kernel-src/ CROSS=aarch64-linux-gnu-

and I get this result:

make[1]: Entering directory '/tmp/linux-kernel-src'
  Building modules, stage 2.
  MODPOST 0 modules
make[1]: Leaving directory '/tmp/linux-kernel-src'

So it looks like I have no errors, but the build process is just skipping all the files contained in my current folder which should be compiled and nothing happens.

I think I'm missing something obvious...but I'm not catching what...do you have any idea?

I saw another post with a very similar issue (Building kernel module), but this had a square bracket in the path and this is not my case.

Thanks a lot!

0

1 Answer 1

0

OK, I'm officially stupid! I found it out, it was just missing "o" at the beginning of the Makefile

:-(

obj-m := my_module.o

Sorry for this!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.