为“Linux Synthetic”构建 ECOS 时出现问题目标
我正在尝试使用 ECOS 构建 Synthetic Linux 目标。我的软件环境:
- 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: 汇编器消息: make:离开 目录“/opt/ecos/linux_build” /opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:457: 错误:.size 表达式为 __restore_rt 不计算为常量/opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S:457: 错误:__restore 的 .size 表达式 不计算为常数 制作: [src/syscall-i386-linux-1.0.od] 错误 1 make:[build] 错误 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
434 __restore 和 __restore_rt 未定义。
我试图注释掉这部分并删除与信号相关的包(它说,它是一个信号处理程序的东西),但它看起来是 ECOS 内核的基础部分;当部分被注释掉时,构建似乎成功,但是当我编译示例应用程序时,由于缺少符号(cyg_hal_sys_restore)而出现链接器错误。
愚蠢的想法,但我尝试用“cyg_hal_sys_restore”替换“__restore” 和“...rt”同样的方式,只是为了消除undef(并不是真的希望错误的代码不会导致错误),结果是:构建没问题(因为没有undef),示例编译没问题(因为没有丢失符号),但是示例 a.out 在我启动它的神圣时刻抛出了段错误。
Halp,请,我不熟悉内联汇编也不熟悉 ECOS。
I'm trying to building Synthetic Linux target with ECOS. My software environment:
- Ubuntu 11.4
- GCC 4.5.2
- ECOS 3.0
In the Config Tool I have set up "Linux Sythetic" target with "all" packages. Pressing F7 (build) the compilation starts, but later it says:
/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
The content of the file /opt/ecos/ecos-3.0/packages/hal/synth/i386linux/v3_0/src/syscall-i386-linux-1.0.S from the line 434 is:
// ----------------------------------------------------------------------------
// 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
So the __restore and __restore_rt is undefinied.
I've tried to comment out this part and remove signal-related packages (it says, that it is a signal handler stuff), but it looks to be the base part of the ECOS kernel; the build seems succeed when parts are outcommented, but when I compile example apps, there are linker error because of the missing symbols (cyg_hal_sys_restore).
Silly idea, but I've tried to replace "__restore" with "cyg_hal_sys_restore"
and "...rt" same way, just to eliminate undefs (not really hoping that the wrong code causes no error), and the result is: the build is ok (as there're no undefs), example compiling is ok (as no missing symbols), but example a.out throws segfault just at the holy moment I start it.
Halp, pls., I'm not familiar with inline asm nor ECOS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该问题似乎与 binutils 有关。在 Debian 上,降级到 2.20.1-16 对我有用。
http://ecos.sourceware.org/ml/ecos-discuss /2011-06/msg00010.html
编辑:按照链接,也有一个适当的修复。
The problem seems to be related to binutils. On Debian, a downgrade to 2.20.1-16 worked for me.
http://ecos.sourceware.org/ml/ecos-discuss/2011-06/msg00010.html
EDIT: Follow link, there's a proper fix too.