From: Sedat Dilek <sedat.dilek@gmail.com>
To: Michal Marek <mmarek@suse.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
Behan Webster <behanw@converseincode.com>
Subject: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE
Date: Tue, 15 Sep 2015 05:19:48 +0200 [thread overview]
Message-ID: <1442287188-11326-1-git-send-email-sedat.dilek@gmail.com> (raw)
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
next reply other threads:[~2015-09-15 3:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 3:19 Sedat Dilek [this message]
2015-09-15 3:40 ` [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE Behan Webster
2015-09-15 4:07 ` Sedat Dilek
2015-09-15 4:29 ` Behan Webster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442287188-11326-1-git-send-email-sedat.dilek@gmail.com \
--to=sedat.dilek@gmail.com \
--cc=behanw@converseincode.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).