免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1080 | 回复: 0
打印 上一主题 下一主题

建立snapgear-linux-p33映像中遇到的问题记录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-23 22:37 |只看该作者 |倒序浏览

=====================================================
CROSS TOOLS
=====================================================
近日建立GCC Cross-Compiler ,用的是binutils-2.13.1,在cygwinx下,按照
http://www.rtems.net/Documnet/rtems_serial/RTEMS%202%20tutorial/2.1_crosscomplier.htm
的步骤,当make时,报告如下错误:
binutils-2.13.1/bfd/archures.c:463: undefined reference to '_bfd_i386_arch'
collect2: ld returned 1 exit status
make[3]; *** [size.exe] Error 1

www.osdev.org
中找到相关帖子:
http://www.osdev.org/phpBB2/viewtopic.php?t=12566&start=15&postdays=0&postorder=asc&highlight
=
依据帖子中提到:把 bfd/Makefile.in中 echo $$f > tofiles 修改为echo $$f ' ' > tofiles
configure ,make 成功......
至于原因不知........
更多关于GCC Cross-Compiler,见Wiki:
http://www.osdev.org/wiki/GCC_Cross-Compiler
------------------------------------------------------------------------
ubuntu linux下,用snapgear的sparc-linux-tools.sh作cross tools:
(sparc-linux-tools.sh见build-tools.tar.gz)

文件:
build-tool.tar.gz
大小:
19KB
下载:
下载
编译安装boot-trap gcc时,记得configure加上--disable-threads --disable-shared --without-headers
否则,make gcc时会需要pthreadtypes.h等等文件,这些文件在uClibc/libc/sysdeps/linux/common/bits,也可以直接copy过去
编译c++程序,记得ulibc的make menuconfig中有个floating point support  要选中,否则会提示找不到一对文件,文件名字不记得了~~
----------------------------------------------------------------------
ubuntu linux下,用binutils2.6.1、gcc3.4.0、uClibc
编译完整的gcc时提示:....strsignal.c:“signo” doesnt match prototype
在binutils/libiberty和gcc3.4.0/libiberty下面的strsignal.c中有psignal函数的定义,一般有两种形式:
psignal(unsigned , char *)  和psignal(int ,congst char *)
检查他们定义与toolchain/sparc-linux/sys-include/signal中关于该函数的声明是否参数一致。
-----------------------------------------------------------------------
同上环境:
完整编译gcc3.4.0时提示:gcc3.4.0/sparc-linux/libstdc++-v3/include/sparc-linux/bits/ctype_noninline.h :cannot convert 'const __ctype_touplow_t*' to 'const int*'
详细讲解见:
http://bugs.uclibc.org/view.php?id=904
补丁见:
http://gcc.gnu.org/bugzilla/attachment.cgi?id=6132
===============================================================
KERNEL
=====================================================
ubuntu linux下
make xconfig配置linux内核时,提示wish can  not find!!!
RE:wish is the tk shell.  do you have tcl/tk installed?
执行:sudo apt-get install tclx8.4        sudo apt-get install tk8.4
然后make xconfig, OK!~~
------------------------------------------------------------------------------------------------------------------------------------------------------
ubuntu linux下
make menuconfig配置linux内核时,需要用到Ncurses库。
Ncurses库提供了一个相当稳固的工作框架(Framework)可以在字符模式下产生漂亮的界面。
可以到发图片ftp://ftp.gnu.org下载。
安装说明:http://book.xlib.cn/lfs/chapter06/ncurses.html
----------------------------------------------------------------------------------------------------------------------------------------------------
winXP下,cygwin环境,tar解压包时,出现下列类似错误:
tar: snapgear-p33a/linux-2.0.x/arch/sparcnommu/platform/LEON-2.x: time stamp 2007-05-31 19:41:33 is 54609679.207 s in the future
tar: snapgear-p33a/linux-2.0.x/arch/sparcnommu/platform: time stamp 2007-05-31 19:41:33 is 54609679.204 s in the future
tar: snapgear-p33a/linux-2.0.x/arch/sparcnommu/mm: time stamp 2007-05-31 19:41:34 is 54609680.195 s in the future
tar: snapgear-p33a/linux-2.0.x/arch/sparcnommu/config.in: time stamp 2007-05-15 20:06:24 is 53228770.19 s in the future
苦弄不清原因.....
然后赫然发现中了病毒,把我xp系统时间向前该了2年..... 修改,OK!
------------------------------------------------------------------------
ubuntu linux下,snapgear-linux-p33中:目标sparc no MMU linux2.0 uClibc
1. linux2.0/arch/sparcnommu/config.in需要修改,charactor末尾少了endmenu字段,致使kernel配置中后面的菜单不可用~!
2. vender/config/sparc/config.arch.common中有下列字段:
#if [ -d $(ROOTDIR)/lib/$(LIBCDIR)/lib ] ; then \
#cp /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/$(ARITH_MULTIDIR)libstdc++* $(ROOTDIR)/lib/$(LIBCDIR)/lib; \
#cp /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/$(ARITH_MULTIDIR)libsupc++* $(ROOTDIR)/lib/$(LIBCDIR)/lib; \
#cp /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/$(ARITH_MULTIDIR)libgcc.a $(ROOTDIR)/lib/$(LIBCDIR)/lib/libgcc_forstdc++.a; \
#fi
开放该字段,本字段会产生个libgcc_forstdc++.a库,这个库在编译c++程序时会用到。
3. linux-2.0/mmnommu/有kmalloc.c、kmalloc2.c和page_alloc.c、page_alloc2.c
c++程序在板子上执行遇到:
Failed to free page
> > Couldn't get a free page.....
> > Aocation of length 116440 from process 12 failed
> > Buffer memory:        0kB
> > Buffer heads:         8
> > Buffer blocks:        0
> > Free pages:         140kB
这时候需要在kernel配置里面,在第1步中开放的charactor下面的kernel hacking选项下选中less wastefull kmalloc.c/page_malloc.c选项,该选项会使makefile文件编译kallco2.c和page_alloc2.c文件(默认是kmalloc.c和page_alloc.c)。
讨论见:
http://www.uclinux.org/pub/uClinux/archive/2674.html
[/url]
--------------------------------------------------------------------------------

本文来自ChinaUnix博客,如果查看原文请点:[url]http://blog.chinaunix.net/u1/42111/showart_388617.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP