Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking to a kernel module a precompiled object file

i'd need to link to my linux kernel module a precompiled object file. if i have a row in the makefile like this:

obj-m := test.o
test-objs := obj1.o obj2.o

where for obj1.o exists a obj1.c source file while obj2.o is a precompiled object file obj1 are correctly builded but make tries to build also obj2.o by searching an obj2.c source file. How can i specify that obj2.o is a precompiled object?

Thank you all!

like image 362
MirkoBanchi Avatar asked Feb 23 '23 18:02

MirkoBanchi


1 Answers

Simply rename the shipped .o file to .o_shipped. In your case :

  • leave your Makefile as is
  • mv obj2.o obj2.o_shipped
  • make and let the kernel build system magic do the work for you :)
like image 100
shodanex Avatar answered Feb 26 '23 19:02

shodanex