Gentoo Archives: gentoo-user

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Is "-fomit-frame-pointer" a gcc default?
Date: Tue, 12 Jul 2016 10:07:56
Message-Id: 20160712130725.f4e0ea292e49319df56688d2@gentoo.org
In Reply to: [gentoo-user] Is "-fomit-frame-pointer" a gcc default? by waltdnes@waltdnes.org
1 Hi,
2
3 On Mon, 11 Jul 2016 16:27:42 -0400 waltdnes@××××××××.org wrote:
4 > I put it into CFLAGS/CCFLAGS years ago, and left it there. During a
5 > discussion on the Pale Moon forum about build options, the opinion seems
6 > to be that "-fomit-frame-pointer" is now the default. Is that o?
7 > I'd like to simplify my CFLAGS/CCFLAGS both in Gentoo and the Pale Moon
8 > build process.
9
10 gcc-5.3.0 manual says:
11 The default setting (when not optimizing for size) for 32-bit
12 GNU/Linux x86 and 32-bit Darwin x86 targets is
13 -fomit-frame-pointer. You can configure GCC with the
14 --enable-frame-pointer configure option to change the default.
15
16 So it depends not only on the arch, but also on how gcc was
17 compiled. Strange, but here Gentoo x86 I have -fomit-frame-pointer
18 disabled by default, so either gcc manpage is wrong or Gentoo
19 disables frame pointer during gcc configuration (I can't confirm the
20 latter after digging into toolchain eclass).
21
22 This flag is yummy on amd64 and very important on x86, since x86
23 has only 8 "general purpose" CPU registers, 4 of which have special
24 use, so only 4 are available for general computations and 1 of them
25 is wasted on frame-pointer, not nice. The cost of extra register is
26 that profiling is no longer possible and debugging may be mangled a
27 bit.
28
29 Looks like -fpic disables -fomit-frame-pointer at least for some
30 pieces of the code: hand-written 4-registers assembly makes -fpic
31 fail in some cases on x86 (e.g. ffmpeg).
32
33 Best regards,
34 Andrew Savchenko

Replies

Subject Author
Re: [gentoo-user] Is "-fomit-frame-pointer" a gcc default? konsolebox <konsolebox@×××××.com>