mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Building root-debug without any optimisation
@ 2015-07-20  7:37 Alan Martinović
  2015-07-20  7:49 ` Juergen Borleis
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Martinović @ 2015-07-20  7:37 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1.1: Type: text/plain, Size: 1199 bytes --]

Hi,
I've noticed that the open source apps built with automake have default compile flags "-g -O2".
I would like to get a optimization free root-debug build with debug symbols.
I can replace all occurrences of "-g -O2" with "-g" in configure files but would like to hear comments if there is a better way of doing this.
For example.
Passing a global CFLAGS="-g" to all ./configure scripts?

Thanks


ALAN MARTINOVIĆ
DEVELOPMENT ENGINEER
ZENITEL NORWAY AS

Tel: +385 97 746 6662
alan.martinovic@zenitel.com<mailto:Alan.Martinovic@zenitel.com>

ZENITEL MARINE MED. OFFICE
PERMANI 28, HR-HR-51213 Jurdani, Croatia
Switchboard: +385 97 746 6662, Fax: +385 51 292 555
www.zenitel.com<http://www.zenitel.com/>
[default]<http://www.zenitel.com/en/Press-Center/News-releases/VINGTOR-and-STENTOFON-Become-One-Global-Brand/>

DISCLAIMER:
This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message.

[-- Attachment #1.1.2: Type: text/html, Size: 4863 bytes --]

[-- Attachment #1.2: image002.jpg --]
[-- Type: image/jpeg, Size: 4661 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] Building root-debug without any optimisation
  2015-07-20  7:37 [ptxdist] Building root-debug without any optimisation Alan Martinović
@ 2015-07-20  7:49 ` Juergen Borleis
  2015-07-20  8:06   ` Juergen Borleis
  0 siblings, 1 reply; 7+ messages in thread
From: Juergen Borleis @ 2015-07-20  7:49 UTC (permalink / raw)
  To: ptxdist; +Cc: Alan Martinović

Hi Alan,

On Monday 20 July 2015 09:37:00 Alan Martinović wrote:
> I've noticed that the open source apps built with automake have default
> compile flags "-g -O2". I would like to get a optimization free root-debug
> build with debug symbols. I can replace all occurrences of "-g -O2" with
> "-g" in configure files but would like to hear comments if there is a
> better way of doing this. For example.
> Passing a global CFLAGS="-g" to all ./configure scripts?

Yes, passing CFLAGS to all configure scripts will disable the automatic 
addition of the "-O2". You could also try to add "-g -O0", but sometimes 
packages tend to fail to build with the "O0" setting. And for best debugging 
you should disable builtins and inlining as well.

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Linux Solutions for Science and Industry      | Phone: +49-5121-206917-5128 |
Peiner Str. 6-8, 31137 Hildesheim, Germany    | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] Building root-debug without any optimisation
  2015-07-20  7:49 ` Juergen Borleis
@ 2015-07-20  8:06   ` Juergen Borleis
  2015-07-20  8:25     ` Alan Martinović
  0 siblings, 1 reply; 7+ messages in thread
From: Juergen Borleis @ 2015-07-20  8:06 UTC (permalink / raw)
  To: ptxdist; +Cc: Alan Martinović

Hi Alan,

On Monday 20 July 2015 09:49:32 myself wrote:
> On Monday 20 July 2015 09:37:00 Alan Martinović wrote:
> > I've noticed that the open source apps built with automake have default
> > compile flags "-g -O2". I would like to get a optimization free
> > root-debug build with debug symbols. I can replace all occurrences of "-g
> > -O2" with "-g" in configure files but would like to hear comments if
> > there is a better way of doing this. For example.
> > Passing a global CFLAGS="-g" to all ./configure scripts?
>
> Yes, passing CFLAGS to all configure scripts will disable the automatic
> addition of the "-O2". You could also try to add "-g -O0", but sometimes
> packages tend to fail to build with the "O0" setting. And for best
> debugging you should disable builtins and inlining as well.

