在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
芯片精品文章合集(500篇!)    创芯人才网--重磅上线啦!
12
返回列表 发新帖
楼主: tyxuanyuanlx

[原创] MIPS交叉编译环境的建立

[复制链接]
 楼主| 发表于 2014-5-14 15:40:40 | 显示全部楼层
回复 10# 崖边崖


   通过./mips-2013.05-65-mips-sde-elf.bin命令运行即可,不过需要注意的是需要首先安装awk grep sed bzip2 gunzip等软件,而且如果Linux系统使用selinux的话需要先关闭selinux才能正常安装,安装的过程比较简单,全部默认设置即可,安装完成之后,重新启动,在终端中输入mips-sde-elf-gcc -v命令,出现gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-65)即表示安装成功。



有哪里的操作不一样吗?
发表于 2014-5-15 08:47:04 | 显示全部楼层
回复 11# tyxuanyuanlx


   我弄好了,安装默认路径在root里面,不知道什么原因环境变量设置无效,我重新安装到了根目录下,这次环境变量就有效了~~
发表于 2014-10-13 15:37:15 | 显示全部楼层
回复 2# tyxuanyuanlx


    按照您的方法写了个helloworld返回如下




  1. [black@localhost Desktop]$ mips-sde-elf-gcc 1.c
  2. /home/black/CodeSourcery/Sourcery_CodeBench_Lite_for_MIPS_ELF/bin/../lib/gcc/mips-sde-elf/4.7.3/../../../../mips-sde-elf/bin/ld: warning: cannot find entry symbol __start; defaulting to 0000000000400098
  3. /tmp/ccS9pz4c.o: In function `main':
  4. 1.c:(.text+0x18): undefined reference to `puts'
  5. collect2: error: ld returned 1 exit status



复制代码


之前环境都没问题,后来换电脑重新搭建就是这样 换Ubuntu也是这样 现在用的是CentOS6.5  感觉应该是链接库问题..... 求解决方案
发表于 2014-10-13 15:41:55 | 显示全部楼层
回复 1# tyxuanyuanlx

下面是mips-sde-elf-gcc -v执行返回
   



  1. [black@localhost Desktop]$ mips-sde-elf-gcc -v
  2. Using built-in specs.
  3. COLLECT_GCC=mips-sde-elf-gcc
  4. COLLECT_LTO_WRAPPER=/home/black/CodeSourcery/Sourcery_CodeBench_Lite_for_MIPS_ELF/bin/../libexec/gcc/mips-sde-elf/4.7.3/lto-wrapper
  5. Target: mips-sde-elf
  6. Configured with: /scratch/cmoore/2013.05-mips-elf/src/gcc-4.7-2013.05/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=mips-sde-elf --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-arch-32=mips32r2 --with-arch-64=mips64r2 --enable-sgxx-sde-multilibs --disable-threads --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} -D__CS_SOURCERYGXX_MAJ__=2013 -D__CS_SOURCERYGXX_MIN__=5 -D__CS_SOURCERYGXX_REV__=65 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --disable-shared --enable-lto --with-newlib --with-pkgversion='Sourcery CodeBench Lite 2013.05-65' --with-bugurl=https://sourcery.mentor.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-headers=yes --with-sysroot=/opt/codesourcery/mips-sde-elf --with-build-sysroot=/scratch/cmoore/2013.05-mips-elf/install/mips-sde-elf --with-gmp=/scratch/cmoore/2013.05-mips-elf/obj/pkg-2013.05-65-mips-sde-elf/mips-2013.05-65-mips-sde-elf.extras/host-libs-i686-pc-linux-gnu/usr --with-mpfr=/scratch/cmoore/2013.05-mips-elf/obj/pkg-2013.05-65-mips-sde-elf/mips-2013.05-65-mips-sde-elf.extras/host-libs-i686-pc-linux-gnu/usr --with-mpc=/scratch/cmoore/2013.05-mips-elf/obj/pkg-2013.05-65-mips-sde-elf/mips-2013.05-65-mips-sde-elf.extras/host-libs-i686-pc-linux-gnu/usr --with-ppl=/scratch/cmoore/2013.05-mips-elf/obj/pkg-2013.05-65-mips-sde-elf/mips-2013.05-65-mips-sde-elf.extras/host-libs-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/cmoore/2013.05-mips-elf/obj/pkg-2013.05-65-mips-sde-elf/mips-2013.05-65-mips-sde-elf.extras/host-libs-i686-pc-linux-gnu/usr --with-libelf=/scratch/cmoore/2013.05-mips-elf/obj/pkg-2013.05-65-mips-sde-elf/mips-2013.05-65-mips-sde-elf.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libitm --enable-poison-system-directories --with-python-dir=mips-sde-elf/share/gdb/python --with-build-time-tools=/scratch/cmoore/2013.05-mips-elf/install/mips-sde-elf/bin --with-build-time-tools=/scratch/cmoore/2013.05-mips-elf/install/mips-sde-elf/bin SED=sed
  7. Thread model: single
  8. gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-65)



复制代码
发表于 2017-1-8 14:47:55 | 显示全部楼层
haohaoxuexitiantianxiangshang
发表于 2017-3-9 08:50:50 | 显示全部楼层
谢谢楼主
发表于 2018-5-6 22:37:07 | 显示全部楼层
感谢楼主分享回复 1# tyxuanyuanlx


    感谢楼主分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-16 12:56 , Processed in 0.023119 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表