* [Buildroot] [PATCH v3] Config.in: add -Og option
@ 2016-05-18 21:17 Martin Kelly
2016-05-18 22:25 ` Arnout Vandecappelle
2016-05-24 21:30 ` Thomas Petazzoni
0 siblings, 2 replies; 5+ messages in thread
From: Martin Kelly @ 2016-05-18 21:17 UTC (permalink / raw)
To: buildroot
-Og (introduced in GCC 4.8) lets you optimize for debugging experience,
which can be useful for when you want optimized code that is nonetheless
debuggable.
Signed-off-by: Martin Kelly <martin@surround.io>
---
Changes since v2:
- BR2_OPTIMIZE_g renamed to BR2_OPTIMIZE_G
---
Config.in | 10 ++++++++++
package/Makefile.in | 3 +++
2 files changed, 13 insertions(+)
diff --git a/Config.in b/Config.in
index 9bc8e51..16ebce2 100644
--- a/Config.in
+++ b/Config.in
@@ -510,6 +510,16 @@ config BR2_OPTIMIZE_3
and also turns on the -finline-functions, -funswitch-loops and
-fgcse-after-reload options.
+config BR2_OPTIMIZE_G
+ bool "optimize for debugging"
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+ help
+ Optimize for debugging. This enables optimizations that do not
+ interfere with debugging. It should be the optimization level of
+ choice for the standard edit-compile-debug cycle, offering a
+ reasonable level of optimization while maintaining fast compilation
+ and a good debugging experience.
+
config BR2_OPTIMIZE_S
bool "optimize for size"
help
diff --git a/package/Makefile.in b/package/Makefile.in
index 616bdd0..2d454a6 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -122,6 +122,9 @@ endif
ifeq ($(BR2_OPTIMIZE_3),y)
TARGET_OPTIMIZATION = -O3
endif
+ifeq ($(BR2_OPTIMIZE_G),y)
+TARGET_OPTIMIZATION = -Og
+endif
ifeq ($(BR2_OPTIMIZE_S),y)
TARGET_OPTIMIZATION = -Os
endif
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v3] Config.in: add -Og option
2016-05-18 21:17 [Buildroot] [PATCH v3] Config.in: add -Og option Martin Kelly
@ 2016-05-18 22:25 ` Arnout Vandecappelle
2016-05-18 23:03 ` Martin Kelly
2016-05-24 21:30 ` Thomas Petazzoni
1 sibling, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2016-05-18 22:25 UTC (permalink / raw)
To: buildroot
On 05/18/16 23:17, Martin Kelly wrote:
> -Og (introduced in GCC 4.8) lets you optimize for debugging experience,
> which can be useful for when you want optimized code that is nonetheless
> debuggable.
>
> Signed-off-by: Martin Kelly <martin@surround.io>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
For next, obviously.
As I wrote separately, rewrapping the entire Config.in can be done in a
separate patch.
Regards,
Arnout
> ---
> Changes since v2:
> - BR2_OPTIMIZE_g renamed to BR2_OPTIMIZE_G
> ---
> Config.in | 10 ++++++++++
> package/Makefile.in | 3 +++
> 2 files changed, 13 insertions(+)
>
> diff --git a/Config.in b/Config.in
> index 9bc8e51..16ebce2 100644
> --- a/Config.in
> +++ b/Config.in
> @@ -510,6 +510,16 @@ config BR2_OPTIMIZE_3
> and also turns on the -finline-functions, -funswitch-loops and
> -fgcse-after-reload options.
>
> +config BR2_OPTIMIZE_G
> + bool "optimize for debugging"
> + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
> + help
> + Optimize for debugging. This enables optimizations that do not
> + interfere with debugging. It should be the optimization level of
> + choice for the standard edit-compile-debug cycle, offering a
> + reasonable level of optimization while maintaining fast compilation
> + and a good debugging experience.
> +
> config BR2_OPTIMIZE_S
> bool "optimize for size"
> help
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 616bdd0..2d454a6 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -122,6 +122,9 @@ endif
> ifeq ($(BR2_OPTIMIZE_3),y)
> TARGET_OPTIMIZATION = -O3
> endif
> +ifeq ($(BR2_OPTIMIZE_G),y)
> +TARGET_OPTIMIZATION = -Og
> +endif
> ifeq ($(BR2_OPTIMIZE_S),y)
> TARGET_OPTIMIZATION = -Os
> endif
> --
> 2.1.4
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v3] Config.in: add -Og option
2016-05-18 22:25 ` Arnout Vandecappelle
@ 2016-05-18 23:03 ` Martin Kelly
2016-05-19 19:32 ` Arnout Vandecappelle
0 siblings, 1 reply; 5+ messages in thread
From: Martin Kelly @ 2016-05-18 23:03 UTC (permalink / raw)
To: buildroot
On 05/18/2016 03:25 PM, Arnout Vandecappelle wrote:
> On 05/18/16 23:17, Martin Kelly wrote:
>> -Og (introduced in GCC 4.8) lets you optimize for debugging experience,
>> which can be useful for when you want optimized code that is nonetheless
>> debuggable.
>>
>> Signed-off-by: Martin Kelly <martin@surround.io>
>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
> For next, obviously.
>
> As I wrote separately, rewrapping the entire Config.in can be done in
> a separate patch.
>
I'd be happy to submit a rewrapping patch, once this one is accepted (to
avoid merge conflicts). However, it has high merge conflict potential.
I'll base it on next, but it may need a bit of fixing up before being
accepted if any patches go in between submission and acceptance.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v3] Config.in: add -Og option
2016-05-18 23:03 ` Martin Kelly
@ 2016-05-19 19:32 ` Arnout Vandecappelle
0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2016-05-19 19:32 UTC (permalink / raw)
To: buildroot
On 05/19/16 01:03, Martin Kelly wrote:
> On 05/18/2016 03:25 PM, Arnout Vandecappelle wrote:
>> On 05/18/16 23:17, Martin Kelly wrote:
>>> -Og (introduced in GCC 4.8) lets you optimize for debugging experience,
>>> which can be useful for when you want optimized code that is nonetheless
>>> debuggable.
>>>
>>> Signed-off-by: Martin Kelly <martin@surround.io>
>>
>> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>>
>> For next, obviously.
>>
>> As I wrote separately, rewrapping the entire Config.in can be done in
>> a separate patch.
>>
>
> I'd be happy to submit a rewrapping patch, once this one is accepted (to avoid
> merge conflicts). However, it has high merge conflict potential. I'll base it on
> next, but it may need a bit of fixing up before being accepted if any patches go
> in between submission and acceptance.
There have just been 6 changes this year in Config.in so the risk of conflicts
is not that high.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v3] Config.in: add -Og option
2016-05-18 21:17 [Buildroot] [PATCH v3] Config.in: add -Og option Martin Kelly
2016-05-18 22:25 ` Arnout Vandecappelle
@ 2016-05-24 21:30 ` Thomas Petazzoni
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-05-24 21:30 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 18 May 2016 14:17:55 -0700, Martin Kelly wrote:
> -Og (introduced in GCC 4.8) lets you optimize for debugging experience,
> which can be useful for when you want optimized code that is nonetheless
> debuggable.
>
> Signed-off-by: Martin Kelly <martin@surround.io>
> ---
> Changes since v2:
> - BR2_OPTIMIZE_g renamed to BR2_OPTIMIZE_G
> ---
> Config.in | 10 ++++++++++
> package/Makefile.in | 3 +++
> 2 files changed, 13 insertions(+)
Applied to next, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-05-24 21:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18 21:17 [Buildroot] [PATCH v3] Config.in: add -Og option Martin Kelly
2016-05-18 22:25 ` Arnout Vandecappelle
2016-05-18 23:03 ` Martin Kelly
2016-05-19 19:32 ` Arnout Vandecappelle
2016-05-24 21:30 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox