翻阅了前辈们的辛苦历程,我作为小菜在编译中遇到一点问题,解决方法如下:
1、初次make提示出错信息:
--------------------------- NOTICE ------------------------------
If you always get error, please run "make NO_CHECK=1" instead.
-----------------------------------------------------------------
Checking whether host is big endian ... no
Checking gcc ... OK ( gcc version: 4.3.3 )
Checking whether the compiler supports x86 asm ... FAILED
*** It seems that the compiler don't support inline x86 AT&T ASM codes.
*** Run "make NO_DBCT=1" instead to ignore it.
make: *** [check] 错误 1
这里其实已经可以了解到出错的地方:编译器不支持
2、按提示"make NO_CHECK=1"后,依然提示出错:
........
在函数‘open’中,
内联自‘nandflash_sb_setup’于 device/nandflash/nandflash_smallblock.c:519:
/usr/include/bits/fcntl2.h:51: 错误: 调用‘__open_missing_mode’,声明有错误属性:open with O_CREAT in second argument needs 3 arguments
make: *** [binary/nandflash_smallblock.o] 错误 1
3、看过一位前者提到其安装gcc4.1,make提示出错后再次"make NO_CHECK=1"通过。
查看skyeye(1.2.4)源码目录中的README文档,阅读后便可明了:
5 Tested Environment
X86-32:
CygWin/MinGW
gcc-3.4, gcc-4.1.2
Linux (Debian)
gcc-3.3 gcc-3.4
gcc-2.95 gcc-4.0 (doesn't support DBCT)
BeOS (R5.0.3, Exp-Dano)
gcc-2.95 + gcc-3.4.3
这里说明支持的cross compile,ubuntu9.04默认gcc为4.3.3,我安装gcc4.1后编译通过。
我并没有修改系统的GCC符号连接,而是修改Makefile文件
#CC = $(CROSS_COMPILE)gcc #原行注释掉
CC = $(CROSS_COMPILE)gcc-4.1 #修改
4、将skyeye拷贝到/usr/bin即可使用了
注意:
ubuntu安装后使用apt-get install gcc-4.1方法可能无法安装,可是你可以先通过“更新管理器”更新系统资源包信息,之后再通过此方法安装。
更新或使用此方法安装前记得改变一下“软件源”设置,自动选择服务器。不然更新或安装时会很慢。
手动安装GCC4.1此处不作描述。
5、在待调试的目标文件夹下建立skyeye的配置文件skyeye.conf
可以参考skyeye源码中的README文档,复制例文来加以修改
#--------------------------------------------------------------------------------
# below is the cpu config info
# cpu: maybe arm7tdmi or arm720t
cpu: arm7tdmi
#--------------------------------------------------------------------------------
# below is the machine(development board) config info
# machine(develop board) maybe at91 or ep7312
#mach: at91
mach: s3c44b0x
#-------------------------------------------------------------------------------
#NOTICE: this parameter is useless for skyeye-V0.3.1+
# have 7 memory bank (include RAM, ROM, mapped IO space)
# below is the memory config info
mem_num: 7
# map=M means ram/rom, map=I means mapped IO space, 如果说某段接网络芯片,则此段即配置为map=I
# type=RW means can be read or written,
# type=R means read only,
# addr=0x..... means the mem bank's beginning address,
# size=0x..... means the mem bank's memory size,
# file=... is the filesystem image file, used for uclinux4skyeye or armlinux4skyeye
......
mem_bank: map=I, type=RW, addr=0x08000000, size=0x10000000
#now, add more options on mem_bank
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00200000, file=./u-boot, boot=yes
#start binary program at 0x00000000
mem_bank: map=M, type=RW, addr=0x0c000000, size=0x00800000
.....
调试直接运行skyeye