Ahh, one additional thing: CFLAGS will also be effective in the non-debug root 
filesystem...

Regards,
Juergen
-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] Building root-debug without any optimisation
  2015-07-20  8:06   ` Juergen Borleis
@ 2015-07-20  8:25     ` Alan Martinović
  2015-07-20  8:52       ` Juergen Borleis
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Martinović @ 2015-07-20  8:25 UTC (permalink / raw)
  To: ptxdist

Hey Juergen,
thanks for the warning, I'll keep that in mind.

I seem to be doing something wrong.
In platformconfig->architecture->extra toolchain options I've set:
	debugging (enabled (full)    )
	(-g) Extra CPPFLAGS (cpp)
	(-g) Extra CFLAGS (c)   
	(-g) Extra CXXFLAGS (c++)
	
After which I did a clean and targetinstall for the desired package.
However, the compilation is still run with "-g -02".



ALAN MARTINOVIC
DEVELOPMENT ENGINEER
ZENITEL NORWAY AS

Tel: +385 97 746 6662
alan.martinovic@zenitel.com

ZENITEL MARINE MED. OFFICE
PERMANI 28, HR-HR-51213 Jurdani, Croatia
Switchboard: +385 97 746 6662, Fax: +385 51 292 555
www.zenitel.com


-----Original Message-----
From: Juergen Borleis [mailto:jbe@pengutronix.de] 
Sent: Monday, July 20, 2015 10:06 AM
To: ptxdist@pengutronix.de
Cc: Alan Martinović
Subject: Re: [ptxdist] Building root-debug without any optimisation

Hi Alan,

On Monday 20 July 2015 09:49:32 myself wrote:
> On Monday 20 July 2015 09:37:00 Alan Martinović wrote:
> > I've noticed that the open source apps built with automake have 
> > default compile flags "-g -O2". I would like to get a optimization 
> > free root-debug build with debug symbols. I can replace all 
> > occurrences of "-g -O2" with "-g" in configure files but would like 
> > to hear comments if there is a better way of doing this. For example.
> > Passing a global CFLAGS="-g" to all ./configure scripts?
>
> Yes, passing CFLAGS to all configure scripts will disable the 
> automatic addition of the "-O2". You could also try to add "-g -O0", 
> but sometimes packages tend to fail to build with the "O0" setting. 
> And for best debugging you should disable builtins and inlining as well.

Ahh, one additional thing: CFLAGS will also be effective in the non-debug root filesystem...

Regards,
Juergen
--
Pengutronix e.K.                              | Juergen Borleis             | Industrial Linux Solutions                    | http://www.pengutronix.de/  |

DISCLAIMER:
This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message.
-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] Building root-debug without any optimisation
  2015-07-20  8:25     ` Alan Martinović
@ 2015-07-20  8:52       ` Juergen Borleis
  2015-07-20  9:36         ` Olbrich Michael
  0 siblings, 1 reply; 7+ messages in thread
From: Juergen Borleis @ 2015-07-20  8:52 UTC (permalink / raw)
  To: ptxdist; +Cc: Olbrich Michael, Alan Martinović

Hi Alan,

On Monday 20 July 2015 10:25:03 Alan Martinović wrote:
> thanks for the warning, I'll keep that in mind.
>
> I seem to be doing something wrong.
> In platformconfig->architecture->extra toolchain options I've set:
> 	debugging (enabled (full)    )
> 	(-g) Extra CPPFLAGS (cpp)
> 	(-g) Extra CFLAGS (c)
> 	(-g) Extra CXXFLAGS (c++)
>
> After which I did a clean and targetinstall for the desired package.
> However, the compilation is still run with "-g -02".

