QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2958|回复: 7

有人用CC='gcc -s'编译系统的吗?

[复制链接]
发表于 2006-10-16 12:35:53 | 显示全部楼层 |阅读模式
听说strip会破坏库文件。CFLAGS加“-s”后,系统还能正常工作吗?现在有人有这个参数吗?
发表于 2006-10-17 09:27:09 | 显示全部楼层
没用过,有谁吃螃蟹先
回复

使用道具 举报

 楼主| 发表于 2006-10-17 12:25:04 | 显示全部楼层
在我所保存的以前用gentoo时的make.conf里是有export CC='gcc -s'的,不过时间久了,记不清当初是否使用了。所以来找别人确认一下
回复

使用道具 举报

 楼主| 发表于 2006-11-3 10:23:54 | 显示全部楼层
man strip
       -s
       --strip-all
           Remove all symbols.
       -g
       -S
       -d
       --strip-debug
           Remove debugging symbols only.
       --strip-unneeded
           Remove all symbols that are not needed for relocation processing.

man ld
       -s
       --strip-all
           Omit all symbol information from the output file.
       -S
       --strip-debug
           Omit debugger symbol information (but not  all  symbols)  from  the
           output file.

http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options
-s
Remove all symbol table and relocation information from the executable.


gcc -s是否相当于strip --strip-all了?或者是ld --strip-all?
gcc -s、strip --strip-all、ld --strip-all之间有何区别阿?
如果要移除符号的话,是设置CFLAGS好呢还是LDFLAGS好呢?
回复

使用道具 举报

发表于 2006-11-4 20:17:01 | 显示全部楼层
支持楼主测试。
回复

使用道具 举报

 楼主| 发表于 2006-11-4 23:35:29 | 显示全部楼层
不用gentoo了,没法测。不过应该没问题,滔滔试试吧,会让程序变小的,加载速度也会有提升
回复

使用道具 举报

发表于 2006-11-8 16:58:10 | 显示全部楼层
是否指-Os,是的话我试过,base系统可以通过编译,但是会在多媒体方面有问题(大概是半年前测试,现在就不清楚了),性能的话,说真的,比较慢,程序空间是小了一点,个人感觉跟O2有8%左右的差距,其实用acovea做一下benchmark也可以得到相同的结果。
回复

使用道具 举报

 楼主| 发表于 2006-11-8 18:02:02 | 显示全部楼层
不是-Os
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-4-20 19:36 , Processed in 0.067967 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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