lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1442287188-11326-1-git-send-email-sedat.dilek@gmail.com>
Date:	Tue, 15 Sep 2015 05:19:48 +0200
From:	Sedat Dilek <sedat.dilek@...il.com>
To:	Michal Marek <mmarek@...e.com>, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc:	Sedat Dilek <sedat.dilek@...il.com>,
	Behan Webster <behanw@...verseincode.com>
Subject: [PATCH] kbuild: llvmlinux: Set appropriate compiler-flag for CONFIG_CC_OPTIMIZE_FOR_SIZE

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