3866|4

80

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

我想求助一下用GCC实现MIPS交叉编译的全过程(从编译binutils开始到重新编译GCC,再到如何实现交叉编译) [复制链接]

如题,麻烦大家指导下,我是GCC和MIPS的初学者,还望大家不吝赐教:)谢谢您!

最新回复

DirkNowitzki ,你好!你是下了最新的快照的版本吗?这个可能会有点危险,我就载过快照,老外居然还没完成,所以一堆错误。 你可以试着下比较前面点的快照版本,或者用svn co去下载。如果不行的话,加我msn或者qq,我给你发过去。 buildroot不需要sudo。 另外,检测一下你的gcc是否正确,输入gcc --version看看 [fc@fcdev buildroot]$ gcc --version gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   详情 回复 发表于 2007-10-7 13:54
点赞 关注

回复
举报

66

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
不需要这么麻烦,很简单的.
首先你去
http://www.uclibc.org/
下载一个buildroot,这是个工具集,你接下来所要做的事情就是把gcc、binutils等文件下载下来,放在buildroot下的dl目录下
当然,你也可以让buildroot自动下载,不过速度较慢。
选择目标的为MIPS,以及一些工具的版本,顺利的话,你编译完后就能得到MIPS的gcc交叉编译器了。还包括文件系统(busybox),n多的可选应用程序(sqlite等)。
 
 

回复

81

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
###
# setenv
###
unset LD_LIBRARY_PATH

test "$SHELL" = "/bin/csh" \
        && setenv PROJECT at91dev \
        || export PROJECT=at91dev

test "$SHELL" = "/bin/csh" \
        && setenv PRJROOT /at91dev \
        || export PRJROOT=/at91dev

test "$SHELL" = "/bin/csh" \
        && setenv ARCH arm \
        || export ARCH=arm

test "$SHELL" = "/bin/csh" \
        && setenv TARGET arm-linux-uclibc \
        || export TARGET=arm-linux-uclibc

test "$SHELL" = "/bin/csh" \
        && setenv TOOLSDIR /buildroot/build_arm/staging_dir \
        || export TOOLSDIR=/buildroot/build_arm/staging_dir

test "$SHELL" = "/bin/csh" \
        && setenv PATH /at91dev/buildroot/build_arm/staging_dir/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/admin/bin \
        || export PATH=/at91dev/buildroot/build_arm/staging_dir/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/admin/bin

test "$SHELL" = "/bin/csh" \
        && setenv CROSS_COMPILE arm-linux-uclibc- \
        || export CROSS_COMPILE=arm-linux-uclibc-

贴一个我用编译后的ARM的gcc交叉编译器的环境变量设置,你也可以参考一下
 
 
 

回复

72

帖子

0

TA的资源

一粒金砂(初级)

4
 
楼上的兄弟,我在make buildroot时遇到了问题,如下:

