我正在尝试构建ECOS的合成Linux目标。我的软件环境:为“Linux合成”目标构建ECOS的问题
- Ubuntu的11.4
- GCC 4.5.2
- ECOS 3.0
在配置工具我已成立了 “Linux的Sythetic” 目标与 “全” 包。按F7(编译)编译开始,但后来它说:
/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S: Assembler messages: make: Leaving directory `/opt/ecos/linux_build' /opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:457: Error: .size expression for __restore_rt does not evaluate to a constant
/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:457: Error: .size expression for __restore does not evaluate to a constant make: [src/syscall-i386-linux-1.0.o.d] Error 1 make: [build] Error 2
文件的内容/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall- I386-Linux的1.0.S从线是:
// ----------------------------------------------------------------------------
// Special support for returning from a signal handler. In theory no special
// action is needed, but with some versions of the kernel on some
// architectures that is not good enough. Instead returning has to happen
// via another system call.
.align 16
.global cyg_hal_sys_restore_rt
cyg_hal_sys_restore_rt:
movl $SYS_rt_sigreturn, %eax
int $0x80
1:
.type __restore_rt,@function
.size __restore_rt,1b - __restore_rt
.align 8
.global cyg_hal_sys_restore
cyg_hal_sys_restore:
popl %eax
movl $SYS_sigreturn, %eax
int $0x80
1:
.type __restore,@function
.size __restore,1b - __restore
所以__restore和__restore_rt被undefinied。我试过注释掉这部分并删除信号相关的包(它说,它是一个信号处理器的东西),但它看起来是ECOS内核的基础部分;构建似乎成功了,但是当我编译示例应用程序时,由于缺少符号(cyg_hal_sys_restore),导致链接器错误。
愚蠢的想法,但我试图用“cyg_hal_sys_restore” 和“... rt”同样的方式取代“__restore”,只是为了消除undefs(不是真的希望错误的代码不会导致错误),并且结果是:构建是可以的(因为没有undefs),示例编译可以(因为没有缺失的符号),但是示例a.out仅在我启动它的神圣时刻才会抛出segfault。
Halp,请恕我不熟悉inline asm和ECOS。
这里有很少的eCos特定的知识,您可能会在ecos-discuss列表中获得更多的运气。 http://ecos.sourceware.org/intouch.html – crazyscot 2011-06-01 13:30:12