Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 4 Nov 2011 03:30:37 +0400
From: Solar Designer <solar@...nwall.com>
To: owl-dev@...ts.openwall.com
Subject: Re: gcc -fomit-frame-pointer

On Wed, Oct 26, 2011 at 07:36:05AM +0400, Solar Designer wrote:
> The texinfo documentation for gcc 4.6.1 says:
> 
>      Starting with GCC version 4.6, the default setting (when not
>      optimizing for size) for 32-bit Linux x86 and 32-bit Darwin x86
>      targets has been changed to `-fomit-frame-pointer'.  The default
>      can be reverted to `-fno-omit-frame-pointer' by configuring GCC
>      with the `--enable-frame-pointer' configure option.
> 
> However, my testing on Owl-current/i686 does not confirm this: I am
> getting code with frame pointers by default.  Our spec file does not
> pass the --enable-frame-pointer configure option.
> 
> Is there any substance behind the claim in the texinfo documentation at
> all?  Maybe a decision that was made and then reverted?

I proceeded to test this further, and I am getting behavior consistent
with the documentation now.  Perhaps I made an error in my testing
before.  (No, this does not appear to be a 4.6.1 vs. 4.6.2 thing.)
Maybe I was using -Os, which re-enables frame pointers (as documented),
likely because on 32-bit x86 instructions with addressing relative to
%ebp are one byte shorter than those using %esp.

I think we could want to use "-fno-omit-frame-pointer
-momit-leaf-frame-pointer" in our %optflags_lib_i686, even though this
has slight performance impact.  Otherwise backtraces probably don't work
even when debugging own code compiled with frame pointers enabled if it
happens to crash or is interrupted while in a library.

Any comments?

How do other distros deal with this?

Alexander

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