linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
@ 2015-09-15  3:19 Sedat Dilek
  2015-09-15  3:40 ` Behan Webster
  0 siblings, 1 reply; 4+ messages in thread
From: Sedat Dilek @ 2015-09-15  3:19 UTC (permalink / raw)
  To: Michal Marek, linux-kbuild, linux-kernel; +Cc: Sedat Dilek, Behan Webster

Based on a patch of Behan Webster (see [1]).

CLANG (here: v3.7) requires '-Oz' as OptLevel to be set.

A Linux v4.3-rc1 kernel built fine with CONFIG_CC_OPTIMIZE_FOR_SIZE=y
and boots on bare metal.
This is a Ubuntu/precise AMD64 system.

Tested against Linux v4.3-rc1 and a refreshed llvmlinux patchset.

[1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/all/patches/smaller.patch

CC: Behan Webster <behanw@converseincode.com>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4249441e535d..a57fb6b39ed7 100644
--- a/Makefile
+++ b/Makefile
@@ -622,7 +622,8 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-delete-null-pointer-checks,)
 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
 KBUILD_CFLAGS	+= -O2
 endif
-- 
2.5.2


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

end of thread, other threads:[~2015-09-15  4:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15  3:19 [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE Sedat Dilek
2015-09-15  3:40 ` Behan Webster
2015-09-15  4:07   ` Sedat Dilek
2015-09-15  4:29     ` Behan Webster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).