Skip to contentSkip to conversation

kbuild: use -Oz instead of -Os when using clang

PATCH In review Matthias Kaehlcke 2 participants 7 messages Mar 28, 2017 – Apr 12, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: use -Oz instead of -Os when using clang

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index b2faa9319372..66bcdbf58371 100644
@@ -638,7 +638,8 @@ KBUILD_CFLAGS	+= $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS	+= $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS	+= $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS	+= -O2 $(call cc-disable-warning,maybe-uninitialized,)
Signature · 1 line
2.12.2.564.g063fe858b8-goog
#1 lore raw

2017-03-28 10:19 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 22 lines

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -2
index b2faa9319372..66bcdbf58371 100644
@@ -638,7 +638,8 @@ KBUILD_CFLAGS       += $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS  += $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS  += $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS  += -O2 $(call cc-disable-warning,maybe-uninitialized,)
--
Quoted 2 lines

2.12.2.564.g063fe858b8-goog

This is the same as the following commit in LLVMLinux except Author/Signed-off-by.

Who should the authorship really belong to?

commit 186e62808239c603bfa308d5ea994a10d67bb409

Author: Behan Webster <[email protected]>
Date:   Thu Oct 16 14:28:54 2014 +0200

LLVMLinux: use -Oz instead of -Os when using clang

This generates smaller resulting object code when compiled with clang.

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

El Fri, Mar 31, 2017 at 01:03:02AM +0900 Masahiro Yamada ha dit:

Quoted 29 lines

2017-03-28 10:19 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 13 lines

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index b2faa9319372..66bcdbf58371 100644

Makefile KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) · line 645

Quoted 9 lines
Makefile +2 -1
@@ -638,7 +638,8 @@ KBUILD_CFLAGS       += $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS  += $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS  += $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS  += -O2 $(call cc-disable-warning,maybe-uninitialized,)

This is the same as the following commit in LLVMLinux except Author/Signed-off-by.

Quoted 1 line

Who should the authorship really belong to?

(this time without html, sorry for the noise)

It should belong to Behan, I missed to add a 'From' tag, sorry about that. Should I resend with the tag or can you fix it when applying the patch?

Matthias

Quoted 11 lines

commit 186e62808239c603bfa308d5ea994a10d67bb409

Author: Behan Webster <[email protected]>
Date:   Thu Oct 16 14:28:54 2014 +0200

LLVMLinux: use -Oz instead of -Os when using clang

This generates smaller resulting object code when compiled with clang.

#3 lore raw

Hi Matthias,

2017-03-31 1:41 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 31 lines

El Fri, Mar 31, 2017 at 01:03:02AM +0900 Masahiro Yamada ha dit:

Quoted 29 lines

2017-03-28 10:19 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 13 lines

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index b2faa9319372..66bcdbf58371 100644

Makefile KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) · line 645

Quoted 9 lines
Makefile +2 -1
@@ -638,7 +638,8 @@ KBUILD_CFLAGS       += $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS  += $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS  += $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS  += -O2 $(call cc-disable-warning,maybe-uninitialized,)

This is the same as the following commit in LLVMLinux except Author/Signed-off-by.

Quoted 7 lines
Quoted 1 line

Who should the authorship really belong to?

(this time without html, sorry for the noise)

It should belong to Behan, I missed to add a 'From' tag, sorry about that. Should I resend with the tag or can you fix it when applying the patch?

No need to re-send it. I can fixup it manually.

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

Hi Masahiro,

El Fri, Mar 31, 2017 at 02:57:43AM +0900 Masahiro Yamada ha dit:

Quoted 34 lines

2017-03-31 1:41 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 33 lines

El Fri, Mar 31, 2017 at 01:03:02AM +0900 Masahiro Yamada ha dit:

Quoted 30 lines

2017-03-28 10:19 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 13 lines

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index b2faa9319372..66bcdbf58371 100644

Makefile KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) · line 645

Quoted 9 lines
Makefile +2 -1
@@ -638,7 +638,8 @@ KBUILD_CFLAGS       += $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS  += $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS  += $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS  += -O2 $(call cc-disable-warning,maybe-uninitialized,)

This is the same as the following commit in LLVMLinux except Author/Signed-off-by.

Who should the authorship really belong to?

Quoted 8 lines
Quoted 5 lines

(this time without html, sorry for the noise)

It should belong to Behan, I missed to add a 'From' tag, sorry about that. Should I resend with the tag or can you fix it when applying the patch?

No need to re-send it. I can fixup it manually.

I couldn't locate this patch in your tree, has it been picked up?

Thanks

Matthias

#5 lore raw

Hi Matthias,

2017-04-11 3:08 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 40 lines

Hi Masahiro,

El Fri, Mar 31, 2017 at 02:57:43AM +0900 Masahiro Yamada ha dit:

Quoted 36 lines

2017-03-31 1:41 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 35 lines

El Fri, Mar 31, 2017 at 01:03:02AM +0900 Masahiro Yamada ha dit:

Quoted 29 lines

2017-03-28 10:19 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 13 lines

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index b2faa9319372..66bcdbf58371 100644

Makefile KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) · line 645

Quoted 9 lines
Makefile +2 -1
@@ -638,7 +638,8 @@ KBUILD_CFLAGS       += $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS  += $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS  += $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS  += -O2 $(call cc-disable-warning,maybe-uninitialized,)

This is the same as the following commit in LLVMLinux except Author/Signed-off-by.

Quoted 1 line

Who should the authorship really belong to?

(this time without html, sorry for the noise)

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

It should belong to Behan, I missed to add a 'From' tag, sorry about that. Should I resend with the tag or can you fix it when applying the patch?

No need to re-send it. I can fixup it manually.

I couldn't locate this patch in your tree, has it been picked up?

I will pick this up shortly. Sorry for the delay.

Signature · 2 lines
Best Regards
Masahiro Yamada
#6 lore raw

2017-04-12 12:38 GMT+09:00 Masahiro Yamada <[email protected]>:

Quoted 49 lines

Hi Matthias,

2017-04-11 3:08 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 45 lines

Hi Masahiro,

El Fri, Mar 31, 2017 at 02:57:43AM +0900 Masahiro Yamada ha dit:

Quoted 41 lines

2017-03-31 1:41 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 38 lines

El Fri, Mar 31, 2017 at 01:03:02AM +0900 Masahiro Yamada ha dit:

Quoted 29 lines

2017-03-28 10:19 GMT+09:00 Matthias Kaehlcke <[email protected]>:

Quoted 13 lines

This generates smaller resulting object code when compiled with clang.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index b2faa9319372..66bcdbf58371 100644

Makefile KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) · line 645

Quoted 9 lines
Makefile +2 -1
@@ -638,7 +638,8 @@ KBUILD_CFLAGS       += $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS  += $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS  += $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS  += -O2 $(call cc-disable-warning,maybe-uninitialized,)

This is the same as the following commit in LLVMLinux except Author/Signed-off-by.

Quoted 1 line

Who should the authorship really belong to?

(this time without html, sorry for the noise)

It should belong to Behan, I missed to add a 'From' tag, sorry about that. Should I resend with the tag or can you fix it when applying the patch?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

No need to re-send it. I can fixup it manually.

I couldn't locate this patch in your tree, has it been picked up?

I will pick this up shortly. Sorry for the delay.

Applied to linux-kbuild/kbuild. Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada