我正试图用ECOS构建合成Linux目标。我的软件环境:
在Config工具中,我用"all“包设置了"Linux综合”目标。按F7 (build)编译将启动,但稍后它会说:
/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:汇编程序消息: make:离开目录`/opt/ecos/linux_
‘/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:457:错误:__restore_rt的.size表达式不计算为常量
/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:457:错误:__restore的.size表达式不计算为常量make: src/syscall-i 386-linux-1.0.o.d错误1 make:构建错误2
来自434行的文件的内容是:
// ----------------------------------------------------------------------------
// 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_rt和__restore是不明确的。
我试着注释掉这个部分并删除与信号相关的包(它说它是一个信号处理程序),但是它看起来是ECOS内核的基本部分;当部分被忽略时,构建似乎成功了,但是当我编写示例应用程序时,由于缺少符号(cyg_hal_sys_restore),会出现链接错误。
愚蠢的想法,但我尝试用"__restore“替换为"cyg_hal_sys_restore”和"...rt“,只是为了消除反防御(并不是真的希望错误的代码不会导致错误),结果是:构建是ok的(因为没有撤销),示例编译是ok的(作为没有缺失的符号),但是示例a.out在神圣的一开始就抛出了分段错误。
请稍等,我不熟悉内联asm,也不熟悉ECOS。
发布于 2011-06-03 12:35:47
这个问题似乎与二进制文件有关。在Debian,一个降级到2.20.1-16为我工作。http://ecos.sourceware.org/ml/ecos-discuss/2011-06/msg00010.html
编辑:跟随链接,有一个适当的修复也。
https://stackoverflow.com/questions/6183972
复制相似问题