# [solved] -fomit-frame-pointer not work on VIA C7 NanoBGA2 ?

## nekromancer

After hours of trying to figure out why the compiler was failing... it ended up being the cflag of -fomit-frame-pointer that was throwing me the dreaded "C compiler cannot create executables"

Though I have not seen any warning of this anywhere on any site, even on http://arnolds.dhs.org/steves_world/acpi_netbook_kernel_tips_html they use it.

I have a VIA C7 NanoBGA2 processor (although linux sees it as VIA C7 family 6 model 13)

argh!Last edited by nekromancer on Wed Feb 03, 2010 10:29 pm; edited 1 time in total

----------

## Dominique_71

It is not a gentoo recommended cflag. Beside -O, -march (or -mtune) and -pipe (if you have enough memory), it is no other recommended cflag into the handbook.

If you want to be on a safe way with gentoo, just don't use any other cflag than the ones recommended into the handbook. Another safe way is to do profiling on every single program, but do you have the time to do that?

----------

## Jaglover

I suspect you had a typo. -fomit-frame-pointer is considered safe.

----------

## Dominique_71

Yes, safe and recommended are not the same thing.

----------

## Jaglover

Recommended or not, safe or not, it does not cause "C compiler cannot create executables" error.

----------

## Dominique_71

According to nekromancer, it doesn't work with it, but it work without it  :Exclamation: 

Or this is another problem. It can be than, after an update, gcc doesn't work anymore (is broken) and you get this kind of warning during the configure step. But in such a case, the only solution is to repair gcc, and for that you need another installed and working gcc version or the live gentoo cd.

----------

## Chaosite

I suggest you try gcc outside of emerge.

Something like this (save as hello.c):

```
#include <stdio.h>

int main(int argc, char **argv)

{

    printf("hello, world")

    return 0;

}
```

Then compile it twice:

```
$ gcc -o hello1 hello.c

$ gcc -fomit-frame-pointer -o hello2 hello.c

```

Now run both programs and see if they work. If one of them fails, tell us how!

----------

## nekromancer

The gentoo handbook states

 *Quote:*   

> 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.

 

They don't explicitly say it is neither safe nor recommended but I assume that because it is in the handbook that it is safe to use it so long as you're not going to do any application debugging. Beside that I've always used it since gentoo 1.4.

I tried that test Chaosite posted and both worked. I re-added -fomit-frame-pointer in my make.conf and I was able to emerge programs.

I only got this problem when emerging packages during the install phase while chrooted into the new installation (still on the live dvd 10.1) before rebooting.

Thanks for posting suggestions and your thoughts.

----------

## EzInKy

 *nekromancer wrote:*   

> The gentoo handbook states
> 
>  *Quote:*   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. 
> 
> They don't explicitly say it is neither safe nor recommended but I assume that because it is in the handbook that it is safe to use it so long as you're not going to do any application debugging. Beside that I've always used it since gentoo 1.4
> ...

 

Application debugging is not the only reason to use a frame pointer. A clear function entry and exit point make it much easier to insert checks that code has not been altered from the original compilation.

----------

## Dominique_71

It is another was to say my thinking about -fomit-frame-pointer. If you want to be on a so sure way than possible, use the same flags than the gentoo developers, that is something like the example into the handbook:

```
CFLAGS="-march=k8 -O2 -pipe"
```

Glad to see than your problem is gone. 

Please add [solved] into the subject.

----------

