編譯linux內核出錯 (設置編譯鏈)


按照  https://rocketboards.org/foswiki/Documentation/EmbeddedLinuxBeginnerSGuide 編譯linux內核,遇到報錯:

gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
gcc: error: unrecognized command line option ‘-mfpu=vfp’
Kbuild:21: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:1083: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

 參考rocketboard  https://rocketboards.org/foswiki/Documentation/EmbeddedLinuxBeginnerSGuide

的提示:

於是我設置交叉編譯環境變量 export CROSS_COMPILE=arm-linux-gnueabihf-。 但是這樣設置以后提示:未找到編譯鏈命令

 原來是沒有安裝編譯鏈,於是下發命令:wget http://releases.linaro.org/components/toolchain

/binaries/4.9-2016.02/arm-linux-gnueabihf/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf.tar.xz

解壓編譯鏈。

然后設置環境變量:

 這樣就可以正常編譯了!

 環境變量 也可以這樣設置:export CROSS_COMPILE=/home/terasic/桌面/DE10_NANO_SoC_GHRD/software/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM