Skip to contentSkip to conversation

Config.in: add -Og option

PATCH Superseded Martin Kelly 3 participants 5 messages May 18, 2016 – May 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Config.in: add -Og option

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

---
Changes since v2:
- BR2_OPTIMIZE_g renamed to BR2_OPTIMIZE_G

---
 Config.in           | 10 ++++++++++
 package/Makefile.in |  3 +++
 2 files changed, 13 insertions(+)
Config.in +10 -0
index 9bc8e51..16ebce2 100644
@@ -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
package/Makefile.in +3 -0
index 616bdd0..2d454a6 100644
@@ -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

#1 lore raw

PATCH v3 1/1 Config.in: add -Og option

Quoted 5 lines · Martin Kelly

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

For next, obviously.

As I wrote separately, rewrapping the entire Config.in can be done in a
separate patch.

Regards,
Arnout

Quoted 47 lines

---
Changes since v2:
- BR2_OPTIMIZE_g renamed to BR2_OPTIMIZE_G

---
 Config.in           | 10 ++++++++++
 package/Makefile.in |  3 +++
 2 files changed, 13 insertions(+)
Config.in +10 -0
index 9bc8e51..16ebce2 100644
@@ -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
package/Makefile.in +3 -1
index 616bdd0..2d454a6 100644
@@ -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

Signature · 6 lines
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
#2 lore raw

PATCH v3 1/1 Config.in: add -Og option

Quoted 5 lines · Arnout Vandecappelle
Quoted 4 lines · Martin Kelly

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

Quoted 9 lines
Quoted 1 line

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.

#3 lore raw

PATCH v3 1/1 Config.in: add -Og option

Quoted 12 lines · Martin Kelly
Quoted 11 lines · Arnout Vandecappelle
Quoted 5 lines · Martin Kelly

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

For next, obviously.

Quoted 8 lines
Quoted 3 lines

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

Signature · 6 lines
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
#4 lore raw

PATCH v3 1/1 Config.in: add -Og option

In reply to Martin Kelly

Hello,

Quoted 4 lines · Martin Kelly

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

Quoted 8 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com