cygwin 下编译 skyeye00.9.2的奇怪错误
各位大侠, 我在编译/sim/arm/dbct下的文件时,奇怪问题层出不穷。最奇怪的一个是在编译tb.c的函数tb_find时候,gcc报了很怪的错误(我是新手,可能大惊小怪了:-))
gcc -c dbct/tb.c -o tb.o -DHAVE_CONFIG_H -DDEFAULT_INLINE=0 -DMODET `pkg-con
fig gtk+-2.0 --cflags` -I -I./../../include/gdb -I. -I. -I../common -I./../common -I../../include
-I./../../include -I../../bfd -I./../../bfd -I../../opcodes -I./../../opcodes -I../../intl -I./../..
/intl -I./../../include/gdb -g -O2
dbct/tb.c: In function `tb_find':
dbct/tb.c:295: error: unable to find a register to spill in class `DIREG'
dbct/tb.c:295: error: this is the insn:
(insn:HI 190 591 191 16 0x102ed240 (parallel [
(set (reg:SI 2 ecx )
(const_int 0 ))
(set (reg/f:SI 1 edx )
(plus:SI (ashift:SI (reg:SI 2 ecx )
(const_int 2 ))
(reg/f:SI 1 edx )))
(set (mem:BLK (reg/f:SI 1 edx ) )
(const_int 0 ))
(use (reg:SI 0 eax ))
(use (reg:SI 2 ecx ))
(use (reg:SI 19 dirflag))
]) 456 {rep_stossi} (insn_list 188 (insn_list 189 (nil)))
(expr_list:REG_DEAD (reg:SI 19 dirflag)
(expr_list:REG_DEAD (reg:SI 0 eax )
(expr_list:REG_UNUSED (reg:SI 2 ecx )
(expr_list:REG_UNUSED (reg/f:SI 1 edx )
(nil))))))
dbct/tb.c:295: confused by earlier errors, bailing out
make: *** Error 1
make: Leaving directory `/home/sheltont/skyeye/sim/arm'
make: *** Error 2
make: Leaving directory `/home/sheltont/skyeye/sim'
make: *** Error 2
感觉是这个code太难了,超出gcc的能力了。我的gcc是
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=
/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --ena
ble-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls --without-included-gettext --enable-libg
cj --with-system-zlib --enable-interpreter --enable-threads=posix --enable-java-gc=boehm --enable-sj
lj-exceptions --disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
teawater大侠在吗?帮忙看看。万分感激。 瞎试一通,发现将
memset(state->mem.tbt, 0, state->mem.rom_size / TB_LEN * sizeof(tb_t));
改为
void * bank = state->mem.tbt;
memset(bank, 0, state->mem.rom_size / TB_LEN * sizeof(tb_t));
就可以了。 还发现了其他的怪错误。在sim/arm/dbct/Arm2x86_mm.c时,凡是调用
__asm__ __volatile__ ("call *arm2x86_pfun");
的地方,在连接时,都报错无法解析arm2x86_pfun。
后参考了linux inline asm的一篇文章,该为
__asm__ __volatile__ ("call *%0" : : "m"(arm2x86_pfun));
编译连接是可以了。但是还不知道如何判断执行是否正确。
teawater大侠,你的code写的好像太复杂一些。我在整个skyeye目录中查找__ASM__,就这个地方最多了。
页:
[1]