dirk@dirk-laptop:~/buildroot$ make menuconfig
make CC="/usr/bin/gcc" -C package/config conf mconf
make[1]: Entering directory `/home/dirk/buildroot/package/config'
/usr/bin/gcc -DCURSES_LOC="" -DLOCALE -g -O2  -c lxdialog/checklist.c -o lxdialog/checklist.o
In file included from lxdialog/checklist.c:24:
lxdialog/dialog.h:32:20: error: curses.h: No such file or directory
In file included from lxdialog/checklist.c:24:
lxdialog/dialog.h:97: error: expected specifier-qualifier-list before ‘chtype’
lxdialog/dialog.h:187: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:194: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:196: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:197: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:198: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:199: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:201: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c:31: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c:59: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c:95: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c: In function ‘dialog_checklist’:
lxdialog/checklist.c:116: error: ‘WINDOW’ undeclared (first use in this function)
lxdialog/checklist.c:116: error: (Each undeclared identifier is reported only once
lxdialog/checklist.c:116: error: for each function it appears in.)
lxdialog/checklist.c:116: error: ‘dialog’ undeclared (first use in this function)
lxdialog/checklist.c:116: error: ‘list’ undeclared (first use in this function)
lxdialog/checklist.c:129: error: ‘stdscr’ undeclared (first use in this function)
lxdialog/checklist.c:130: error: ‘KEY_MAX’ undeclared (first use in this function)
lxdialog/checklist.c:137: error: ‘COLS’ undeclared (first use in this function)
lxdialog/checklist.c:138: error: ‘LINES’ undeclared (first use in this function)
lxdialog/checklist.c:143: error: ‘TRUE’ undeclared (first use in this function)
lxdialog/checklist.c:146: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:146: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:147: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:151: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:156: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:171: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:171: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:210: error: ‘KEY_UP’ undeclared (first use in this function)
lxdialog/checklist.c:210: error: ‘KEY_DOWN’ undeclared (first use in this function)
lxdialog/checklist.c:220: error: ‘FALSE’ undeclared (first use in this function)
lxdialog/checklist.c:297: error: ‘KEY_LEFT’ undeclared (first use in this function)
lxdialog/checklist.c:298: error: ‘KEY_RIGHT’ undeclared (first use in this function)
lxdialog/checklist.c:312: error: ‘KEY_RESIZE’ undeclared (first use in this function)
make[1]: *** [lxdialog/checklist.o] Error 1
make[1]: Leaving directory `/home/dirk/buildroot/package/config'
make: *** [package/config/mconf] Error 2
dirk@dirk-laptop:~/buildroot$ sudo make menuconfig
make CC="/usr/bin/gcc" -C package/config conf mconf
make[1]: Entering directory `/home/dirk/buildroot/package/config'
/usr/bin/gcc -DCURSES_LOC="" -DLOCALE -g -O2  -c lxdialog/checklist.c -o lxdialog/checklist.o
In file included from lxdialog/checklist.c:24:
lxdialog/dialog.h:32:20: error: curses.h: No such file or directory
In file included from lxdialog/checklist.c:24:
lxdialog/dialog.h:97: error: expected specifier-qualifier-list before ‘chtype’
lxdialog/dialog.h:187: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:194: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:196: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:197: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:198: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:199: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:201: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c:31: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c:59: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c:95: error: expected ‘)’ before ‘*’ token
lxdialog/checklist.c: In function ‘dialog_checklist’:
lxdialog/checklist.c:116: error: ‘WINDOW’ undeclared (first use in this function)
lxdialog/checklist.c:116: error: (Each undeclared identifier is reported only once
lxdialog/checklist.c:116: error: for each function it appears in.)
lxdialog/checklist.c:116: error: ‘dialog’ undeclared (first use in this function)
lxdialog/checklist.c:116: error: ‘list’ undeclared (first use in this function)
lxdialog/checklist.c:129: error: ‘stdscr’ undeclared (first use in this function)
lxdialog/checklist.c:130: error: ‘KEY_MAX’ undeclared (first use in this function)
lxdialog/checklist.c:137: error: ‘COLS’ undeclared (first use in this function)
lxdialog/checklist.c:138: error: ‘LINES’ undeclared (first use in this function)
lxdialog/checklist.c:143: error: ‘TRUE’ undeclared (first use in this function)
lxdialog/checklist.c:146: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:146: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:147: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:151: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:156: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:171: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:171: error: ‘struct dialog_color’ has no member named ‘atr’
lxdialog/checklist.c:210: error: ‘KEY_UP’ undeclared (first use in this function)
lxdialog/checklist.c:210: error: ‘KEY_DOWN’ undeclared (first use in this function)
lxdialog/checklist.c:220: error: ‘FALSE’ undeclared (first use in this function)
lxdialog/checklist.c:297: error: ‘KEY_LEFT’ undeclared (first use in this function)
lxdialog/checklist.c:298: error: ‘KEY_RIGHT’ undeclared (first use in this function)
lxdialog/checklist.c:312: error: ‘KEY_RESIZE’ undeclared (first use in this function)
make[1]: *** [lxdialog/checklist.o] Error 1
make[1]: Leaving directory `/home/dirk/buildroot/package/config'
make: *** [package/config/mconf] Error 2

怎么解决呢?
 
 
 

回复

87

帖子

0

TA的资源

一粒金砂(初级)

5
 
DirkNowitzki ,你好!你是下了最新的快照的版本吗?这个可能会有点危险,我就载过快照,老外居然还没完成,所以一堆错误。
你可以试着下比较前面点的快照版本,或者用svn co去下载。如果不行的话,加我msn或者qq,我给你发过去。
buildroot不需要sudo。
另外,检测一下你的gcc是否正确,输入gcc --version看看

[fc@fcdev buildroot]$ gcc --version
gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
报名赢【小米双肩包、contigo水杯】 | TI MSPM0 系列 MCU 再添新成员
了解TI 前沿新品——高性能与高性价比的优秀组合 MSPM0G351x / MSPM0L111x,4月24日(周四)上午10:00直播~

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网 9

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表