编译linux驱动出错

原文链接: https://blog.csdn.net/k7arm/article/details/90692334#commentBox

切换交叉编译器 编译出错

make CROSS_COMPILE=aarch64-linux-gnu- -C /home/rksdk/kernel M=/root/Desktop/ljdRF433 modules
make[1]: Entering directory '/home/rksdk/kernel'
  CC [M]  /root/Desktop/ljdRF433/RF433.o
aarch64-linux-gnu-gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
aarch64-linux-gnu-gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mapcs’
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mno-sched-prolog’
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msoft-float’
scripts/Makefile.build:283: recipe for target '/root/Desktop/ljdRF433/RF433.o' failed
make[2]: *** [/root/Desktop/ljdRF433/RF433.o] Error 1
Makefile:1456: recipe for target '_module_/root/Desktop/ljdRF433' failed
make[1]: *** [_module_/root/Desktop/ljdRF433] Error 2
make[1]: Leaving directory '/home/rksdk/kernel'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2
root@seekway-Aspire-ES1-433G:~/Desktop/ljdRF433# make
make -C /home/rksdk/kernel/ modules  M=`pwd`    
make[1]: Entering directory '/home/rksdk/kernel'
  CC [M]  /root/Desktop/ljdRF433/RF433.o
aarch64-linux-gnu-gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
aarch64-linux-gnu-gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mapcs’
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mno-sched-prolog’
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msoft-float’
scripts/Makefile.build:283: recipe for target '/root/Desktop/ljdRF433/RF433.o' failed
make[2]: *** [/root/Desktop/ljdRF433/RF433.o] Error 1
Makefile:1456: recipe for target '_module_/root/Desktop/ljdRF433' failed
make[1]: *** [_module_/root/Desktop/ljdRF433] Error 2
make[1]: Leaving directory '/home/rksdk/kernel'
Makefile:8: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

arm-linux-gnueabihf- ->  aarch64-linux-gnu-

更改编译器出错需更改 ARCH=arm64

export ARCH=arm  ->  export ARCH=arm64


Makefile

# kernel path
KDIR := /home/rksdk/kernel/
obj-m += RF433.o

# export ARCH=arm
# export CROSS_COMPILE=arm-linux-gnueabihf-
# CROSS_COMPILE
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-

all:
        make -C $(KDIR) modules  M=`pwd`        

.PHONY : clean
clean:
        make -C $(KDIR) modules clean  M=`pwd`

 

你可能感兴趣的:(linux,驱动,错,mabi=apcs-gnu,个人学习)