Hmm, Michael should know the answer... :)

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] Building root-debug without any optimisation
  2015-07-20  8:52       ` Juergen Borleis
@ 2015-07-20  9:36         ` Olbrich Michael
  2015-07-20 11:00           ` Alan Martinović
  0 siblings, 1 reply; 7+ messages in thread
From: Olbrich Michael @ 2015-07-20  9:36 UTC (permalink / raw)
  To: ptxdist

Hi,

On Mon, Jul 20, 2015 at 10:52:11AM +0200, Juergen Borleis wrote:
> On Monday 20 July 2015 10:25:03 Alan Martinović wrote:
> > thanks for the warning, I'll keep that in mind.
> >
> > I seem to be doing something wrong.
> > In platformconfig->architecture->extra toolchain options I've set:
> > 	debugging (enabled (full)    )
> > 	(-g) Extra CPPFLAGS (cpp)
> > 	(-g) Extra CFLAGS (c)
> > 	(-g) Extra CXXFLAGS (c++)
> >
> > After which I did a clean and targetinstall for the desired package.
> > However, the compilation is still run with "-g -02".
> 
> Hmm, Michael should know the answer... :)

I can only tell you why this doesn't work. The "Extra CFLAGS" are _not_
used to set the CFLAGS environment variable. We use wrapper scripts for the
compiler and basically fake different defaults. The configure script will
never see the options you set here. Anything else doesn't work reliably.
Some packages ignore the specified CFLAGS, other always add '-g -O2' etc.

There is currently no way to force a different optimization level globally.
We have it for debugging (PTXCONF_TARGET_DEBUG_*). You'll need to hack
ptxdist to do the same for optimization.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] Building root-debug without any optimisation
  2015-07-20  9:36         ` Olbrich Michael
@ 2015-07-20 11:00           ` Alan Martinović
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Martinović @ 2015-07-20 11:00 UTC (permalink / raw)
  To: ptxdist

All clear now, thanks for the explanation Michael.
 
ALAN MARTINOVIC
DEVELOPMENT ENGINEER
ZENITEL NORWAY AS

Tel: +385 97 746 6662
alan.martinovic@zenitel.com

ZENITEL MARINE MED. OFFICE
PERMANI 28, HR-HR-51213 Jurdani, Croatia
Switchboard: +385 97 746 6662, Fax: +385 51 292 555
www.zenitel.com


-----Original Message-----
From: ptxdist [mailto:ptxdist-bounces@pengutronix.de] On Behalf Of Olbrich Michael
Sent: Monday, July 20, 2015 11:36 AM
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Building root-debug without any optimisation

Hi,

On Mon, Jul 20, 2015 at 10:52:11AM +0200, Juergen Borleis wrote:
> On Monday 20 July 2015 10:25:03 Alan Martinović wrote:
> > thanks for the warning, I'll keep that in mind.
> >
> > I seem to be doing something wrong.
> > In platformconfig->architecture->extra toolchain options I've set:
> > 	debugging (enabled (full)    )
> > 	(-g) Extra CPPFLAGS (cpp)
> > 	(-g) Extra CFLAGS (c)
> > 	(-g) Extra CXXFLAGS (c++)
> >
> > After which I did a clean and targetinstall for the desired package.
> > However, the compilation is still run with "-g -02".
> 
> Hmm, Michael should know the answer... :)

I can only tell you why this doesn't work. The "Extra CFLAGS" are _not_ used to set the CFLAGS environment variable. We use wrapper scripts for the compiler and basically fake different defaults. The configure script will never see the options you set here. Anything else doesn't work reliably.
Some packages ignore the specified CFLAGS, other always add '-g -O2' etc.

There is currently no way to force a different optimization level globally.
We have it for debugging (PTXCONF_TARGET_DEBUG_*). You'll need to hack ptxdist to do the same for optimization.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

--
ptxdist mailing list
ptxdist@pengutronix.de

DISCLAIMER:
This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message.
-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-20  9:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20  7:37 [ptxdist] Building root-debug without any optimisation Alan Martinović
2015-07-20  7:49 ` Juergen Borleis
2015-07-20  8:06   ` Juergen Borleis
2015-07-20  8:25     ` Alan Martinović
2015-07-20  8:52       ` Juergen Borleis
2015-07-20  9:36         ` Olbrich Michael
2015-07-20 11:00           ` Alan Martinović

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox