編譯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`

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章