LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1456|回复: 12

谁来说说 “-fomit-frame-pointer” 对编译系统的影响

[复制链接]
发表于 2006-9-8 13:09:00 | 显示全部楼层 |阅读模式
在我的make.conf一直用了-fomit-frame-pointer 这一选项
以前在论坛和google搜索过,但一直没搞清楚这一选项对编译系统的具体影响,是否与速度有关?

最近在帮朋友用liveCD安装的默认make.conf中发现没有这个选项

再加上手册里的如下说法
Post by Gentoo Handbook

Mind you that using -fomit-frame-pointer (which doesn't keep the frame pointer in a register for functions that don't need one) might have serious repercussions on the debugging of applications!

于是不清楚这个选项是否该加入,请大家指点
发表于 2006-9-8 13:31:53 | 显示全部楼层
F.Y.I, gcc(1):
       -fomit-frame-pointer
           Don't keep the frame pointer in a register for functions that don't
           need one.  This avoids the instructions to save, set up and restore
           frame pointers; it also makes an extra register available in many
           functions.  It also makes debugging impossible on some machines.
           
           On some machines, such as the VAX, this flag has no effect, because
           the standard calling sequence automatically handles the frame
           pointer and nothing is saved by pretending it doesn't exist.  The
           machine-description macro "FRAME_POINTER_REQUIRED" controls whether
           a target machine supports this flag.
           
           Enabled at levels -O, -O2, -O3, -Os.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-8 14:04:45 | 显示全部楼层
这个我在GCC doc 里面看到过,
说实话没看懂,就是搞不清楚在安装系统时加与不加,对系统有什么影响,
加上会不会加快编译速度,但以后会不会出现其他问题
回复 支持 反对

使用道具 举报

发表于 2006-9-8 14:11:24 | 显示全部楼层
应该加。
加上 -fomit-frame-pointer 后,编译出来的软件的运行速度会加快...
我一直都加了的,不会出现任何问题。
回复 支持 反对

使用道具 举报

发表于 2006-9-8 14:40:41 | 显示全部楼层
加了速度快,
不加便于debug
回复 支持 反对

使用道具 举报

发表于 2006-9-8 16:14:47 | 显示全部楼层
我的意思是, 基本上你的make.conf肯定有-O优化, 所以make.conf里写不写-fomit-frame-pointer其实没区别
回复 支持 反对

使用道具 举报

发表于 2006-9-8 16:27:08 | 显示全部楼层
在x86里,-O不会打开-fomit-frame-pointer开关,所以还是需要手工加的...
回复 支持 反对

使用道具 举报

发表于 2006-9-8 16:47:08 | 显示全部楼层
如果你只用桌面的话,那就加上,这样速度就快些。
回复 支持 反对

使用道具 举报

发表于 2006-9-8 17:10:26 | 显示全部楼层
不错,回去也加上,也是一直搞懂,没敢加
回复 支持 反对

使用道具 举报

发表于 2006-9-8 18:17:31 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表