Gregor Jasny | 26 Jun 2012 10:22

How to build optimized with debug symbols

Hello,

I noticed that if I do a regular configure any CFLAGS related to
generating debug output are scrubbed and replaced by ­g0. If I set
‹enable-debug the optimization level drops from 2 to 0.

Is there a way to get ­g and ­O2?

Thanks,
Gregor
--

-- 
Gregor Jasny
Senior Software Developer
Citrix Online Services Division

T: +49 351 49775 018 | F: +49 351 49775 030
http://www.citrixonline.com/

Citrix Online Germany GmbH | Theaterstr. 6 | D-01067 Dresden
Geschäftsführer: Scott Allen | Brett Caine | Robert Gratzl
Sitz der Gesellschaft: Karlsruhe | Registergericht: Amtsgericht Mannheim
HRB 711959 

René Berber | 26 Jun 2012 19:57
Picon
Gravatar

Re: How to build optimized with debug symbols

On 6/26/2012 3:22 AM, Gregor Jasny wrote:

> I noticed that if I do a regular configure any CFLAGS related to
> generating debug output are scrubbed and replaced by ­g0. If I set
> ‹enable-debug the optimization level drops from 2 to 0.
>
> Is there a way to get ­g and ­O2?

./configure ... --enable-debug --enable-optimize=-O2

also

./configure ... --enable-debug CFLAGS='-O2 -ggdb3'

but in this last case, using CFLAGS, the actual debug option is overridden:

$ grep -E "^CFLAGS" Makefile
CFLAGS = -O2 -g ...

all other similar alternatives end, like you said, with the options in 
CFLAGS being overridden.
--

-- 
René Berber

Yang Tse | 26 Jun 2012 22:40
Picon

Re: How to build optimized with debug symbols

Gregor Jasny <Gregor.Jasny@...> wrote:

> I noticed that if I do a regular configure any CFLAGS related to
> generating debug output are scrubbed and replaced by ­g0. If I set
> ‹enable-debug the optimization level drops from 2 to 0.
>
> Is there a way to get ­g and ­O2?

./configure --enable-debug --enable-optimize

Although you may not be able to fully debug generated code.

--

-- 
-=[Yang]=-


Gmane