[杂感]Arch,喜欢上编译的理由

其他Linux/Unix/BSD/OSX等发行版讨论
回复
poet
帖子: 2841
注册时间: 2006-09-11 22:47

Re:

#121

帖子 poet » 2008-12-30 19:36

zhuqin_83 写了: 有谁说说-o2和o3有多少区别么,还有那个makeflag -jn是不是仅在make的时候有用?
一般为了保证稳定性最好是 -O2,-O3对于不同的软件在特定的机器上会出现问题。本人实际遇到过,例如把 vim 编 O3,结果试了六台机器有两台机器上不能启动。但是编O2就没问题。
poet
帖子: 2841
注册时间: 2006-09-11 22:47

Re:

#122

帖子 poet » 2008-12-30 19:44

zhuqin_83 写了:以后应该都只用这个参数了:
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
可以说所有常见cpu通用,在未来一段时间内无须修改。
稍微看看 gcc 就明白对于 x86 体系而言, -fomit-frame-pointer 是不必要的,因为 O2 已经包含它了。
至于 -pipe ,对于单核CPU最好关掉,我在另外一个帖子中已经解释过这个参数仅仅对多核多CPU机器提升编译效率,对于单核单CPU机器不但不能提升性能反而会降低性能。
头像
zhuqin_83
帖子: 10606
注册时间: 2006-05-13 4:02
联系:

Re: [杂感]Arch,喜欢上编译的理由

#123

帖子 zhuqin_83 » 2008-12-30 23:21

-fomit-frame-pointer也是在最近才默认加上的,-O就已经enable了。
-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. See Register Usage.

Enabled at levels -O, -O2, -O3, -Os.
至于-pipe我等下测试看看。
HP Pavilion DV6-2064CA: AMD Turion II Ultra Dual-Core Mobile M640, HD4650, 2GBx2 DDR2-800, Seagate 500GB 7200RPM SATA, BD-ROM
DELL UltraSharp 2209WA
Arch64, Testing repo
头像
zhuqin_83
帖子: 10606
注册时间: 2006-05-13 4:02
联系:

Re: [杂感]Arch,喜欢上编译的理由

#124

帖子 zhuqin_83 » 2008-12-31 10:21

差点被你忽悠了,-fomit-frame-pointer只有在xf86_64才自动开启的,686的默认关闭。
测试结果是,-pipe与否没有任何影响,而-fomit-frame-pointer加上会有较大提升,如果你不需要debug,那么该选项开启比较好。
HP Pavilion DV6-2064CA: AMD Turion II Ultra Dual-Core Mobile M640, HD4650, 2GBx2 DDR2-800, Seagate 500GB 7200RPM SATA, BD-ROM
DELL UltraSharp 2209WA
Arch64, Testing repo
lovenevol
帖子: 2
注册时间: 2007-03-12 23:37

Re: [杂感]Arch,喜欢上编译的理由

#125

帖子 lovenevol » 2009-01-06 20:26

pcman、ABS、AUR
axlrose
帖子: 69
注册时间: 2007-02-11 15:58

Re: [杂感]Arch,喜欢上编译的理由

#126

帖子 axlrose » 2009-01-18 13:23

archlinux的确非常棒
用的人多的话人气也就上来了
KISS的东西的确好啊
axlrose
帖子: 69
注册时间: 2007-02-11 15:58

Re: [杂感]Arch,喜欢上编译的理由

#127

帖子 axlrose » 2009-01-18 13:26

这里讨论得这么热,不过irc还是那么点人气
大家有空多挂#arch-cn吧
irc.oftc.net #arch-cn 多交流
头像
lerosua
论坛版主
帖子: 8455
注册时间: 2007-11-29 9:41
联系:

Re: [杂感]Arch,喜欢上编译的理由

#128

帖子 lerosua » 2009-01-18 13:43

宣传arch,archer有责 :em11
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: [杂感]Arch,喜欢上编译的理由

#129

帖子 xiooli » 2009-01-18 13:48

哈哈,最近刚叛变,都心宜了好久了 :em11
poet
帖子: 2841
注册时间: 2006-09-11 22:47

Re: [杂感]Arch,喜欢上编译的理由

#130

帖子 poet » 2009-01-19 13:48

zhuqin_83 写了:差点被你忽悠了,-fomit-frame-pointer只有在xf86_64才自动开启的,686的默认关闭。
测试结果是,-pipe与否没有任何影响,而-fomit-frame-pointer加上会有较大提升,如果你不需要debug,那么该选项开启比较好。
如果这样的话,不是你被忽悠了,而是我们都被忽悠了。

我自己定参数是完全按照 gcc 的手册定的。而 gcc 手册明确说明 -O, -O2, -O3 都包含 -fomit-frame-pointer。
axlrose
帖子: 69
注册时间: 2007-02-11 15:58

Re: [杂感]Arch,喜欢上编译的理由

#131

帖子 axlrose » 2009-01-21 11:02

平时用gentoo, 偶尔用用archlinux感觉很棒
平时只是chroot去升级arch, 昨天又好好用用archlinux,不愧为第二喜欢的发行版
回复