红联Linux门户
Linux帮助

Ubuntu16.04(64bit)中制作arm-linux-gcc

发布时间:2016-05-07 15:04:31来源:OneSea作者:OneSea

Mini2440官方所提供的arm-linux-gcc是基于32位Linux系统的,在64位Linux中运行会出错(http://www.linuxdiyf.com/linux/20417.html)。在64位机时代里,继续使用32位Linux进行开发就显得有点out了。针对上述背景,本文在64位Linux中制作arm-linux-gcc工具,主要开发环境如下:

Ubuntu16.04(64bit)

arm-linux-gcc 4.6.3

Buildtroot


配置

下载Buildroot(https://buildroot.org/)源码并解压,进入其目录执行下述命令启动配置界面:

make menuconfig 

配置界面如下:

Ubuntu16.04(64bit)中制作arm-linux-gcc


第一次执行make menucofig时,可能会出错:

onesea@ubuntu:~/Mini2440/Buildroot/buildroot-2016.02$ make menuconfig  
mkdir -p /home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/lxdialog 
PKG_CONFIG_PATH="" make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \ 
obj=/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config -C support/kconfig -f Makefile.br mconf 
/usr/bin/gcc -DCURSES_LOC="<curses.h>" -DLOCALE  -I/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config -DCONFIG_=\"\"  -MM *.c > /home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/.depend 2>/dev/null || : 
/usr/bin/gcc -DCURSES_LOC="<curses.h>" -DLOCALE  -I/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config -DCONFIG_=\"\"   -c conf.c -o /home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/conf.o 
*** Unable to find the ncurses libraries or the 
*** required header files. 
*** 'make menuconfig' requires the ncurses libraries. 
***  
*** Install ncurses (ncurses-devel) and try again. 
***  
Makefile:199: recipe for target '/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/dochecklxdialog' failed 
make[2]: *** [/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/dochecklxdialog] Error 1 
Makefile:753: recipe for target '/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/mconf' failed 
make[1]: *** [/home/onesea/Mini2440/Buildroot/buildroot-2016.02/output/build/buildroot-config/mconf] Error 2 
Makefile:36: recipe for target '_all' failed 
make: *** [_all] Error 2 


根据上述错误提示,当前系统缺乏ncurses库,执行下述命令进行安装即可:

sudo apt-get install libncurses-dev


本文永久更新地址:http://www.linuxdiyf.com/linux/20418.html