Ubuntu下GX编译环境

搭建编译环境在Linux gw-MS 3.11.0-26-generic #45~precise1-Ubuntu SMP Tue Jul 15 04:02:35 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

 

1.首先是国芯的交叉编译工具

先确定以下goxceed/csky-ecosgxtools/csky-elf目录文件存在

3113C)

/opt/goxceed/csky-ecos/bin

/opt/gxtools/csky-elf/bin

 (3113B)

/opt/gxtools/arm-elf/bin

/opt/gxtools/arm-eabi/bin

/opt/goxceed/arm-ecos/bin

先配置好以上工具的环境变量在/etc/environment文件中,配置好之后先source /etc/environment使配置的环境变量立即生效

或者直接在~/.bashrc中增加exprot PATH=$PATH:/opt/goxceed/csky-ecos/bin:/opt/gxtools/csky-elf/bin即为3113CPATH配置。

2.编译过程中用到的其他工具,视32还是64位系统在报错后重新编译

<1>genromfs的编译

下载genromfs-0.5.1,在linux下编译,并将文件拷贝到/opt/gxtools/csky-elf/bin目录下

需要在自己的平台下完成源码编译。

<2>mkfs.jffs2的安装

可下载源码编译,本人下载编译失败,可能下载的源码不对

也可以直接在终端sudo apt-get install mtd-utils自动完成安装

<3>对于编译完后生成bin文件工具使用时genflash的依赖库问题

../genflash: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

./genflash: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

gw@gw-MS:GX3113C/GX3113C_HUNAN_DVB/development/flash> ldd genflash

linux-gate.so.1 =>  (0xf77b0000)

libreadline.so.6 => not found

libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7784000)

libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75da000)

/lib/ld-linux.so.2 (0xf77b1000)

搜索发现在 /lib/x86_64-linux-gnu/

gw@gw-MS:/lib/x86_64-linux-gnu> ls -la libreadline.so.6

lrwxrwxrwx 1 root root 18 1226 15:12 libreadline.so.6 -> libreadline.so.6.2

即该库是存在的。可能链接目录不对。

#export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu

 

之后make报错:

./genflash: error while loading shared libraries: libreadline.so.6: wrong ELF class: ELFCLASS64

./genflash: error while loading shared libraries: libreadline.so.6: wrong ELF class: ELFCLASS64

wrong ELF class: ELFCLASS64 ,大致的意思是软件是32位的,需要32位的 ×.so.×动态链接库,而系统是64位的所提供的该 动态链接库×.so.×是64位的,所以不能用。

也就是应该并非是库路径问题,先还原库路径做的修改,因为之前export之前echo $LD_LIBRARY_PATH不存在,所以可以直接清除该环境变量。

#unset LD_LIBRARY_PATH

gxlinux环境下拷贝/lib下的libreadline.so.6.1到当前环境下/lib/i386-linux-gnu目录下。并创建软链接

 

#ln -s libreadline.so.6.1 libreadlin.so.6即可解决该库问题。

 

继续编译出现

./genflash: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory

./genflash: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory

继续拷贝gxlinux环境下拷贝/liblibncursesw.so.5到当前环境下/lib/i386-linux-gnu目录下

4.以上Ubuntu下的3113C工程的编译

3113B编译环境只需要拷贝对应的arm-ecos,arm-eabi,arm-elf到对应目录并配置~/.bashrc中的PATH变量即可。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值