Cross compiling a kernel module

后端 未结 6 2022
囚心锁ツ
囚心锁ツ 2020-12-04 18:22

I\'m trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host.

The codesourcery tool chain for ARM is located at: /ho

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 18:49

    MODULES := hola_kern.o
    
    #guest architecture
    ARCH := arm
    
    CROSS_COMPILE := arm-linux-gnueabi-
    obj-m := $(MODULES)
    
    #path of the arm compiled kernel
    ROOTDIR := /home/aldo/c/proyectos/prefixa/work/kernels/linux-omap-5f0a6e2
    
    MAKEARCH := $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
    
    all: modules
    modules:
        $(MAKEARCH) -C $(ROOTDIR) M=${shell pwd} modules
    
    clean:
        $(MAKEARCH) -C $(ROOTDIR) M=${shell pwd} clean
    

提交回复
热议问题